SlideShare a Scribd company logo
S O H O p e l e s s l y B r o k e n
A Hacker’s Perspective on Embedded
Device Security
Who Am I?
ISE Confidential - not for distribution
Paul Dant
Chief Strategist @ ISE
9: First digital product
13: First legit black hat hack
17: First hacker caught
19: First legit white hat hack
(p0wned a bank data
processing center as part of
a compliance audit)
About ISE
• We are:
- Ethical Hackers
- Computer Scientists
• Our clients are:
- Fortune 500 Enterprises
- Entertainment, Security Software, Healthcare
• Our perspective is:
– Everything is broken!
– White hat testing rules
Why Should You Listen To Us?
• 100% of network systems evaluated were
vulnerable to exploitation.
• Routers and storage systems are not the
only embedded devices with egregious
deficiencies.
• These systems CAN and ARE being mass
exploited.
#SOHOpelessly Broken
HACK ROUTERS AND GET PAID
https://sohopelesslybroken.com
DEFCON 23, DerbyCon v4.0, BSIDES DC, ToorCon
We launched the first IoT Village @ DEFCON 23
ISE Confidential | Not for Distribution
ISE IoT Village DEF CON 23
Agenda
Embedded Device Security Risks
Why Do We Care?
Hacking Methodology
Real World Examples
What Can We Do?
Summary and Q&A
ISE Confidential | Not for Distribution
Embedded Device Security Risks
• Large attack surface
• Default configurations are typically not
secure at all
• Assumption of security on the (wireless) LAN
• Poor security design and implementation
Why Do We Care?
• Large attack surface
• Insecure by default
• Assumption of
security on the
(wireless) LAN
• Poor (or missing!)
security design and
implementation
Hacking Methodology
• Information Gathering
• Scanning and Enumeration
• Gaining Access
• Maintaining Access
Information Gathering
• Administration Settings
– Default credentials
– Management interface(s)
• WLAN Settings
– SSID and wireless encryption
• Network Service Settings
– DHCP, DNS, SNMP, UPnP, SMB, FTP, etc.
Scanning and Enumeration
• Identifying active hosts
• Identifying open TCP/UDP ports
• Identifying running services and versions
Scanning and Enumeration Cont.
Port Scan
Banner Grab
TCP: nmap –sS –Pn –sV –p T:1-65535 X.X.X.X
UDP: nmap –sU –Pn –p U:1-65535 X.X.X.X
Netcat: nc –nv <X.X.X.X> <port>
Gaining Access
• Service Investigation
– Analyze web applications
– Analyze servers (e.g., FTP, SMTP, SMB, HTTP)
– Source Code Review (Static Code Analysis)
– Fuzz Network Services (Dynamic Analysis)
Analyzing Web Applications
• Understand the application
– Programming languages used
• Server side (e.g., PHP, .NET, Python, ASP, Ruby on Rails)
• Client side (e.g., JavaScript, HTML, JSON, Flash)
– Protocols and APIs used (e.g., SOAP, REST)
– Internet Media Type/MIME (e.g., JavaScript, HTML)
• Toolz
– Web proxy (i.e., Burpsuite)
– Firebug (JavaScript debugger, HTML inspection)
– Web Crawler
Analyzing Web Applications Cont.
Burpsuite
Firebug
Analyzing Network Servers
• Authentication
– Type (e.g., Password, Key Pair)
– Anonymous access/Weak or no credentials
– Misconfigurations (e.g., Directory listing, permissions)
• Encryption
– SSL/TLS?
– SSH (AES, 3DES)?
Static Code Analysis
• If source code is available, GET IT!
• Things to look for:
– Logic flaws (e.g., authentication, authorization)
– Functions not performing bounds-checking
– Backdoors
Fuzzing (Dynamic Analysis)
• What happens if peculiar input is introduced?
– A{-G42!BBB}}}}}}///}}}}}}+=-_-1234d`~~((.)_(.))$
– AAAAAAAAAAAAAAAAAAAAAAAAAA
• Fuzzers
– SPIKE: generic_send_tcp X.X.X.X 21 ftp.spk 0 0
– BED: ./bed.pl -s HTTP -t X.X.X.X -p 80
– Metasploit Framework
– Python!
SPIKE
Spike
Template
(*.spk)
SPIKE Cont.
Fuzzing with Spike
Analyze Fuzzing Results
• Toolz
– Debugger (i.e., GDB)
– System Call Tracer (i.e., strace)
*Debugging ASUS
RT-AC66U exploit
Gaining Access
• Reverse Engineering
– System Binaries
• Simple RE Toolz and Techniques
– Strings
– Hexdump
– Grep
– Open source? Perform static analysis!
• Exploit Development
Reverse Engineering Toolz and
Techniques
• Strings: strings –n <INT> <FILE>
*TP-Link TL-1043ND Firmware
Reverse Engineering Toolz and
Techniques
• Grep: grep –R <string> *
*Code from the TRENDnet TEW-812DRU
Exploit Development
• Cross-Site Request Forgery
• Command Injection
• Missing Function Level Access Control
– Authentication Bypass
– Authorization Bypass
• Directory Traversal
• Buffer Overflow
Cross-Site Request Forgery
#define: CSRF is an attack
that forces an unsuspecting victim
into executing web commands
that perform unwanted actions on
a web application.
Gimppy
(Attacker)
Jad
(Victim)
Web
Application
Attacker
Web Server
Testing for Cross-Site Request Forgery
• Anti-CSRF Tokens?
• HTTP referrer checking?
Cross-Site Request Forgery
Countermeasures
• Users
– Logout of web applications
– Do NOT save credentials in your browser
• Developers
– Implement Anti-CSRF tokens AND HTTP
referrer checking
– Feeling ambitious? Require the user to
authenticate before performing a state change
Command Injection
#define:
Command Injection
is a form of attack
where operating
system specific
commands are
injected into a
vulnerable application
for execution.
Testing for Command Injection
• Survey the application
– Look for application features that could call underlying
system functionality(e.g., ping, traceroute)
– Source code? Static analysis!
• Test Examples
– ifconfig ; cat /etc/passwd  Linux
– dir | ipconfig  Windows/Linux
– ls /var/www/`<cmd>` or $(<cmd>)  Linux**Command substitution
Command Injection – Vulnerable Code
<?php
$dig=shell_exec("dig {$_GET['Domain']}");
echo($dig);
?>
Command Injection Countermeasures
• Developers
– Avoid calling shell commands when possible
– If an API does not exist, sanitize user input
before passing it to a function that executes
system commands.
• Python Example
– BAD: os.system(‘ls ‘ + dir)
– GOOD: os.listdir(dir)
Missing Function Level Access Control
#define: The absence of
server-side authentication and
authorization checks.
Testing for Missing Function Level
Access Control
• Calling privileged API’s as an
unprivileged user.
• Accessing system resources that do
not belong to the attacker.
– Insecure Direct Object Reference
– Direct Request/Forced Browsing
Missing Function Level Access Controls
Countermeasures
• Developers
– Perform server-side authentication and
authorization checks.
Directory Traversal
#define: Directory Traversal is a form of attack where an
attacker can access files and directories outside of the
intended directory.
Testing for Directory Traversal
• Enumerate the application
– Are there commands or request parameters that could be used
for file-related operations?
• URL Encoding (Web only)
– %2f  /
– %2e%2e%2f  ../
• Test Examples
– http://infosec2.blogspot.com/DT.php?file=../../../../etc/passwd%00
– http://JadWebApp.com/DT.php?dir=..%2f..%2fetc%2fpasswd
– symlink / rootfs  SMB
Directory Traversal– Vulnerable Code
<?php
if ($_GET['file'])
$file = $_GET['file'];
include('/var/www/'.$file);
?>
Directory Traversal Countermeasures
• Developers
– Try not to use user input in file system calls
– Perform path canonicalization (symlinks, . & .. are
resolved)
– Properly configure services
Buffer Overflow
#define: Buffer Overflows occur when a program attempts
to write data that exceeds the capacity of a fixed length
buffer, and consequently, overwrites adjacent memory.
Stack Based Buffer Overflow (x86)
Testing for Buffer Overflows
• Testing for overflows
– Dynamic Analysis
– Static Analysis
Buffer Overflow – Vulnerable Code
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char * argv[]){
char argument[42];
if (argc < 2){
printf("n[!!!] Please supply a program argument. [!!!]nn");
exit(0);
}
printf("n[*] Gimppy's BOF code examplen");
strcpy(argument, argv[1]);
printf("[*] You supplied '%s' as your argument!n", argument);
printf("[*] Program Completed. n");
return 0;
}
Buffer Overflow Countermeasures
• Developers
– Don’t use unsafe functions
– Perform bounds checking
– Compile/Link with overflow prevention techniques
• Canary/Stack Cookie
– gcc –fstack-protector
• ASLR
– gcc –fPIE || ld -pie
• DEP/NX
– gcc marks the stack non-executable by default
Buffalo TeraStation: Hacking Files
• Missing function-level
access control
• Susceptible to
command injection
• p0wned
YIKES! What Can We Do?
• Consumers
– Protect your security & privacy! Harden your
networked devices!
– Demand that vendors put more emphasis into
securing SOHO networking equipment.
• Vendors
– Consider and integrate security into your product
design
– Abide by the principal of least privilege
– Follow coding best practices
– Patch management
Q & A
Thanks for your time!
Paul Dant
Chief Strategist @ ISE
pdant@securityevaluators.com

