SlideShare a Scribd company logo
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

More Related Content

What's hot

Project SHINE Findings Report (1-Oct-2014)
Project SHINE Findings Report (1-Oct-2014)Project SHINE Findings Report (1-Oct-2014)
Project SHINE Findings Report (1-Oct-2014)Bob Radvanovsky
 
Ocean Protocol: New Powers for Data Scientists
Ocean Protocol: New Powers for Data ScientistsOcean Protocol: New Powers for Data Scientists
Ocean Protocol: New Powers for Data ScientistsTrent McConaghy
 
26.1.7 lab snort and firewall rules
26.1.7 lab   snort and firewall rules26.1.7 lab   snort and firewall rules
26.1.7 lab snort and firewall rulesFreddy Buenaño
 
Continuous Integration and Kamailio
Continuous Integration and KamailioContinuous Integration and Kamailio
Continuous Integration and KamailioGiacomo Vacca
 
Beyond JSON - An Introduction to FlatBuffers
Beyond JSON - An Introduction to FlatBuffersBeyond JSON - An Introduction to FlatBuffers
Beyond JSON - An Introduction to FlatBuffersMaxim Zaks
 
Guideline for Call Data Record Analysis by Raghu Khimani
Guideline for Call Data Record Analysis by Raghu KhimaniGuideline for Call Data Record Analysis by Raghu Khimani
Guideline for Call Data Record Analysis by Raghu KhimaniDr Raghu Khimani
 
JavaScript for Hackers.pdf
JavaScript for Hackers.pdfJavaScript for Hackers.pdf
JavaScript for Hackers.pdfslideshareadmin2
 
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...linuxlab_conf
 
Kia Mia Innovation Case
Kia Mia Innovation CaseKia Mia Innovation Case
Kia Mia Innovation Caseitelligence
 
Ost284 emerging technologies final exam
Ost284 emerging technologies final examOst284 emerging technologies final exam
Ost284 emerging technologies final exambbdavis
 
Simple callcenter platform with PHP
Simple callcenter platform with PHPSimple callcenter platform with PHP
Simple callcenter platform with PHPMorten Amundsen
 
Carta de Fiscales de EEUU a Juez Kevin Castel
Carta de Fiscales de EEUU a Juez Kevin CastelCarta de Fiscales de EEUU a Juez Kevin Castel
Carta de Fiscales de EEUU a Juez Kevin CastelAndySalgado7
 
Impact of AI on Call Centers
Impact of AI on Call CentersImpact of AI on Call Centers
Impact of AI on Call CentersNaina Rajput
 

What's hot (20)

Project SHINE Findings Report (1-Oct-2014)
Project SHINE Findings Report (1-Oct-2014)Project SHINE Findings Report (1-Oct-2014)
Project SHINE Findings Report (1-Oct-2014)
 
Chatbot_Presentation
Chatbot_PresentationChatbot_Presentation
Chatbot_Presentation
 
Ocean Protocol: New Powers for Data Scientists
Ocean Protocol: New Powers for Data ScientistsOcean Protocol: New Powers for Data Scientists
Ocean Protocol: New Powers for Data Scientists
 
26.1.7 lab snort and firewall rules
26.1.7 lab   snort and firewall rules26.1.7 lab   snort and firewall rules
26.1.7 lab snort and firewall rules
 
Continuous Integration and Kamailio
Continuous Integration and KamailioContinuous Integration and Kamailio
Continuous Integration and Kamailio
 
Beyond JSON - An Introduction to FlatBuffers
Beyond JSON - An Introduction to FlatBuffersBeyond JSON - An Introduction to FlatBuffers
Beyond JSON - An Introduction to FlatBuffers
 
Guideline for Call Data Record Analysis by Raghu Khimani
Guideline for Call Data Record Analysis by Raghu KhimaniGuideline for Call Data Record Analysis by Raghu Khimani
Guideline for Call Data Record Analysis by Raghu Khimani
 
JavaScript for Hackers.pdf
JavaScript for Hackers.pdfJavaScript for Hackers.pdf
JavaScript for Hackers.pdf
 
Dns
DnsDns
Dns
 
Data recovery
Data recoveryData recovery
Data recovery
 
Remote Login
Remote LoginRemote Login
Remote Login
 
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
Valerio Di Giampietro - Introduction To IoT Reverse Engineering with an examp...
 
Kia Mia Innovation Case
Kia Mia Innovation CaseKia Mia Innovation Case
Kia Mia Innovation Case
 
Scope after mca
Scope after mcaScope after mca
Scope after mca
 
E mail Investigation
E mail InvestigationE mail Investigation
E mail Investigation
 
Ost284 emerging technologies final exam
Ost284 emerging technologies final examOst284 emerging technologies final exam
Ost284 emerging technologies final exam
 
