BSides Hannover 2015 - Shell on Wheels

I
Shell on Wheels:
Darren Martyn
Xiphos Research
darren.martyn@xiphosresearch.co.uk
Exploitation of endpoint wireless devices for mostly fun and
possibly profit
whoami
• Darren Martyn / @infodox (twitter)
• Penetration Tester & Researcher @ Xiphos Research Ltd
• Forensics & Chemistry Student @ GMIT
whoami: alternatively
• An “unethical immoral twit” – Graham Cluley
• “A bad influence” - Anon
what?
• Today we will look at owning those “free WiFi” access points
on just about every bus ever.
• Sorry guys. Not Charlie Miller style bus owning here. Nothing
explodes/catches fire/crashes.
• Still, will make bus rides a lot more fun!
who?
who?
what do they have in common?
what do they have in common?
The magic box of Wi-Fi!
Let’s explore the magic box!
• i486 Embedded Processor (so, x86)
• One or more (usually two) data cards for cell connectivity
• WiFi, Ethernet, GPS, serial
• Unfortunately, I was unable to acquire my own magic box
But firmware is good too!
• Via googling, came across a random FTP server containing 108
firmware images for these devices (courtesy of an engineer)
• Judicious application of wget. (anonymous login FTW)
• Now we have firmware images
Because of scale we scripted binwalk…
Next up, scripting uncramfs…
Trigger Warning: Filthy Code Ahead
find . –name “vuln”
• Took a fairly blind approach to finding vulns
• “Grep and gripe” kind of things
• First off, looked at the web interface of device
Anyone see why this prompted interest?
Scripting is Magic…
Scripting is Magic…
Some numbers
• All 108 were vulnerable to ShellShock
• All 108 had the same shitty CGI script
• 106 used thttpd rooting as root
• 2 ran lighttpd. Also as root
Fingerprinting Web Server
Remote Root Everywhere
Going beyond Rootshells
• So we can execute code as root
• Leverage this to bypass auth and get at the web interface?
• Dump settings from the device?
• Persistent (firmware) rootkits?
Bypassing Auth
• Uses .htpasswd for auth
• Wrote a simple script to enable/disable auth
• Simply mv the .htpasswd to disable, mv back to re-enable
Bypassing Auth
Dumping Settings
• With Auth bypassed, we can wget “moovbox.settings” from
the device
• Sqlite3 database, contains passwords and such
• The Sqlite database was a mess, so I wrote a parser to dump
the goods from it
Settings Parser
Remote Settings Grabber
• Just for shits and giggles, I wrote an auto settings downloader
• Disable auth on device
• Dump database from device (save as md5sum of file)
• Re-enable auth on device
Remote Settings Grabber
Further firmware analysis
• Lets look for more fun stuff in this firmware
• First off, we analyse the passwd files
• 4 unique hashes
The Hashes
• I have yet to crack these. People have been trying and failing
for about a month. Can you succeed?
root:$1$5jjAfVIS$dIG6AvGNwq8EENjTHnfpK/
root:$1$jb.3W.1D$8FeBW.T/x2wwJVB.lp.gv1
root:$1$bw7WuzHj$aU6V7omf9zBWA2sEaJv9p1
root:$6$W74jOIhT$QaYoDDN.N1SRgyG5ALymJHcYc9TmXKcITXyCstG
DdK9cXOssLOTMQPl2uRm.wsNZ7oE5byOOrdNlvNxyguqVs/
SSH Keys
• Protip: Hardcoded SSH Keys Suck
• They all have /etc/ssh/ keys. RSA and DSA
• They also have the same /etc/ssh_key privkey, which is a bit
unusual...
/etc/ssh_key
• Now, this is an odd one. It matches exactly two boxes in the
wild – both hosts in Germany
• As to wtf these are, I have no idea
• If anyone can figure it out, it would be great ;)
• 89.110.151.186 & 89.110.148.26 (who is this?)
Using SSH keys to fingerprint
Look! Duplicate Keys! Everywhere!
Let’s go after SSL keys…
• OpenVPN Keys: find . -name "*.key" (108)
> 2e465be3c06ea7db968347aaa3df7d37
> All identical
• SSL Keys: find . -name "*.pem" (973)
> Also the same…
SSL Keys
• 6 of them on each image. All identical across images:
> 7135ad5b7fd5fb2eb23f8dfecf74919d
> cb5199178e4649461928356c7cbdae74
> de2c6949bd1bca55c20d9610510a08d1
> 905a7590ee039a788a08d4dfd15d2582
> a926c2beaa439f37bc62a5678a4e5906
> 35a569e0e768495554c4cbddd787f9e4
God damn it – all the same?!?!
• These are also good for remote fingerprinting
• And probably traffic interception...
• “You guys are bad at this!” is the only apt response to the
vendor
Owning the Client
• Interestingly, these devices do intercept HTTP(s) traffic
• This is for site blocking and to inject banner ads
• Seems to use Privoxy and some scripts to do this
(More) Owning the Client
• Devices all have this wonderful traffic interception suite
• Modify existing JS injector to inject BeEF, perhaps?
• Not tested for obvious reasons, but doable 
(Yet More) Owning the Client
• These devices have libpcap installed
• Dropping a working packet sniffer is easy
• Sniff cleartext credentials over the wire... All their traffic is
going through you!
Remember I said SSL interception?
• Some of these devices observed in the wild tamper with HTTPS
traffic
• Self signed keys observed with SSL'd sites, etc.
• Seemingly generated from the keys stored on device
• Use your imagination 
LOLSSL
So what about rootkits?
• This is where it gets really fun. And fairly untested
• While attempting to repack firmware, I noticed there were two
variants of image in there
• Variant 1 was just a raw CRAMFS image
• Variant 2 was [header][CRAMFS image]
Challenges
• So the raw CRAMFS one, we can just repack and upload
• The other one... I had to try make sense of the header
• This is untested on a live device, so don't try this unless you are
willing to break stuff
Header Structure
Creating ‘doored firmware
• Add backdoors to extracted CramFS filesystem
• Repackage CramFS filesystem
• If needed, append the weird header so that CramFS magic
starts at offset 0x64
How do install our firmware?
Suggested Payloads for Modified Firmware
• Script Injector as mentioned previously using already existing
code on the device!
• Traffic sniffer ala LinuxFlasher.A rootkit 
• Remote shell/file xfer – “tshd” or similar with a hourly callback
to C2?
Some Conclusions
• These devices have no security
• If you use free WiFi on public transport, expect to be owned.
(well, thats to be expected?)
• If you are a vendor of such devices, start taking security bloody
seriously
Afterthoughts: Concerning Disclosure
• Tried emailing icomera, did not receive response
• Made repeated attempts with no success, however, normally
when I try alert vendors about stuff they get annoying and
irritable
Afterthoughts: Concerning Patching
• Icomera claim on their blog to have patched the ShellShock
exploit
• However, as its up to end users to patch their boxen (no auto
updater), this is kinda useless
• All the devices I see ITW are vulnerable still
• Raises concerns over Internet of Junk and updates
Thanks
• f1nux and the BsidesHN crew for making this event happen <3
• Co-workers for letting me off to do science and supporting it
• Various friends (you know who you are) for helping out
• Icomera, for making such a wonderful product I have
something to talk about 
Contact
Email: darren.martyn@xiphosresearch.com
Web: www.xiphosresearch.com
Twitter: @info_dox
1 of 51