More Related Content

PPTX
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
PDF
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
PDF
Ch 10: Attacking Back-End Components
PDF
RIoT (Raiding Internet of Things) by Jacob Holcomb
PPTX
Two-For-One Talk: Malware Analysis for Everyone
PDF
CNIT 124 Ch10-12: Local Exploits through Bypassing AV
PDF
Ch 10: Hacking Web Servers
PDF
Practical Malware Analysis Ch 14: Malware-Focused Network Signatures
Practical Malware Analysis: Ch 0: Malware Analysis Primer & 1: Basic Static T...
CNIT 126 Ch 0: Malware Analysis Primer & 1: Basic Static Techniques
Ch 10: Attacking Back-End Components
RIoT (Raiding Internet of Things) by Jacob Holcomb
Two-For-One Talk: Malware Analysis for Everyone
CNIT 124 Ch10-12: Local Exploits through Bypassing AV
Ch 10: Hacking Web Servers
Practical Malware Analysis Ch 14: Malware-Focused Network Signatures

What's hot (20)

PPTX
Winnti Polymorphism
PDF
openioc_scan - IOC scanner for memory forensics
PDF
CNIT 126: Ch 2 & 3
PDF
I Know You Want Me - Unplugging PlugX
PDF
Ch 4: Footprinting and Social Engineering
PDF
Ch 7: Programming for Security Professionals
PPTX
Introduction to Malware Analysis
PDF
CNIT 152 12 Investigating Windows Systems (Part 1 of 3)
PPTX
REMnux Tutorial-3: Investigation of Malicious PDF & Doc documents
PPTX
Anomalies Detection: Windows OS - Part 1
PPTX
Malware analysis
PDF
CNIT 127: 8: Windows overflows (Part 2)
PDF
CNIT 126: 10: Kernel Debugging with WinDbg
PDF
CNIT 152 13 Investigating Mac OS X Systems
PDF
Malicious File for Exploiting Forensic Software
PDF
Practical Malware Analysis: Ch 8: Debugging
PDF
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
PPT
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
PDF
avar2015_ddos_trojans_slides
PPTX
Remnux tutorial-1 Statically Analyse Portable Executable(PE) Files
Winnti Polymorphism
openioc_scan - IOC scanner for memory forensics
CNIT 126: Ch 2 & 3
I Know You Want Me - Unplugging PlugX
Ch 4: Footprinting and Social Engineering
Ch 7: Programming for Security Professionals
Introduction to Malware Analysis
CNIT 152 12 Investigating Windows Systems (Part 1 of 3)
REMnux Tutorial-3: Investigation of Malicious PDF & Doc documents
Anomalies Detection: Windows OS - Part 1
Malware analysis
CNIT 127: 8: Windows overflows (Part 2)
CNIT 126: 10: Kernel Debugging with WinDbg
CNIT 152 13 Investigating Mac OS X Systems
Malicious File for Exploiting Forensic Software
Practical Malware Analysis: Ch 8: Debugging
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
Practical Malware Analysis: Ch 7: Analyzing Malicious Windows Programs
avar2015_ddos_trojans_slides
Remnux tutorial-1 Statically Analyse Portable Executable(PE) Files
Ad

