SlideShare a Scribd company logo
Defcon Moscow #0x0A - Mikhail Firstov "Hacking routers as Web Hacker"
Hacking routers
as
Web Hacker
WHOAMI
• Researcher @ hlsec.ru
• @cyberpunkych
• Attacking MongoDB @ ZN2012
• Database honeypot by design @ Defcon Russia
• Meme Master
Routers everywhere.
• Home
• Work
• Hospitals
• Banks
• In your bag
• etc
But I’m web hacker, what can I do?
• Router’s web control panel == web site
• Connect managers with web interface, such as Yota Access
• ISP (statistics, billing, management, etc)
Routerzzz
OWASP TOP 10 for routers
• Default credentials
• Auth bypass
• XSS
• CSRF
• Command Injection
• Sensitive info leak
• Bugs in third party libraries
• RCE, XXE, etc
Default credentials
Should I say anything?
Authentication Bypass/No Auth
• Hello, Yota Many
• Hello, D-Link’s backdoor
• Hello, MTS 4G Router
• Hello, others
(DIR-100, DI-524, DI-604, etc)
CSRF/XSS everywhere
Srlsy, it’s everywhere. But why?
Because **** you, that’s why.
(Zyxel Keenetic v1)
Command injection
Always check network tools
(ASUS RT-N10P)
Sensitive info leak
• /error_page.htm
• /DevInfo.php
• /rom-0
(ASUS RT-N12D1)
Bugs in third party libraries
• Heartbleed
• ShellShock
• RomPager
• etc
Hacking algorithm
WARNINNG!
ВАС ПРИСТРЕЛЯТ ПО УТРУ – НЕ РАБОТАЙТЕ ПО РУ!
1. Get the firmware
• Сheck vendor web site/ftp
• Get firmware source code (GPL profits)
• No firmware at all? Dump it via UART/SPI/JTAG (HW mode on)
2. Unpack it
• Binwalk -> search for signature and try to unpack
• Firmware-mod-kit pack/unpack
• If NO_SUCCESS -> analyze firmware entropy
• Sasquatch for squashfs, other fs -> google for tools
3. CHECK AUTH
• Black Box => White Box
• for i in *; do curl http://router_ip/$i; done
• You know what to do ;)
4. СHECK CMD INJECTION
• PING -> ya.ru;ls
• CONFIG backup to FTP/TFTP
• Any place where command execution is used
• Check all shell symbols
• Error-based command injection for output
# ping ya.ru || ls
# ping $(uname)
# ping `uname`
# ping ya.ru && ls
# ping ya.ru; ls
# ping $USER.ya.ru
...
5. Check for XSS
• <script>alert(1)</script> for every param!
• Check hostname, sometimes it can help you
• Even 1 XSS => PROFIT!!1
• Stored XSS => Compromised web interface
5. Check for XSS
• <script>alert(1)</script> for every param!
• Check hostname, sometimes it can help you
• Even 1 XSS => PROFIT!!1
• Stored XSS => Compromised web interface
Typical attack scheme:
Link/Page with XSS => AJAX => getElementsByTagName(‘input’)[*].value => log data
Hide myself from web aka rookit hostname
Hello, 1'}]"); !
Hide’n’seek from browser via xss in Zyxel Keenetic.
6. Check for CSRF
• Inspect for anti-csrf tokens
• Check X-Requested-With
• Referer check
6. Check for CSRF
• Inspect for anti-csrf tokens
• Check X-Requested-With
• Referer check
Referer checking:
6. Check for CSRF
• Inspect for anti-csrf tokens
• Check X-Requested-With
• Referer check
Any other == bad referer:
6. Check for CSRF
• Inspect for anti-csrf tokens
• Check X-Requested-With
• Referer check
Open Redirect trick to bypass regexp:
CSRF => MITM
All you need is love CSRF via updating DNS settings!
( <img src=“csrf”>, habrahabr, you know. )
XSS + Smart CSRF
1. Get the internal IP address using a nice WebRTC hack
2. Get router IP (no so many requests 8) )
3. Make CSRF Request via XSS payload (better for stored XSS)
4. Get all data (sometimes passwords stored in input.value’s)
5. Redirect to page with XSS
6. ???
7. All your data are belong to us!
Support Software
Support Software
• %operator_name% Connect (Huawei modems), Yota Access, etc
• Sometimes they also use web inside apps!
• Binary bugs (BOF, etc)
• Bugs with bad privileges
• Sniff requests to ISP => new bugs
Support Software
From CSRF to RCE!
video_here
ISP
ISP – Just another target
• Google/Yandex dork
• Cabinet/Balance/etc on provider’s site
• Subdomains
• Popular services
Why it is important?
• Update server control
• Client-side tricks (crossdomain.xml)
• Remote device administration
• New default credentials
• Attack firmware developers
Google it!
Just google.
WARNINNG! WARNINNG! WARNINNG!
Example from real life
Conclusion
• Router == web site
• Black Box => White Box
• XSS/CSRF everywhere
• Vuln1+vuln2->vuln3
• The RCE is out there
• R.E.S.H.E.T.O.
Any questions?
INFO:
@cyberpunkych
Links:
http://www.routerpwn.com
http://routersecurity.org
http://seclists.org
http://dsec.ru/upload/medialibrary/589/589327eb24
133e5c615fa11950340e05.pdf
http://goo.gl/0P2rgl
https://github.com/devttys0/sasquatch
https://github.com/0x90/kali-
scripts/blob/master/embedded.sh
https://goo.gl/x3XjLU
Thnx:
@090h
@n3tw0rk_