Recommended

Fantastic Red Team Attacks and How to Find Them by
Fantastic Red Team Attacks and How to Find ThemFantastic Red Team Attacks and How to Find Them
Fantastic Red Team Attacks and How to Find ThemRoss Wolf
898 views88 slides
Scaling Solr with Solr Cloud by
Scaling Solr with Solr CloudScaling Solr with Solr Cloud
Scaling Solr with Solr CloudSematext Group, Inc.
21.9K views57 slides
A Case Study in Attacking KeePass by
A Case Study in Attacking KeePassA Case Study in Attacking KeePass
A Case Study in Attacking KeePassWill Schroeder
9.9K views50 slides
Elastic Security keynote by
Elastic Security keynoteElastic Security keynote
Elastic Security keynoteElasticsearch
430 views39 slides
MySQLトラブル解析入門 by
MySQLトラブル解析入門MySQLトラブル解析入門
MySQLトラブル解析入門Mikiya Okuno
17.1K views74 slides
Best practices for highly available and large scale SolrCloud by
Best practices for highly available and large scale SolrCloudBest practices for highly available and large scale SolrCloud
Best practices for highly available and large scale SolrCloudAnshum Gupta
4.1K views24 slides

More Related Content

What's hot

Metasploit El Kitabı by
Metasploit El KitabıMetasploit El Kitabı
Metasploit El KitabıBGA Cyber Security
36.8K views48 slides
BloodHound: Attack Graphs Practically Applied to Active Directory by
BloodHound: Attack Graphs Practically Applied to Active DirectoryBloodHound: Attack Graphs Practically Applied to Active Directory
BloodHound: Attack Graphs Practically Applied to Active DirectoryAndy Robbins
3K views37 slides
An ACE in the Hole - Stealthy Host Persistence via Security Descriptors by
An ACE in the Hole - Stealthy Host Persistence via Security DescriptorsAn ACE in the Hole - Stealthy Host Persistence via Security Descriptors
An ACE in the Hole - Stealthy Host Persistence via Security DescriptorsWill Schroeder
6.9K views63 slides
SSH Tünelleme ile İçerik Filtreleyicileri Atlatmak by
SSH Tünelleme ile İçerik Filtreleyicileri AtlatmakSSH Tünelleme ile İçerik Filtreleyicileri Atlatmak
SSH Tünelleme ile İçerik Filtreleyicileri AtlatmakBGA Cyber Security
33.2K views7 slides
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기 by
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기Ji-Woong Choi
6.6K views38 slides
Rhel cluster basics 1 by
Rhel cluster basics   1Rhel cluster basics   1
Rhel cluster basics 1Manoj Singh
5K views41 slides