Viewers also liked (20)

PDF
The Harsh Reality of Slow Movers
PDF
What is being exposed from IoT Devices
PDF
PDF
Business Impact From IoT? Just Add Data Science
PDF
Senzations’15: Secure Internet of Things
PDF
frog IoT Big Design IoT World Congress 2015
PDF
IoT and BD Introduction
PDF
Introduction to Radial Basis Function Networks
PPTX
ON THE SECURITY AND PRIVACY OF INTERNET OF THINGS ARCHITECTURES
PPTX
Secure your Space: The Internet of Things
PDF
Patient Centric Cyber Monitoring with DocBox and Evolver
PPTX
Thought Leadership Webinar - Internet of things (IoT): The Next Cyber Securit...
PDF
Radial Basis Function
PDF
Smart, Secure and Efficient Data Sharing in IoT
PDF
IoT Protocol ( 22 Aug 2015 )
PDF
Digital Image Processing: Image Enhancement in the Frequency Domain
PDF
Neural Networks: Support Vector machines
PDF
Neural Networks: Rosenblatt's Perceptron
PDF
Csc446: Pattren Recognition (LN1)
PDF
CSC446: Pattern Recognition (LN6)
The Harsh Reality of Slow Movers
What is being exposed from IoT Devices
Business Impact From IoT? Just Add Data Science
Senzations’15: Secure Internet of Things
frog IoT Big Design IoT World Congress 2015
IoT and BD Introduction
Introduction to Radial Basis Function Networks
ON THE SECURITY AND PRIVACY OF INTERNET OF THINGS ARCHITECTURES
Secure your Space: The Internet of Things
Patient Centric Cyber Monitoring with DocBox and Evolver
Thought Leadership Webinar - Internet of things (IoT): The Next Cyber Securit...
Radial Basis Function
Smart, Secure and Efficient Data Sharing in IoT
IoT Protocol ( 22 Aug 2015 )
Digital Image Processing: Image Enhancement in the Frequency Domain
Neural Networks: Support Vector machines
Neural Networks: Rosenblatt's Perceptron
Csc446: Pattren Recognition (LN1)
CSC446: Pattern Recognition (LN6)
Ad