Simple callcenter platform with PHP
Simple callcenter platform with PHPSimple callcenter platform with PHP
Simple callcenter platform with PHP
 
Database forensics
Database forensicsDatabase forensics
Database forensics
 
Carta de Fiscales de EEUU a Juez Kevin Castel
Carta de Fiscales de EEUU a Juez Kevin CastelCarta de Fiscales de EEUU a Juez Kevin Castel
Carta de Fiscales de EEUU a Juez Kevin Castel
 
Impact of AI on Call Centers
Impact of AI on Call CentersImpact of AI on Call Centers
Impact of AI on Call Centers
 

Similar to BSides Hannover 2015 - Shell on Wheels

Steelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashSteelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashinfodox
 
Hunt for the red DA
Hunt for the red DAHunt for the red DA
Hunt for the red DANeil Lines
 
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.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.kwonKenneth Kwon
 
Timisoara Wireless Survey
Timisoara Wireless SurveyTimisoara Wireless Survey
Timisoara Wireless SurveyCristian Vat
 
Cloud Device Insecurity
Cloud Device InsecurityCloud Device Insecurity
Cloud Device InsecurityJeremy Brown
 
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 ...
Step On In, The Water's Fine! - An Introduction To Security Testing Within A ...Tom Moore
 
Fun With SHA2 Certificates
Fun With SHA2 CertificatesFun With SHA2 Certificates
Fun With SHA2 CertificatesGabriella Davis
 
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...
Hacker Halted 2018: From CTF to CVE – How Application of Concepts and Persist...EC-Council
 
How to Build Your Own Physical Pentesting Go-bag
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-bagBeau Bullock
 