What's hot(20)

BloodHound: Attack Graphs Practically Applied to Active Directory by Andy Robbins
BloodHound: Attack Graphs Practically Applied to Active DirectoryBloodHound: Attack Graphs Practically Applied to Active Directory
BloodHound: Attack Graphs Practically Applied to Active Directory
Andy Robbins3K views
An ACE in the Hole - Stealthy Host Persistence via Security Descriptors by Will Schroeder
An ACE in the Hole - Stealthy Host Persistence via Security DescriptorsAn ACE in the Hole - Stealthy Host Persistence via Security Descriptors
An ACE in the Hole - Stealthy Host Persistence via Security Descriptors
Will Schroeder6.9K views
SSH Tünelleme ile İçerik Filtreleyicileri Atlatmak by BGA Cyber Security
SSH Tünelleme ile İçerik Filtreleyicileri AtlatmakSSH Tünelleme ile İçerik Filtreleyicileri Atlatmak
SSH Tünelleme ile İçerik Filtreleyicileri Atlatmak
BGA Cyber Security33.2K views
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기 by Ji-Woong Choi
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
[오픈소스컨설팅] 프로메테우스 모니터링 살펴보고 구성하기
Ji-Woong Choi6.6K views
Rhel cluster basics 1 by Manoj Singh
Rhel cluster basics   1Rhel cluster basics   1
Rhel cluster basics 1
Manoj Singh5K views
독특한회사 ZEPL 경험기 by Ahyoung Ryu
독특한회사 ZEPL 경험기독특한회사 ZEPL 경험기
독특한회사 ZEPL 경험기
Ahyoung Ryu2.1K views
DockerCon SF 2015: The Distributed System Toolkit by Docker, Inc.
DockerCon SF 2015: The Distributed System ToolkitDockerCon SF 2015: The Distributed System Toolkit
DockerCon SF 2015: The Distributed System Toolkit
Docker, Inc.18K views
Exadata_X10M-Hardware-Overview.pdf by Koko842772
Exadata_X10M-Hardware-Overview.pdfExadata_X10M-Hardware-Overview.pdf
Exadata_X10M-Hardware-Overview.pdf
Koko842772124 views
PCI DSS v 3.0 and Oracle Security Mapping by Troy Kitch
PCI DSS v 3.0 and Oracle Security MappingPCI DSS v 3.0 and Oracle Security Mapping
PCI DSS v 3.0 and Oracle Security Mapping
Troy Kitch3.6K views
Welcome to the Jungle: Pentesting AWS by Mike Felch
Welcome to the Jungle: Pentesting AWSWelcome to the Jungle: Pentesting AWS
Welcome to the Jungle: Pentesting AWS
Mike Felch4.5K views
Webinar | How to Understand Apache Cassandra™ Performance Through Read/Writ... by DataStax
Webinar  |  How to Understand Apache Cassandra™ Performance Through Read/Writ...Webinar  |  How to Understand Apache Cassandra™ Performance Through Read/Writ...
Webinar | How to Understand Apache Cassandra™ Performance Through Read/Writ...
DataStax1.3K views
Malicious Payloads vs Deep Visibility: A PowerShell Story by Daniel Bohannon
Malicious Payloads vs Deep Visibility: A PowerShell StoryMalicious Payloads vs Deep Visibility: A PowerShell Story
Malicious Payloads vs Deep Visibility: A PowerShell Story
Daniel Bohannon2.6K views
Scouter와 influx db – grafana 연동 가이드 by Ji-Woong Choi
Scouter와 influx db – grafana 연동 가이드Scouter와 influx db – grafana 연동 가이드
Scouter와 influx db – grafana 연동 가이드
Ji-Woong Choi3.8K views
Accelerate Your Analytic Queries with Amazon Aurora Parallel Query (DAT362) -... by Amazon Web Services
Accelerate Your Analytic Queries with Amazon Aurora Parallel Query (DAT362) -...Accelerate Your Analytic Queries with Amazon Aurora Parallel Query (DAT362) -...
Accelerate Your Analytic Queries with Amazon Aurora Parallel Query (DAT362) -...
Amazon Web Services2.1K views
Sql, Sql Injection ve Sqlmap Kullanımı by BGA Cyber Security
Sql, Sql Injection ve Sqlmap KullanımıSql, Sql Injection ve Sqlmap Kullanımı
Sql, Sql Injection ve Sqlmap Kullanımı
BGA Cyber Security19.1K views