Similar to SOHOpelessly Broken (20)

PDF
Thick Application Penetration Testing: Crash Course
PDF
Thick Application Penetration Testing - A Crash Course
PDF
I got 99 trends and a # is all of them
PPTX
Thick client pentesting_the-hackers_meetup_version1.0pptx
PPTX
Burp Suite is a powerful and widely-used tool
PPT
Applciation footprinting, discovery and enumeration
PDF
Thick Client Penetration Testing.pdf
PDF
Realities of Security in the Cloud
PPTX
DC612 Day - Hands on Penetration Testing 101
PDF
Web App Security Presentation by Ryan Holland - 05-31-2017
PDF
technical-information-gathering-slides.pdf
PDF
Attack All the Layers: What's Working during Pentests (OWASP NYC)
PDF
Attack All the Layers - What's Working in Penetration Testing
PDF
Attack All The Layers - What's Working in Penetration Testing
PDF
Tracing Micro Services with OpenTracing
PDF
Security defined routing_cybergamut_v1_1
PDF
Lares from LOW to PWNED
PPTX
Altitude SF 2017: Security at the edge
PPTX
BSIDES-PR Keynote Hunting for Bad Guys
Thick Application Penetration Testing: Crash Course
Thick Application Penetration Testing - A Crash Course
I got 99 trends and a # is all of them
Thick client pentesting_the-hackers_meetup_version1.0pptx
Burp Suite is a powerful and widely-used tool
Applciation footprinting, discovery and enumeration
Thick Client Penetration Testing.pdf
Realities of Security in the Cloud
DC612 Day - Hands on Penetration Testing 101
Web App Security Presentation by Ryan Holland - 05-31-2017
technical-information-gathering-slides.pdf
Attack All the Layers: What's Working during Pentests (OWASP NYC)
Attack All the Layers - What's Working in Penetration Testing
Attack All The Layers - What's Working in Penetration Testing
Tracing Micro Services with OpenTracing
Security defined routing_cybergamut_v1_1
Lares from LOW to PWNED
Altitude SF 2017: Security at the edge
BSIDES-PR Keynote Hunting for Bad Guys

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Big Data Technologies - Introduction.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Cloud computing and distributed systems.
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Encapsulation_ Review paper, used for researhc scholars
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Machine learning based COVID-19 study performance prediction
PDF
KodekX | Application Modernization Development
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Big Data Technologies - Introduction.pptx
20250228 LYD VKU AI Blended-Learning.pptx
MYSQL Presentation for SQL database connectivity
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Cloud computing and distributed systems.
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Encapsulation theory and applications.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Encapsulation_ Review paper, used for researhc scholars
The AUB Centre for AI in Media Proposal.docx
Machine learning based COVID-19 study performance prediction
KodekX | Application Modernization Development
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Unlocking AI with Model Context Protocol (MCP)
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...

