Tripwire VERT Hack Lab Cheat Sheet
Tripwire VERT Hack Lab Cheat Sheet
Tripwire VERT Hack Lab Cheat Sheet
TESTING STRATEGY
»»Connect device and/or smartphone through MiTM access point (e.g. bit.ly/SSLMiTM)
• Look for credentials being passed that were not selected by the device owner and commands without auth
»» a port scan to see what services are exposed via IP
Run
• Try connecting to each service with nc ip port and openssl s_client –connect ip:port
• Fuzz UPnP/SOAP services with command injection and SQL injection locator strings specified as parameters
HTTP INTERFACE TESTING
Many of the weaknesses found in IoT devices are found in HTTP interfaces for controlling or managing the product. Vulnerable
aspects of these systems can commonly be found with quick black box testing. Some of VERT’s techniques involve submitting
crafted values to the web server as a form of manual fuzz testing. Developers commonly restrict the crafted input only by client-side
limitations. Sometimes this is done through regular expressions within JavaScript or Flash while other times URL parameters are
hardcoded into mobile applications. The use of a proxy server such as Burp (www.portswigger.net/), Chrome Developer Tools, or
FireBug allow the tester to side-step these restrictions. From there it is a matter of knowing what to look for and how to abuse it.
TIP 1: LOOK FOR PLACES WHERE EXTERNALLY SUPPLIED INPUT MAY BE USED FOR RUNNING COMMANDS.
Example #1: Diagnostic functions like ping are often backed with something like system(“ping %s”,cHost);
If shell meta-characters are sent to the shell, an attacker can gain command execution.
‘echo <expected value>’ • $(echo <expected value>) Acts the same as if <expected value> were entered
;ping ip • ‘ping ip’ • $(ping ip) • && ping ip • || ping ip ICMP echo sent to ip and response may be delayed waiting
OUTPUT: Recursively extract into ./_firmware/ OUTPUT: Identify requests that don’t give 401
Analyzing the firmware content can reveal a lot: Whitelisted files expose information and even vulnerability:
»» Unlinked web content »» curl –v ip/$P 2>&1|grep “HTTP/1.0 200” && echo $P
»» Vulnerabilities in scripts and configs »» If ‘foo’ or ‘.foo’ is open, try ‘?foo’ or ‘?.foo’ after query
»» Undocumented features in binary strings »» Grep page contents for passwords or tokens
»» Other tools: ‘7z x <file>’ or ‘unsquashfs <file>’ »» Look for pages with ‘hidden’ or ‘debug’ in the name
OUTPUT: Recover assembly for proprietary binaries OUTPUT: Text sections, symbols, and more
Reverse engineering is time consuming but valuable: Strings is a quick and dirty binary recon tool:
»» Find unbounded copies (memcpy, strcpy, etc) »» Check httpd for built-in pages and ACLs
»» Reveal unreferenced API calls »» Search for %s in command strings
»» Recover crypto keys and other secrets »» Backdoor/hardcoded credentials hide in binaries
»» Determine expected message formats »» Locate SQL queries for injection attempts
OUTPUT: Deauthenticate device from access point OUTPUT: Find certificate validation failures
Some basic flaws related to Wi-Fi handling: Some setup is required:
»» Device becomes open AP when kept off network »» Connect IoT through Linux router
»» Restarting device without net leads to first-time setup »» Apply iptables NAT to redirect SSL ports to <port>
»» Will device connect to SSID without password? »» Self-signed signing cert needed
»» IoT devices are easy for sniffing handshake »» Logged data means the device trusted forged cert
EXTRACTING SECRETS FROM ANDROID STATIC ANALYSIS EXTRACTING SECRETS FROM ANDROID DYNAMIC ANALYSIS
apktool d <IoT control app>.apk “Packet Capture” app, sslsplit/sslsniff with trusted cert
OUTPUT: Extract and decompile Android app OUTPUT: View data sent to device and infrastructure
Things to look for: Things to look for:
»» Hardcoded device credentials »» Hardcoded credentials sent via HTTP/HTTPS
»» Unadvertised URLs on IoT target »» Services and URLs used for device control
»» Empty checkServerTrusted method (SSL fail) »» Privacy violations (i.e. exfiltrated data)
»» Firmware update URLs »» Firmware update URLs
u Tripwire is a leading provider of security, compliance and IT operations solutions for enterprises, industrial organizations,
service providers and government agencies. Tripwire solutions are based on high-fidelity asset visibility and deep endpoint
intelligence combined with business context; together these solutions integrate and automate security and IT operations.
Tripwire’s portfolio of enterprise-class solutions includes configuration and policy management, file integrity monitoring, vul-
nerability management, log management, and reporting and analytics. Learn more at tripwire.com. u