Similar to BSides Hannover 2015 - Shell on Wheels

Steelcon 2015 - 0wning the internet of trash by
Steelcon 2015 - 0wning the internet of trashSteelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashinfodox
2.3K views56 slides
Hunt for the red DA by
Hunt for the red DAHunt for the red DA
Hunt for the red DANeil Lines
1.5K views118 slides
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon by
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwonThe basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwonKenneth Kwon
856 views63 slides
Timisoara Wireless Survey by
Timisoara Wireless SurveyTimisoara Wireless Survey
Timisoara Wireless SurveyCristian Vat
351 views18 slides
Cloud Device Insecurity by
Cloud Device InsecurityCloud Device Insecurity
Cloud Device InsecurityJeremy Brown
1.2K views116 slides
Step On In, The Water's Fine! - An Introduction To Security Testing Within A ... by
Step On In, The Water's Fine! - An Introduction To Security Testing Within A ...Step On In, The Water's Fine! - An Introduction To Security Testing Within A ...
Step On In, The Water's Fine! - An Introduction To Security Testing Within A ...Tom Moore
6.1K views139 slides

Similar to BSides Hannover 2015 - Shell on Wheels(20)

Steelcon 2015 - 0wning the internet of trash by infodox
Steelcon 2015 - 0wning the internet of trashSteelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trash
infodox2.3K views
Hunt for the red DA by Neil Lines
Hunt for the red DAHunt for the red DA
Hunt for the red DA
Neil Lines1.5K views
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon by Kenneth Kwon
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwonThe basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.kwon
Kenneth Kwon856 views
Timisoara Wireless Survey by Cristian Vat
Timisoara Wireless SurveyTimisoara Wireless Survey
Timisoara Wireless Survey
Cristian Vat351 views
Cloud Device Insecurity by Jeremy Brown
Cloud Device InsecurityCloud Device Insecurity
Cloud Device Insecurity
Jeremy Brown1.2K views
Step On In, The Water's Fine! - An Introduction To Security Testing Within A ... by Tom Moore
Step On In, The Water's Fine! - An Introduction To Security Testing Within A ...Step On In, The Water's Fine! - An Introduction To Security Testing Within A ...
Step On In, The Water's Fine! - An Introduction To Security Testing Within A ...
Tom Moore6.1K views
Hacker Halted 2018: From CTF to CVE – How Application of Concepts and Persist... by EC-Council
Hacker Halted 2018: From CTF to CVE – How Application of Concepts and Persist...Hacker Halted 2018: From CTF to CVE – How Application of Concepts and Persist...
Hacker Halted 2018: From CTF to CVE – How Application of Concepts and Persist...
EC-Council279 views
How to Build Your Own Physical Pentesting Go-bag by Beau Bullock
How to Build Your Own Physical Pentesting Go-bagHow to Build Your Own Physical Pentesting Go-bag
How to Build Your Own Physical Pentesting Go-bag
Beau Bullock11.3K views
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi... by Hackito Ergo Sum
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
Hackito Ergo Sum471 views
Password Storage Sucks! by nerdybeardo
Password Storage Sucks!Password Storage Sucks!
Password Storage Sucks!
nerdybeardo5.5K views
Ransomware - what is it, how to protect against it by Zoltan Balazs
Ransomware - what is it, how to protect against itRansomware - what is it, how to protect against it
Ransomware - what is it, how to protect against it
Zoltan Balazs2.2K views
Tiptoe Through The Network: Practical Vulnerability Assessments in Control Sy... by Digital Bond
Tiptoe Through The Network: Practical Vulnerability Assessments in Control Sy...Tiptoe Through The Network: Practical Vulnerability Assessments in Control Sy...
Tiptoe Through The Network: Practical Vulnerability Assessments in Control Sy...
Digital Bond2.2K views
The Web Application Hackers Toolchain by jasonhaddix
The Web Application Hackers ToolchainThe Web Application Hackers Toolchain
The Web Application Hackers Toolchain
jasonhaddix4.5K views
Creating Havoc using Human Interface Device by Positive Hack Days
Creating Havoc using Human Interface DeviceCreating Havoc using Human Interface Device
Creating Havoc using Human Interface Device
Positive Hack Days1.2K views
Sandbox detection: leak, abuse, test - Hacktivity 2015 by Zoltan Balazs
Sandbox detection: leak, abuse, test - Hacktivity 2015Sandbox detection: leak, abuse, test - Hacktivity 2015
Sandbox detection: leak, abuse, test - Hacktivity 2015
Zoltan Balazs3.7K views
Data security by sbmiller87
Data securityData security
Data security
sbmiller87579 views
Malware Analysis For The Enterprise by Jason Ross
Malware Analysis For The EnterpriseMalware Analysis For The Enterprise
Malware Analysis For The Enterprise
Jason Ross339 views
ANALYZE'15 - Bulk Malware Analysis at Scale by John Bambenek
ANALYZE'15 - Bulk Malware Analysis at ScaleANALYZE'15 - Bulk Malware Analysis at Scale
ANALYZE'15 - Bulk Malware Analysis at Scale
John Bambenek1.3K views