SOHOpelessly Broken

  • 1. S O H O p e l e s s l y B r o k e n A Hacker’s Perspective on Embedded Device Security
  • 2. Who Am I? ISE Confidential - not for distribution Paul Dant Chief Strategist @ ISE 9: First digital product 13: First legit black hat hack 17: First hacker caught 19: First legit white hat hack (p0wned a bank data processing center as part of a compliance audit)
  • 3. About ISE • We are: - Ethical Hackers - Computer Scientists • Our clients are: - Fortune 500 Enterprises - Entertainment, Security Software, Healthcare • Our perspective is: – Everything is broken! – White hat testing rules
  • 4. Why Should You Listen To Us? • 100% of network systems evaluated were vulnerable to exploitation. • Routers and storage systems are not the only embedded devices with egregious deficiencies. • These systems CAN and ARE being mass exploited.
  • 5. #SOHOpelessly Broken HACK ROUTERS AND GET PAID https://sohopelesslybroken.com DEFCON 23, DerbyCon v4.0, BSIDES DC, ToorCon We launched the first IoT Village @ DEFCON 23
  • 6. ISE Confidential | Not for Distribution ISE IoT Village DEF CON 23
  • 7. Agenda Embedded Device Security Risks Why Do We Care? Hacking Methodology Real World Examples What Can We Do? Summary and Q&A ISE Confidential | Not for Distribution
  • 8. Embedded Device Security Risks • Large attack surface • Default configurations are typically not secure at all • Assumption of security on the (wireless) LAN • Poor security design and implementation
  • 9. Why Do We Care? • Large attack surface • Insecure by default • Assumption of security on the (wireless) LAN • Poor (or missing!) security design and implementation
  • 10. Hacking Methodology • Information Gathering • Scanning and Enumeration • Gaining Access • Maintaining Access
  • 11. Information Gathering • Administration Settings – Default credentials – Management interface(s) • WLAN Settings – SSID and wireless encryption • Network Service Settings – DHCP, DNS, SNMP, UPnP, SMB, FTP, etc.
  • 12. Scanning and Enumeration • Identifying active hosts • Identifying open TCP/UDP ports • Identifying running services and versions
  • 13. Scanning and Enumeration Cont. Port Scan Banner Grab TCP: nmap –sS –Pn –sV –p T:1-65535 X.X.X.X UDP: nmap –sU –Pn –p U:1-65535 X.X.X.X Netcat: nc –nv <X.X.X.X> <port>
  • 14. Gaining Access • Service Investigation – Analyze web applications – Analyze servers (e.g., FTP, SMTP, SMB, HTTP) – Source Code Review (Static Code Analysis) – Fuzz Network Services (Dynamic Analysis)
  • 15. Analyzing Web Applications • Understand the application – Programming languages used • Server side (e.g., PHP, .NET, Python, ASP, Ruby on Rails) • Client side (e.g., JavaScript, HTML, JSON, Flash) – Protocols and APIs used (e.g., SOAP, REST) – Internet Media Type/MIME (e.g., JavaScript, HTML) • Toolz – Web proxy (i.e., Burpsuite) – Firebug (JavaScript debugger, HTML inspection) – Web Crawler
  • 16. Analyzing Web Applications Cont. Burpsuite Firebug
  • 17. Analyzing Network Servers • Authentication – Type (e.g., Password, Key Pair) – Anonymous access/Weak or no credentials – Misconfigurations (e.g., Directory listing, permissions) • Encryption – SSL/TLS? – SSH (AES, 3DES)?
  • 18. Static Code Analysis • If source code is available, GET IT! • Things to look for: – Logic flaws (e.g., authentication, authorization) – Functions not performing bounds-checking – Backdoors
  • 19. Fuzzing (Dynamic Analysis) • What happens if peculiar input is introduced? – A{-G42!BBB}}}}}}///}}}}}}+=-_-1234d`~~((.)_(.))$ – AAAAAAAAAAAAAAAAAAAAAAAAAA • Fuzzers – SPIKE: generic_send_tcp X.X.X.X 21 ftp.spk 0 0 – BED: ./bed.pl -s HTTP -t X.X.X.X -p 80 – Metasploit Framework – Python!
  • 22. Analyze Fuzzing Results • Toolz – Debugger (i.e., GDB) – System Call Tracer (i.e., strace) *Debugging ASUS RT-AC66U exploit
  • 23. Gaining Access • Reverse Engineering – System Binaries • Simple RE Toolz and Techniques – Strings – Hexdump – Grep – Open source? Perform static analysis! • Exploit Development
  • 24. Reverse Engineering Toolz and Techniques • Strings: strings –n <INT> <FILE> *TP-Link TL-1043ND Firmware
  • 25. Reverse Engineering Toolz and Techniques • Grep: grep –R <string> * *Code from the TRENDnet TEW-812DRU
  • 26. Exploit Development • Cross-Site Request Forgery • Command Injection • Missing Function Level Access Control – Authentication Bypass – Authorization Bypass • Directory Traversal • Buffer Overflow
  • 27. Cross-Site Request Forgery #define: CSRF is an attack that forces an unsuspecting victim into executing web commands that perform unwanted actions on a web application. Gimppy (Attacker) Jad (Victim) Web Application Attacker Web Server
  • 28. Testing for Cross-Site Request Forgery • Anti-CSRF Tokens? • HTTP referrer checking?
  • 29. Cross-Site Request Forgery Countermeasures • Users – Logout of web applications – Do NOT save credentials in your browser • Developers – Implement Anti-CSRF tokens AND HTTP referrer checking – Feeling ambitious? Require the user to authenticate before performing a state change
  • 30. Command Injection #define: Command Injection is a form of attack where operating system specific commands are injected into a vulnerable application for execution.
  • 31. Testing for Command Injection • Survey the application – Look for application features that could call underlying system functionality(e.g., ping, traceroute) – Source code? Static analysis! • Test Examples – ifconfig ; cat /etc/passwd  Linux – dir | ipconfig  Windows/Linux – ls /var/www/`<cmd>` or $(<cmd>)  Linux**Command substitution
  • 32. Command Injection – Vulnerable Code <?php $dig=shell_exec("dig {$_GET['Domain']}"); echo($dig); ?>
  • 33. Command Injection Countermeasures • Developers – Avoid calling shell commands when possible – If an API does not exist, sanitize user input before passing it to a function that executes system commands. • Python Example – BAD: os.system(‘ls ‘ + dir) – GOOD: os.listdir(dir)
  • 34. Missing Function Level Access Control #define: The absence of server-side authentication and authorization checks.
  • 35. Testing for Missing Function Level Access Control • Calling privileged API’s as an unprivileged user. • Accessing system resources that do not belong to the attacker. – Insecure Direct Object Reference – Direct Request/Forced Browsing
  • 36. Missing Function Level Access Controls Countermeasures • Developers – Perform server-side authentication and authorization checks.
  • 37. Directory Traversal #define: Directory Traversal is a form of attack where an attacker can access files and directories outside of the intended directory.
  • 38. Testing for Directory Traversal • Enumerate the application – Are there commands or request parameters that could be used for file-related operations? • URL Encoding (Web only) – %2f  / – %2e%2e%2f  ../ • Test Examples – http://infosec2.blogspot.com/DT.php?file=../../../../etc/passwd%00 – http://JadWebApp.com/DT.php?dir=..%2f..%2fetc%2fpasswd – symlink / rootfs  SMB
  • 39. Directory Traversal– Vulnerable Code <?php if ($_GET['file']) $file = $_GET['file']; include('/var/www/'.$file); ?>
  • 40. Directory Traversal Countermeasures • Developers – Try not to use user input in file system calls – Perform path canonicalization (symlinks, . & .. are resolved) – Properly configure services
  • 41. Buffer Overflow #define: Buffer Overflows occur when a program attempts to write data that exceeds the capacity of a fixed length buffer, and consequently, overwrites adjacent memory. Stack Based Buffer Overflow (x86)
  • 42. Testing for Buffer Overflows • Testing for overflows – Dynamic Analysis – Static Analysis
  • 43. Buffer Overflow – Vulnerable Code #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char * argv[]){ char argument[42]; if (argc < 2){ printf("n[!!!] Please supply a program argument. [!!!]nn"); exit(0); } printf("n[*] Gimppy's BOF code examplen"); strcpy(argument, argv[1]); printf("[*] You supplied '%s' as your argument!n", argument); printf("[*] Program Completed. n"); return 0; }
  • 44. Buffer Overflow Countermeasures • Developers – Don’t use unsafe functions – Perform bounds checking – Compile/Link with overflow prevention techniques • Canary/Stack Cookie – gcc –fstack-protector • ASLR – gcc –fPIE || ld -pie • DEP/NX – gcc marks the stack non-executable by default
  • 45. Buffalo TeraStation: Hacking Files • Missing function-level access control • Susceptible to command injection • p0wned
  • 46. YIKES! What Can We Do? • Consumers – Protect your security & privacy! Harden your networked devices! – Demand that vendors put more emphasis into securing SOHO networking equipment. • Vendors – Consider and integrate security into your product design – Abide by the principal of least privilege – Follow coding best practices – Patch management
  • 47. Q & A Thanks for your time! Paul Dant Chief Strategist @ ISE pdant@securityevaluators.com