[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...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...Hackito Ergo Sum
 
Password Storage Sucks!
Password Storage Sucks!Password Storage Sucks!
Password Storage Sucks!nerdybeardo
 
Ransomware - what is it, how to protect against it
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 itZoltan Balazs
 
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...
Tiptoe Through The Network: Practical Vulnerability Assessments in Control Sy...Digital Bond
 
The Web Application Hackers Toolchain
The Web Application Hackers ToolchainThe Web Application Hackers Toolchain
The Web Application Hackers Toolchainjasonhaddix
 
Creating Havoc using Human Interface Device
Creating Havoc using Human Interface DeviceCreating Havoc using Human Interface Device
Creating Havoc using Human Interface DevicePositive Hack Days
 
Dmk sb2010 web_defense
Dmk sb2010 web_defenseDmk sb2010 web_defense
Dmk sb2010 web_defenseDan Kaminsky
 
Sandbox detection: leak, abuse, test - Hacktivity 2015
Sandbox detection: leak, abuse, test - Hacktivity 2015Sandbox detection: leak, abuse, test - Hacktivity 2015
Sandbox detection: leak, abuse, test - Hacktivity 2015Zoltan Balazs
 
Malware Analysis For The Enterprise
Malware Analysis For The EnterpriseMalware Analysis For The Enterprise
Malware Analysis For The EnterpriseJason Ross
 
ANALYZE'15 - Bulk Malware Analysis at Scale
ANALYZE'15 - Bulk Malware Analysis at ScaleANALYZE'15 - Bulk Malware Analysis at Scale
ANALYZE'15 - Bulk Malware Analysis at ScaleJohn Bambenek
 

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

Steelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashSteelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trash
 
Hunt for the red DA
Hunt for the red DAHunt for the red DA
Hunt for the red DA
 
The basics of hacking and penetration testing 이제 시작이야 해킹과 침투 테스트 kenneth.s.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
 
Timisoara Wireless Survey
Timisoara Wireless SurveyTimisoara Wireless Survey
Timisoara Wireless Survey
 
Cloud Device Insecurity
Cloud Device InsecurityCloud Device Insecurity
Cloud Device Insecurity
 
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 ...
Step On In, The Water's Fine! - An Introduction To Security Testing Within A ...
 
Fun With SHA2 Certificates
Fun With SHA2 CertificatesFun With SHA2 Certificates
Fun With SHA2 Certificates
 
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...
Hacker Halted 2018: From CTF to CVE – How Application of Concepts and Persist...
 
How to Build Your Own Physical Pentesting Go-bag
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
 
[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...
[HES2013] Virtually secure, analysis to remote root 0day on an industry leadi...
 
Password Storage Sucks!
Password Storage Sucks!Password Storage Sucks!
Password Storage Sucks!
 
Ransomware - what is it, how to protect against it
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
 
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...
Tiptoe Through The Network: Practical Vulnerability Assessments in Control Sy...
 
The Web Application Hackers Toolchain
The Web Application Hackers ToolchainThe Web Application Hackers Toolchain
The Web Application Hackers Toolchain
 
Creating Havoc using Human Interface Device
Creating Havoc using Human Interface DeviceCreating Havoc using Human Interface Device
Creating Havoc using Human Interface Device
 
Dmk sb2010 web_defense
Dmk sb2010 web_defenseDmk sb2010 web_defense
Dmk sb2010 web_defense
 
Sandbox detection: leak, abuse, test - Hacktivity 2015
Sandbox detection: leak, abuse, test - Hacktivity 2015Sandbox detection: leak, abuse, test - Hacktivity 2015
Sandbox detection: leak, abuse, test - Hacktivity 2015
 
Data security
Data securityData security
Data security
 
Malware Analysis For The Enterprise
Malware Analysis For The EnterpriseMalware Analysis For The Enterprise
Malware Analysis For The Enterprise
 
ANALYZE'15 - Bulk Malware Analysis at Scale
ANALYZE'15 - Bulk Malware Analysis at ScaleANALYZE'15 - Bulk Malware Analysis at Scale
ANALYZE'15 - Bulk Malware Analysis at Scale
 

Recently uploaded

Structures and textures of metamorphic rocks
Structures and textures of metamorphic rocksStructures and textures of metamorphic rocks
Structures and textures of metamorphic rockskumarmathi863
 
FAIRSpectra - Towards a common data file format for SIMS images
FAIRSpectra - Towards a common data file format for SIMS imagesFAIRSpectra - Towards a common data file format for SIMS images
FAIRSpectra - Towards a common data file format for SIMS imagesAlex Henderson
 
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.Sérgio Sacani
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxmuralinath2
 
word2vec, node2vec, graph2vec, X2vec: Towards a Theory of Vector Embeddings o...
word2vec, node2vec, graph2vec, X2vec: Towards a Theory of Vector Embeddings o...word2vec, node2vec, graph2vec, X2vec: Towards a Theory of Vector Embeddings o...
word2vec, node2vec, graph2vec, X2vec: Towards a Theory of Vector Embeddings o...Subhajit Sahu
 
Topography and sediments of the floor of the Bay of Bengal
Topography and sediments of the floor of the Bay of BengalTopography and sediments of the floor of the Bay of Bengal
Topography and sediments of the floor of the Bay of BengalMd Hasan Tareq
 
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...Sérgio Sacani
 
Predicting property prices with machine learning algorithms.pdf
Predicting property prices with machine learning algorithms.pdfPredicting property prices with machine learning algorithms.pdf
Predicting property prices with machine learning algorithms.pdfbinhminhvu04
 
Pests of sugarcane_Binomics_IPM_Dr.UPR.pdf
Pests of sugarcane_Binomics_IPM_Dr.UPR.pdfPests of sugarcane_Binomics_IPM_Dr.UPR.pdf
Pests of sugarcane_Binomics_IPM_Dr.UPR.pdfPirithiRaju
 
Microbial Type Culture Collection (MTCC)
Microbial Type Culture Collection (MTCC)Microbial Type Culture Collection (MTCC)
Microbial Type Culture Collection (MTCC)abhishekdhamu51
 
The ASGCT Annual Meeting was packed with exciting progress in the field advan...
The ASGCT Annual Meeting was packed with exciting progress in the field advan...The ASGCT Annual Meeting was packed with exciting progress in the field advan...
The ASGCT Annual Meeting was packed with exciting progress in the field advan...Health Advances
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONChetanK57
 
Comparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebratesComparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebratessachin783648
 
extra-chromosomal-inheritance[1].pptx.pdfpdf
extra-chromosomal-inheritance[1].pptx.pdfpdfextra-chromosomal-inheritance[1].pptx.pdfpdf
extra-chromosomal-inheritance[1].pptx.pdfpdfDiyaBiswas10
 
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdfSCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdfSELF-EXPLANATORY
 
FAIR & AI Ready KGs for Explainable Predictions
FAIR & AI Ready KGs for Explainable PredictionsFAIR & AI Ready KGs for Explainable Predictions
FAIR & AI Ready KGs for Explainable PredictionsMichel Dumontier
 
SAMPLING.pptx for analystical chemistry sample techniques
SAMPLING.pptx for analystical chemistry sample techniquesSAMPLING.pptx for analystical chemistry sample techniques
SAMPLING.pptx for analystical chemistry sample techniquesrodneykiptoo8
 
GLOBAL AND LOCAL SCENARIO OF FOOD AND NUTRITION.pptx
GLOBAL AND LOCAL SCENARIO OF FOOD AND NUTRITION.pptxGLOBAL AND LOCAL SCENARIO OF FOOD AND NUTRITION.pptx
GLOBAL AND LOCAL SCENARIO OF FOOD AND NUTRITION.pptxSultanMuhammadGhauri
 
National Biodiversity protection initiatives and Convention on Biological Di...
National Biodiversity protection initiatives and  Convention on Biological Di...National Biodiversity protection initiatives and  Convention on Biological Di...
National Biodiversity protection initiatives and Convention on Biological Di...PABOLU TEJASREE
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Sérgio Sacani
 

Recently uploaded (20)

Structures and textures of metamorphic rocks
Structures and textures of metamorphic rocksStructures and textures of metamorphic rocks
Structures and textures of metamorphic rocks
 
FAIRSpectra - Towards a common data file format for SIMS images
FAIRSpectra - Towards a common data file format for SIMS imagesFAIRSpectra - Towards a common data file format for SIMS images
FAIRSpectra - Towards a common data file format for SIMS images
 
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
THE IMPORTANCE OF MARTIAN ATMOSPHERE SAMPLE RETURN.
 
Hemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptxHemoglobin metabolism_pathophysiology.pptx
Hemoglobin metabolism_pathophysiology.pptx
 
word2vec, node2vec, graph2vec, X2vec: Towards a Theory of Vector Embeddings o...
word2vec, node2vec, graph2vec, X2vec: Towards a Theory of Vector Embeddings o...word2vec, node2vec, graph2vec, X2vec: Towards a Theory of Vector Embeddings o...
word2vec, node2vec, graph2vec, X2vec: Towards a Theory of Vector Embeddings o...
 
Topography and sediments of the floor of the Bay of Bengal
Topography and sediments of the floor of the Bay of BengalTopography and sediments of the floor of the Bay of Bengal
Topography and sediments of the floor of the Bay of Bengal
 
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...
Gliese 12 b: A Temperate Earth-sized Planet at 12 pc Ideal for Atmospheric Tr...
 
Predicting property prices with machine learning algorithms.pdf
Predicting property prices with machine learning algorithms.pdfPredicting property prices with machine learning algorithms.pdf
Predicting property prices with machine learning algorithms.pdf
 
Pests of sugarcane_Binomics_IPM_Dr.UPR.pdf
Pests of sugarcane_Binomics_IPM_Dr.UPR.pdfPests of sugarcane_Binomics_IPM_Dr.UPR.pdf
Pests of sugarcane_Binomics_IPM_Dr.UPR.pdf
 
Microbial Type Culture Collection (MTCC)
Microbial Type Culture Collection (MTCC)Microbial Type Culture Collection (MTCC)
Microbial Type Culture Collection (MTCC)
 
The ASGCT Annual Meeting was packed with exciting progress in the field advan...
The ASGCT Annual Meeting was packed with exciting progress in the field advan...The ASGCT Annual Meeting was packed with exciting progress in the field advan...
The ASGCT Annual Meeting was packed with exciting progress in the field advan...
 
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATIONPRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
PRESENTATION ABOUT PRINCIPLE OF COSMATIC EVALUATION
 
Comparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebratesComparative structure of adrenal gland in vertebrates
Comparative structure of adrenal gland in vertebrates
 
extra-chromosomal-inheritance[1].pptx.pdfpdf
extra-chromosomal-inheritance[1].pptx.pdfpdfextra-chromosomal-inheritance[1].pptx.pdfpdf
extra-chromosomal-inheritance[1].pptx.pdfpdf
 
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdfSCHIZOPHRENIA Disorder/ Brain Disorder.pdf
SCHIZOPHRENIA Disorder/ Brain Disorder.pdf
 
FAIR & AI Ready KGs for Explainable Predictions
FAIR & AI Ready KGs for Explainable PredictionsFAIR & AI Ready KGs for Explainable Predictions
FAIR & AI Ready KGs for Explainable Predictions
 
SAMPLING.pptx for analystical chemistry sample techniques
SAMPLING.pptx for analystical chemistry sample techniquesSAMPLING.pptx for analystical chemistry sample techniques
SAMPLING.pptx for analystical chemistry sample techniques
 
GLOBAL AND LOCAL SCENARIO OF FOOD AND NUTRITION.pptx
GLOBAL AND LOCAL SCENARIO OF FOOD AND NUTRITION.pptxGLOBAL AND LOCAL SCENARIO OF FOOD AND NUTRITION.pptx
GLOBAL AND LOCAL SCENARIO OF FOOD AND NUTRITION.pptx
 
National Biodiversity protection initiatives and Convention on Biological Di...
National Biodiversity protection initiatives and  Convention on Biological Di...National Biodiversity protection initiatives and  Convention on Biological Di...
National Biodiversity protection initiatives and Convention on Biological Di...
 
Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...Multi-source connectivity as the driver of solar wind variability in the heli...
Multi-source connectivity as the driver of solar wind variability in the heli...
 

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 