Recently uploaded

Krishna VSC 692 Credit Seminar.pptx by
Krishna VSC 692 Credit Seminar.pptxKrishna VSC 692 Credit Seminar.pptx
Krishna VSC 692 Credit Seminar.pptxKrishnaSharma682993
11 views54 slides
IMMUNODIAGNOSTICS KITS.pdf by
IMMUNODIAGNOSTICS KITS.pdfIMMUNODIAGNOSTICS KITS.pdf
IMMUNODIAGNOSTICS KITS.pdfvetrivel303632
20 views10 slides
A giant thin stellar stream in the Coma Galaxy Cluster by
A giant thin stellar stream in the Coma Galaxy ClusterA giant thin stellar stream in the Coma Galaxy Cluster
A giant thin stellar stream in the Coma Galaxy ClusterSérgio Sacani
20 views14 slides
2. Natural Sciences and Technology Author Siyavula.pdf by
2. Natural Sciences and Technology Author Siyavula.pdf2. Natural Sciences and Technology Author Siyavula.pdf
2. Natural Sciences and Technology Author Siyavula.pdfssuser821efa
12 views232 slides
Best Hybrid Event Platform.pptx by
Best Hybrid Event Platform.pptxBest Hybrid Event Platform.pptx
Best Hybrid Event Platform.pptxHarriet Davis
10 views13 slides

