SlideShare a Scribd company logo
HOW *NOT* TO
FIRMWARE
The tale of the vulnerable night hawk, By Amit Serper
$WHOAMI
• Principal security researcher @ Cybereason
• I LOVE EMBEDDED HACKING (used to make my living off of it)
• I was here ~3 months ago talking about command injections
• I am going to do that again right now
@0xAmit
Background
How *NOT* to firmware
HTTP REQUESTS – QUICK REMINDER
How *NOT* to firmware
COMMAND INJECTIONS– QUICK
REMINDER
LETS GET BACK TO IT…
YOU KNOW WHAT THAT MEANS…
Someone passes a user
controlled string to system()
YOU KNOW WHAT THAT MEANS…
That user controlled string
Is in the friggin URL
YOU KNOW WHAT THAT MEANS…
It is actually in the HTTP
Request itself
YOU KNOW WHAT THAT MEANS…
The server just accepts
And executes the
Command => no auth
SO WAIT A MINUTE…
If a user control string which is the HTTP
request itself gets passed as an argument to
system(), does this mean what I…? Oh shit.
THAT MEANS… EVERYONE GETS
CODE EXECUTION AS ROOT!
QUESTIONS…
• Where exactly in the code is the mistake and does it
look like what I think it looks like
• Are they actually calling system?
• Why?! What for and how many times…
IDA PRO TIME…
How *NOT* to firmware
How *NOT* to firmware
How *NOT* to firmware
How *NOT* to firmware
SO WHAT’S GOING ON?
• The webserver implements a bunch of server side functionality using ’cgi-bin’
• Cgi-bin is a generic name for scripts that are being processed on the server side
using input from the client side
•That is a terrible idea. The 90s are
over. WTF.
How *NOT* to firmware
How *NOT* to firmware
SO WHAT’S ACTUALLY GOING ON
HERE?
• The webserver implements a bunch of server side functionality using ’cgi-bin’
• Cgi-bin is a generic name for scripts that are being processed on the server side
using input from the client side
• All of those scripts are in the /cgi-bin/ directory
• One of those things is to LOG the parameters in the HTTP requests to a file.
• The logging is done by doing something roughly like this:
• system(“echo %s >/tmp/options_result”, USER_INPUT);
• Since any request to cgi-bin/ is being handled that way… That means…
THAT MEANS… EVERYONE GETS
CODE EXECUTION AS ROOT!
AS EASY AS
http://<ip>/cgi-bin/;command
How *NOT* to firmware

More Related Content