More Related Content

PPTX
Иван Новиков «Elastic search»
PPTX
Олег Купреев «Уязвимости программного обеспечения телекоммуникационного обору...
PPTX
Defcon Moscow #0x0A - Oleg Kupreev "Uncommon MiTM in uncommon conditions"
PDF
Stealth post-exploitation with phpsploit
PPTX
如何利用 Docker 強化網站安全
PDF
Talk NullByteCon 2015
PPTX
Буткит через СМС: оценка безопасности сети 4G
PPT
Denis Baranov: Root via XSS
Иван Новиков «Elastic search»
Олег Купреев «Уязвимости программного обеспечения телекоммуникационного обору...
Defcon Moscow #0x0A - Oleg Kupreev "Uncommon MiTM in uncommon conditions"
Stealth post-exploitation with phpsploit
如何利用 Docker 強化網站安全
Talk NullByteCon 2015
Буткит через СМС: оценка безопасности сети 4G
Denis Baranov: Root via XSS

What's hot (20)

PDF
Is rust language really safe?
PDF
ODP
Securing the network for VMs or Containers
PDF
44CON London 2015 - Is there an EFI monster inside your apple?
PPTX
Security Onion Conference - 2016
PDF
Aide 2014 - Fundamentals of Linux Privilege Escalation
PDF
How to Connect MQTT Broker on ESP8266 WiFi
PPTX
Security in PHP - 那些在滲透測試的小技巧
PDF
Null bhopal Sep 2016: What it Takes to Secure a Web Application
PPTX
EKFiddle: a framework to study Exploit Kits
PDF
[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensions
PDF
Kali tools list with short description
PDF
Linux advanced privilege escalation
PPTX
Telehack: May the Command Line Live Forever
PPTX
Metasploit for Web Workshop
PDF
From P0W3R to SH3LL
PDF
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root
PDF
44CON 2014 - Breaking AV Software
PDF
2015.10.05 Updated > Network Device Development - Part 2: Firewall 101
PDF
Is Rust Programming ready for embedded development?
Is rust language really safe?
Securing the network for VMs or Containers
44CON London 2015 - Is there an EFI monster inside your apple?
Security Onion Conference - 2016
Aide 2014 - Fundamentals of Linux Privilege Escalation
How to Connect MQTT Broker on ESP8266 WiFi
Security in PHP - 那些在滲透測試的小技巧
Null bhopal Sep 2016: What it Takes to Secure a Web Application
EKFiddle: a framework to study Exploit Kits
[ENG] Hacker halted 2012 - Zombie browsers, spiced with rootkit extensions
Kali tools list with short description
Linux advanced privilege escalation
Telehack: May the Command Line Live Forever
Metasploit for Web Workshop
From P0W3R to SH3LL
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root
44CON 2014 - Breaking AV Software
2015.10.05 Updated > Network Device Development - Part 2: Firewall 101
Is Rust Programming ready for embedded development?

Similar to Defcon Moscow #0x0A - Mikhail Firstov "Hacking routers as Web Hacker" (20)

PPTX
Hacking routers as Web Hacker
PDF
Embedded systems
PPTX
CONFidence 2015: The Top 10 Web Hacks of 2014 - Matt Johansen, Johnathan Kuskos
PPTX
Owasp web application security trends
PPTX
[2.1] Web application Security Trends - Omar Ganiev
KEY
DVWA BruCON Workshop
PDF
Burp suite
PDF
HTTP For the Good or the Bad - FSEC Edition
PPTX
Soho routers: swords and shields CyberCamp 2015
PDF
They Ought to Know Better: Exploiting Security Gateways via Their Web Interfaces
PDF
Cracking into embedded devices and beyond
PDF
DrupalCamp London 2017 - Web site insecurity
PDF
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
PDF
DEFCON 23 - Jason Haddix - how do i shot web
PPTX
Hacking WebApps for fun and profit : how to approach a target?
PPTX
Top 10 Web Hacks 2012
PPTX
Top Ten Web Hacking Techniques of 2012
PDF
Web Security - Introduction v.1.3
PDF
Web Security - Introduction
PDF
2010: A Web Hacking Odyssey - Top Ten Hacks of the Year
Hacking routers as Web Hacker
Embedded systems
CONFidence 2015: The Top 10 Web Hacks of 2014 - Matt Johansen, Johnathan Kuskos
Owasp web application security trends
[2.1] Web application Security Trends - Omar Ganiev
DVWA BruCON Workshop
Burp suite
HTTP For the Good or the Bad - FSEC Edition
Soho routers: swords and shields CyberCamp 2015
They Ought to Know Better: Exploiting Security Gateways via Their Web Interfaces
Cracking into embedded devices and beyond
DrupalCamp London 2017 - Web site insecurity
How to Shot Web - Jason Haddix at DEFCON 23 - See it Live: Details in Descrip...
DEFCON 23 - Jason Haddix - how do i shot web
Hacking WebApps for fun and profit : how to approach a target?
Top 10 Web Hacks 2012
Top Ten Web Hacking Techniques of 2012
Web Security - Introduction v.1.3
Web Security - Introduction
2010: A Web Hacking Odyssey - Top Ten Hacks of the Year

More from Defcon Moscow (12)

PDF
Defcon Moscow #0x0A - Dmitry Nedospasov "WTFPGA?!"
PPTX
Defcon Moscow #0x0A - Nikita Kislitsin APT "Advanced Persistent Threats"
PDF
Defcon Moscow #0x0A - Sergey Golovanov "Вредоносные программы для финансовых ...
PPT
Defcon Moscow #0x0A - Dmitry Evteev "Pentest vs. APT"
PPTX
Defcon Moscow #9 - Oleg Kupreev "Telecommunication Hardware Vulnerabilities"
PDF
Defcon Moscow #9 - Mikhail Elizarov "MITM"
PPTX
Defcon Moscow #9 - Timur Yunusov "Особенности проведения социотехнического те...
PPTX
Defcon Moscow #9 - Ivan Novikov "ElasticSearch is secure?"
PDF
Defcon Moscow #9 - Sergey Vishnyakov
PPT
Denis Makrushin & Maria Garnaeva - DeanonymizaTOR
PPT
Goltsev Yuriy - Ломать - не строить!
PPT
Oleg Kupreev - 802.11 tricks and threats
Defcon Moscow #0x0A - Dmitry Nedospasov "WTFPGA?!"
Defcon Moscow #0x0A - Nikita Kislitsin APT "Advanced Persistent Threats"
Defcon Moscow #0x0A - Sergey Golovanov "Вредоносные программы для финансовых ...
Defcon Moscow #0x0A - Dmitry Evteev "Pentest vs. APT"
Defcon Moscow #9 - Oleg Kupreev "Telecommunication Hardware Vulnerabilities"
Defcon Moscow #9 - Mikhail Elizarov "MITM"
Defcon Moscow #9 - Timur Yunusov "Особенности проведения социотехнического те...
Defcon Moscow #9 - Ivan Novikov "ElasticSearch is secure?"
Defcon Moscow #9 - Sergey Vishnyakov
Denis Makrushin & Maria Garnaeva - DeanonymizaTOR
Goltsev Yuriy - Ломать - не строить!
Oleg Kupreev - 802.11 tricks and threats

Recently uploaded (20)

PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
KodekX | Application Modernization Development
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Approach and Philosophy of On baking technology
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Unlocking AI with Model Context Protocol (MCP)
Chapter 3 Spatial Domain Image Processing.pdf
MYSQL Presentation for SQL database connectivity
KodekX | Application Modernization Development
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Spectroscopy.pptx food analysis technology
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Building Integrated photovoltaic BIPV_UPV.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Network Security Unit 5.pdf for BCA BBA.
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Big Data Technologies - Introduction.pptx
Approach and Philosophy of On baking technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Per capita expenditure prediction using model stacking based on satellite ima...
The Rise and Fall of 3GPP – Time for a Sabbatical?
The AUB Centre for AI in Media Proposal.docx
Programs and apps: productivity, graphics, security and other tools
20250228 LYD VKU AI Blended-Learning.pptx

Defcon Moscow #0x0A - Mikhail Firstov "Hacking routers as Web Hacker"