Recently uploaded(20)

A giant thin stellar stream in the Coma Galaxy Cluster by Sérgio Sacani
A giant thin stellar stream in the Coma Galaxy ClusterA giant thin stellar stream in the Coma Galaxy Cluster
A giant thin stellar stream in the Coma Galaxy Cluster
Sérgio Sacani20 views
2. Natural Sciences and Technology Author Siyavula.pdf by ssuser821efa
2. Natural Sciences and Technology Author Siyavula.pdf2. Natural Sciences and Technology Author Siyavula.pdf
2. Natural Sciences and Technology Author Siyavula.pdf
ssuser821efa12 views
Best Hybrid Event Platform.pptx by Harriet Davis
Best Hybrid Event Platform.pptxBest Hybrid Event Platform.pptx
Best Hybrid Event Platform.pptx
Harriet Davis10 views
Oral_Presentation_by_Fatma (2).pdf by fatmaalmrzqi
Oral_Presentation_by_Fatma (2).pdfOral_Presentation_by_Fatma (2).pdf
Oral_Presentation_by_Fatma (2).pdf
fatmaalmrzqi8 views
별헤는 사람들 2023년 12월호 전명원 교수 자료 by sciencepeople
별헤는 사람들 2023년 12월호 전명원 교수 자료별헤는 사람들 2023년 12월호 전명원 교수 자료
별헤는 사람들 2023년 12월호 전명원 교수 자료
sciencepeople68 views
Study on Drug Drug Interaction Through Prescription Analysis of Type II Diabe... by Anmol Vishnu Gupta
Study on Drug Drug Interaction Through Prescription Analysis of Type II Diabe...Study on Drug Drug Interaction Through Prescription Analysis of Type II Diabe...
Study on Drug Drug Interaction Through Prescription Analysis of Type II Diabe...
selection of preformed arch wires during the alignment stage of preadjusted o... by MaherFouda1
selection of preformed arch wires during the alignment stage of preadjusted o...selection of preformed arch wires during the alignment stage of preadjusted o...
selection of preformed arch wires during the alignment stage of preadjusted o...
MaherFouda17 views
Experimental animal Guinea pigs.pptx by Mansee Arya
Experimental animal Guinea pigs.pptxExperimental animal Guinea pigs.pptx
Experimental animal Guinea pigs.pptx
Mansee Arya42 views
Effect of Integrated Nutrient Management on Growth and Yield of Solanaceous F... by SwagatBehera9
Effect of Integrated Nutrient Management on Growth and Yield of Solanaceous F...Effect of Integrated Nutrient Management on Growth and Yield of Solanaceous F...
Effect of Integrated Nutrient Management on Growth and Yield of Solanaceous F...
SwagatBehera95 views
Ellagic Acid and Its Metabolites as Potent and Selective Allosteric Inhibitor... by Trustlife
Ellagic Acid and Its Metabolites as Potent and Selective Allosteric Inhibitor...Ellagic Acid and Its Metabolites as Potent and Selective Allosteric Inhibitor...
Ellagic Acid and Its Metabolites as Potent and Selective Allosteric Inhibitor...
Trustlife154 views
Vegetable grafting: A new crop improvement approach.pptx by Himul Suthar
Vegetable grafting: A new crop improvement approach.pptxVegetable grafting: A new crop improvement approach.pptx
Vegetable grafting: A new crop improvement approach.pptx
Himul Suthar8 views
Small ruminant keepers’ knowledge, attitudes and practices towards peste des ... by ILRI
Small ruminant keepers’ knowledge, attitudes and practices towards peste des ...Small ruminant keepers’ knowledge, attitudes and practices towards peste des ...
Small ruminant keepers’ knowledge, attitudes and practices towards peste des ...
ILRI9 views
Small ruminant keepers’ knowledge, attitudes and practices towards peste des ... by ILRI
Small ruminant keepers’ knowledge, attitudes and practices towards peste des ...Small ruminant keepers’ knowledge, attitudes and practices towards peste des ...
Small ruminant keepers’ knowledge, attitudes and practices towards peste des ...
ILRI6 views
Indian council for child welfare by RenuWaghmare2
Indian council for child welfareIndian council for child welfare
Indian council for child welfare
RenuWaghmare27 views