PPTX
The internet of $h1t
PDF
Defcon Moscow #0x0A - Mikhail Firstov "Hacking routers as Web Hacker"
PPTX
Иван Новиков «Elastic search»
ODP
From Test to Live with Rex
PDF
Git+jenkins+rex presentation
PDF
Deep drive into rust programming language
PDF
The BlackBox Project: Safely store secrets in Git/Mercurial (originally for P...
KEY
Sentry (SF Python, Feb)
The internet of $h1t
Defcon Moscow #0x0A - Mikhail Firstov "Hacking routers as Web Hacker"
Иван Новиков «Elastic search»
From Test to Live with Rex
Git+jenkins+rex presentation
Deep drive into rust programming language
The BlackBox Project: Safely store secrets in Git/Mercurial (originally for P...
Sentry (SF Python, Feb)

What's hot (20)

PDF
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
PDF
Composer Tutorial (PHP Hampshire Sept 2013)
PDF
Deployment tales
PDF
Deployment tales
PDF
What's new in Symfony3
PDF
Dive into sentry
PPTX
Programming The Arduino Due in Rust
PPT
Rust Programming Language
PDF
Sinatra: прошлое, будущее и настоящее
PPTX
DefCamp 2013 - MSF Into The Worm Hole
PPT
Loading JavaScript: Even a caveman can do it
ODP
Linuxday.at - Lightning Talk
PDF
Automate Yo'self -- SeaGL
PDF
How to use miniedit
PPT
Python for pentesters
PDF
Master-Master Replication and Scaling of an Application Between Each of the I...
PPT
Resumable File Upload API using GridFS and TUS
PDF
How to Shrink from 5 Tiers to 2 in a Multitier Microservices Architecture
ODP
Lighning Talk: composer repositories
PPTX
Infrastructure development on windows ldn cd meetup
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Composer Tutorial (PHP Hampshire Sept 2013)
Deployment tales
Deployment tales
What's new in Symfony3
Dive into sentry
Programming The Arduino Due in Rust
Rust Programming Language
Sinatra: прошлое, будущее и настоящее
DefCamp 2013 - MSF Into The Worm Hole
Loading JavaScript: Even a caveman can do it
Linuxday.at - Lightning Talk
Automate Yo'self -- SeaGL
How to use miniedit
Python for pentesters
Master-Master Replication and Scaling of an Application Between Each of the I...
Resumable File Upload API using GridFS and TUS
How to Shrink from 5 Tiers to 2 in a Multitier Microservices Architecture
Lighning Talk: composer repositories
Infrastructure development on windows ldn cd meetup
Ad

Similar to How *NOT* to firmware (20)

PDF
Hacking sites for fun and profit
PDF
BlueHat v18 || The matrix has you - protecting linux using deception
PDF
Hacking sites for fun and profit
PDF
Brute Force - Lior Rotkovitch - f5 SIRT v5.pdf
PPTX
BSIDES-PR Keynote Hunting for Bad Guys
PPTX
Mitigating CSRF with two lines of codes
PDF
H4CK1N6 - Web Application Security
PDF
Secure all things with CBSecurity 3
PDF
BSides Lisbon 2013 - All your sites belong to Burp
PPTX
WAF ASM / Advance WAF - Brute force lior rotkovitch f5 sirt v5 clean
PPTX
Hacking routers as Web Hacker
PDF
Security in php
PDF
Workshop on Network Security
PDF
PDF
Building real time applications with Symfony2
PDF
Hacking routers as Web Hacker
PPTX
Redesigning Password Authentication for the Modern Web
PPTX
Unit 3_detailed_automotiving_mobiles.pptx
PDF
Breaking Smart Speakers: We are Listening to You.
PDF
Ruby on Rails Security Guide
Hacking sites for fun and profit
BlueHat v18 || The matrix has you - protecting linux using deception
Hacking sites for fun and profit
Brute Force - Lior Rotkovitch - f5 SIRT v5.pdf
BSIDES-PR Keynote Hunting for Bad Guys
Mitigating CSRF with two lines of codes
H4CK1N6 - Web Application Security
Secure all things with CBSecurity 3
BSides Lisbon 2013 - All your sites belong to Burp
WAF ASM / Advance WAF - Brute force lior rotkovitch f5 sirt v5 clean
Hacking routers as Web Hacker
Security in php
Workshop on Network Security
Building real time applications with Symfony2
Hacking routers as Web Hacker
Redesigning Password Authentication for the Modern Web
Unit 3_detailed_automotiving_mobiles.pptx
Breaking Smart Speakers: We are Listening to You.
Ruby on Rails Security Guide
Ad

Recently uploaded (20)

PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Digital Strategies for Manufacturing Companies
PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
medical staffing services at VALiNTRY
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Digital Systems & Binary Numbers (comprehensive )
PPTX
Transform Your Business with a Software ERP System
PPT
Introduction Database Management System for Course Database
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
L1 - Introduction to python Backend.pptx
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Wondershare Filmora 15 Crack With Activation Key [2025
PTS Company Brochure 2025 (1).pdf.......
Operating system designcfffgfgggggggvggggggggg
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Digital Strategies for Manufacturing Companies
Computer Software and OS of computer science of grade 11.pptx
medical staffing services at VALiNTRY
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Navsoft: AI-Powered Business Solutions & Custom Software Development
Reimagine Home Health with the Power of Agentic AI​
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Upgrade and Innovation Strategies for SAP ERP Customers
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Digital Systems & Binary Numbers (comprehensive )
Transform Your Business with a Software ERP System
Introduction Database Management System for Course Database
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
L1 - Introduction to python Backend.pptx
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...

How *NOT* to firmware

  • 1. HOW *NOT* TO FIRMWARE The tale of the vulnerable night hawk, By Amit Serper
  • 2. $WHOAMI • Principal security researcher @ Cybereason • I LOVE EMBEDDED HACKING (used to make my living off of it) • I was here ~3 months ago talking about command injections • I am going to do that again right now @0xAmit
  • 5. HTTP REQUESTS – QUICK REMINDER
  • 8. LETS GET BACK TO IT…
  • 9. YOU KNOW WHAT THAT MEANS… Someone passes a user controlled string to system()
  • 10. YOU KNOW WHAT THAT MEANS… That user controlled string Is in the friggin URL
  • 11. YOU KNOW WHAT THAT MEANS… It is actually in the HTTP Request itself
  • 12. YOU KNOW WHAT THAT MEANS… The server just accepts And executes the Command => no auth
  • 13. SO WAIT A MINUTE… If a user control string which is the HTTP request itself gets passed as an argument to system(), does this mean what I…? Oh shit.
  • 14. THAT MEANS… EVERYONE GETS CODE EXECUTION AS ROOT!
  • 15. QUESTIONS… • Where exactly in the code is the mistake and does it look like what I think it looks like • Are they actually calling system? • Why?! What for and how many times…
  • 21. SO WHAT’S GOING ON? • The webserver implements a bunch of server side functionality using ’cgi-bin’ • Cgi-bin is a generic name for scripts that are being processed on the server side using input from the client side •That is a terrible idea. The 90s are over. WTF.
  • 24. SO WHAT’S ACTUALLY GOING ON HERE? • The webserver implements a bunch of server side functionality using ’cgi-bin’ • Cgi-bin is a generic name for scripts that are being processed on the server side using input from the client side • All of those scripts are in the /cgi-bin/ directory • One of those things is to LOG the parameters in the HTTP requests to a file. • The logging is done by doing something roughly like this: • system(“echo %s >/tmp/options_result”, USER_INPUT); • Since any request to cgi-bin/ is being handled that way… That means…
  • 25. THAT MEANS… EVERYONE GETS CODE EXECUTION AS ROOT!