BSides Hannover 2015 - Shell on Wheels

  • 1. Shell on Wheels: Darren Martyn Xiphos Research darren.martyn@xiphosresearch.co.uk Exploitation of endpoint wireless devices for mostly fun and possibly profit
  • 2. whoami • Darren Martyn / @infodox (twitter) • Penetration Tester & Researcher @ Xiphos Research Ltd • Forensics & Chemistry Student @ GMIT
  • 3. whoami: alternatively • An “unethical immoral twit” – Graham Cluley • “A bad influence” - Anon
  • 4. what? • Today we will look at owning those “free WiFi” access points on just about every bus ever. • Sorry guys. Not Charlie Miller style bus owning here. Nothing explodes/catches fire/crashes. • Still, will make bus rides a lot more fun!
  • 7. what do they have in common?
  • 8. what do they have in common? The magic box of Wi-Fi!
  • 9. Let’s explore the magic box! • i486 Embedded Processor (so, x86) • One or more (usually two) data cards for cell connectivity • WiFi, Ethernet, GPS, serial • Unfortunately, I was unable to acquire my own magic box
  • 10. But firmware is good too! • Via googling, came across a random FTP server containing 108 firmware images for these devices (courtesy of an engineer) • Judicious application of wget. (anonymous login FTW) • Now we have firmware images
  • 11. Because of scale we scripted binwalk…
  • 12. Next up, scripting uncramfs… Trigger Warning: Filthy Code Ahead
  • 13. find . –name “vuln” • Took a fairly blind approach to finding vulns • “Grep and gripe” kind of things • First off, looked at the web interface of device
  • 14. Anyone see why this prompted interest?
  • 17. Some numbers • All 108 were vulnerable to ShellShock • All 108 had the same shitty CGI script • 106 used thttpd rooting as root • 2 ran lighttpd. Also as root
  • 20. Going beyond Rootshells • So we can execute code as root • Leverage this to bypass auth and get at the web interface? • Dump settings from the device? • Persistent (firmware) rootkits?
  • 21. Bypassing Auth • Uses .htpasswd for auth • Wrote a simple script to enable/disable auth • Simply mv the .htpasswd to disable, mv back to re-enable
  • 23. Dumping Settings • With Auth bypassed, we can wget “moovbox.settings” from the device • Sqlite3 database, contains passwords and such • The Sqlite database was a mess, so I wrote a parser to dump the goods from it
  • 25. Remote Settings Grabber • Just for shits and giggles, I wrote an auto settings downloader • Disable auth on device • Dump database from device (save as md5sum of file) • Re-enable auth on device
  • 27. Further firmware analysis • Lets look for more fun stuff in this firmware • First off, we analyse the passwd files • 4 unique hashes
  • 28. The Hashes • I have yet to crack these. People have been trying and failing for about a month. Can you succeed? root:$1$5jjAfVIS$dIG6AvGNwq8EENjTHnfpK/ root:$1$jb.3W.1D$8FeBW.T/x2wwJVB.lp.gv1 root:$1$bw7WuzHj$aU6V7omf9zBWA2sEaJv9p1 root:$6$W74jOIhT$QaYoDDN.N1SRgyG5ALymJHcYc9TmXKcITXyCstG DdK9cXOssLOTMQPl2uRm.wsNZ7oE5byOOrdNlvNxyguqVs/
  • 29. SSH Keys • Protip: Hardcoded SSH Keys Suck • They all have /etc/ssh/ keys. RSA and DSA • They also have the same /etc/ssh_key privkey, which is a bit unusual...
  • 30. /etc/ssh_key • Now, this is an odd one. It matches exactly two boxes in the wild – both hosts in Germany • As to wtf these are, I have no idea • If anyone can figure it out, it would be great ;) • 89.110.151.186 & 89.110.148.26 (who is this?)
  • 31. Using SSH keys to fingerprint
  • 32. Look! Duplicate Keys! Everywhere!
  • 33. Let’s go after SSL keys… • OpenVPN Keys: find . -name "*.key" (108) > 2e465be3c06ea7db968347aaa3df7d37 > All identical • SSL Keys: find . -name "*.pem" (973) > Also the same…
  • 34. SSL Keys • 6 of them on each image. All identical across images: > 7135ad5b7fd5fb2eb23f8dfecf74919d > cb5199178e4649461928356c7cbdae74 > de2c6949bd1bca55c20d9610510a08d1 > 905a7590ee039a788a08d4dfd15d2582 > a926c2beaa439f37bc62a5678a4e5906 > 35a569e0e768495554c4cbddd787f9e4
  • 35. God damn it – all the same?!?! • These are also good for remote fingerprinting • And probably traffic interception... • “You guys are bad at this!” is the only apt response to the vendor
  • 36. Owning the Client • Interestingly, these devices do intercept HTTP(s) traffic • This is for site blocking and to inject banner ads • Seems to use Privoxy and some scripts to do this
  • 37. (More) Owning the Client • Devices all have this wonderful traffic interception suite • Modify existing JS injector to inject BeEF, perhaps? • Not tested for obvious reasons, but doable 
  • 38. (Yet More) Owning the Client • These devices have libpcap installed • Dropping a working packet sniffer is easy • Sniff cleartext credentials over the wire... All their traffic is going through you!
  • 39. Remember I said SSL interception? • Some of these devices observed in the wild tamper with HTTPS traffic • Self signed keys observed with SSL'd sites, etc. • Seemingly generated from the keys stored on device • Use your imagination 
  • 41. So what about rootkits? • This is where it gets really fun. And fairly untested • While attempting to repack firmware, I noticed there were two variants of image in there • Variant 1 was just a raw CRAMFS image • Variant 2 was [header][CRAMFS image]
  • 42. Challenges • So the raw CRAMFS one, we can just repack and upload • The other one... I had to try make sense of the header • This is untested on a live device, so don't try this unless you are willing to break stuff
  • 44. Creating ‘doored firmware • Add backdoors to extracted CramFS filesystem • Repackage CramFS filesystem • If needed, append the weird header so that CramFS magic starts at offset 0x64
  • 45. How do install our firmware?
  • 46. Suggested Payloads for Modified Firmware • Script Injector as mentioned previously using already existing code on the device! • Traffic sniffer ala LinuxFlasher.A rootkit  • Remote shell/file xfer – “tshd” or similar with a hourly callback to C2?
  • 47. Some Conclusions • These devices have no security • If you use free WiFi on public transport, expect to be owned. (well, thats to be expected?) • If you are a vendor of such devices, start taking security bloody seriously
  • 48. Afterthoughts: Concerning Disclosure • Tried emailing icomera, did not receive response • Made repeated attempts with no success, however, normally when I try alert vendors about stuff they get annoying and irritable
  • 49. Afterthoughts: Concerning Patching • Icomera claim on their blog to have patched the ShellShock exploit • However, as its up to end users to patch their boxen (no auto updater), this is kinda useless • All the devices I see ITW are vulnerable still • Raises concerns over Internet of Junk and updates
  • 50. Thanks • f1nux and the BsidesHN crew for making this event happen <3 • Co-workers for letting me off to do science and supporting it • Various friends (you know who you are) for helping out • Icomera, for making such a wonderful product I have something to talk about 