SLIDE 1
Assessing ¡BYOD ¡with ¡the ¡ Smarthpone ¡Pentest ¡Framework ¡
Georgia ¡Weidman ¡
SLIDE 2
SLIDE 3
SLIDE 4
SLIDE 5
SLIDE 6
BYOD ¡Is ¡Not ¡New ¡
Contractor Laptop Rogue Access Point Gaming Console
SLIDE 7
SLIDE 8
Tradi>onal ¡Vulnerability ¡Scanning ¡
SLIDE 9
The ¡iPhone ¡in ¡Ques>on ¡Is… ¡
Jailbroken ¡ ¡ Has ¡SSH ¡installed ¡ ¡ Has ¡a ¡default ¡password ¡ ¡ Is ¡not ¡subject ¡to ¡any ¡MDM ¡restric>ons ¡
SLIDE 10
The ¡Ques>on ¡
¡ ¡ ¡ What ¡can ¡we ¡do ¡to ¡assess ¡the ¡threat ¡BYOD ¡ Mobile ¡devices ¡add ¡to ¡the ¡enterprise? ¡
SLIDE 11 Smartphones ¡in ¡the ¡workplace ¡
l Access ¡your ¡data ¡
¡
l Store ¡company ¡emails ¡
¡
l Connect ¡to ¡VPNs ¡
¡
l Generate ¡1 ¡>me ¡passwords ¡
SLIDE 12 Threats ¡against ¡smartphones: ¡Apps ¡
l Malicious ¡apps ¡steal ¡your ¡data, ¡remotely ¡
control ¡your ¡phone, ¡etc. ¡ ¡
l Happens ¡on ¡all ¡plaQorms. ¡Some ¡easier ¡than ¡
¡
l If ¡your ¡employees ¡have ¡a ¡malicious ¡angry ¡
birds ¡add-‑on ¡what ¡is ¡it ¡doing ¡with ¡your ¡data? ¡ ¡
SLIDE 13 Threats ¡against ¡smartphones: ¡soUware ¡ bugs ¡
l Browsers ¡have ¡bugs ¡
¡
l Apps ¡have ¡bugs ¡
¡
l Kernels ¡have ¡bugs ¡
¡
l Malicious ¡apps, ¡webpages, ¡etc. ¡can ¡exploit ¡
these ¡and ¡gain ¡access ¡to ¡data ¡
SLIDE 14 Threats ¡against ¡smartphones: ¡social ¡ engineering ¡ ¡
l Users ¡can ¡be ¡tricked ¡into ¡opening ¡malicious ¡
links ¡ ¡
l Downloading ¡malicious ¡apps ¡
¡ ¡
SLIDE 15 Threats ¡against ¡smartphones: ¡ jailbreaking ¡
l Smartphones ¡can ¡be ¡jailbroken ¡
¡
l Giving ¡a ¡program ¡expressed ¡permission ¡to ¡
exploit ¡your ¡phone ¡ ¡
l Once ¡it ¡is ¡exploited, ¡what ¡else ¡does ¡the ¡
jailbreaking ¡program ¡do? ¡
SLIDE 16
Remote ¡Vulnerability ¡Example ¡
Jailbroken ¡iPhones ¡all ¡have ¡the ¡same ¡default ¡ SSH ¡password ¡ ¡ How ¡many ¡jailbroken ¡iPhones ¡have ¡the ¡default ¡ SSH ¡password ¡(anyone ¡can ¡log ¡in ¡as ¡root)? ¡ ¡
SLIDE 17 Client ¡Side ¡Vulnerability ¡Example ¡
Smartphone ¡browsers, ¡etc. ¡are ¡subject ¡to ¡ vulnerabili>es ¡ ¡ ¡ If ¡your ¡users ¡surf ¡to ¡a ¡malicious ¡page ¡their ¡ browsers ¡may ¡be ¡exploited ¡ ¡ Are ¡the ¡smartphone ¡browsers ¡in ¡your ¡
- rganiza>on ¡vulnerable ¡to ¡browser ¡exploits? ¡
SLIDE 18
Social ¡Engineering ¡Vulnerability ¡ Example ¡
SMS ¡is ¡the ¡new ¡email ¡for ¡spam/phishing ¡a_acks ¡ ¡ “Open ¡this ¡website” ¡“Download ¡this ¡app” ¡ ¡ ¡ Will ¡your ¡users ¡click ¡on ¡links ¡in ¡text ¡messages? ¡ ¡ Will ¡they ¡download ¡apps ¡from ¡3rd ¡par>es? ¡
SLIDE 19
Local ¡Vulnerability ¡Example ¡
Smartphones ¡have ¡kernel ¡vulnerabili>es ¡ ¡ Used ¡my ¡jailbreaks ¡and ¡malicious ¡apps ¡ ¡ Are ¡the ¡smartphones ¡in ¡your ¡organiza>on ¡ subject ¡to ¡local ¡privilege ¡escala>on ¡ vulnerabili>es? ¡
SLIDE 20
Post ¡exploita>on ¡
Command ¡shell ¡ App ¡based ¡agent ¡
Payloads: ¡informa>on ¡gathering ¡
local ¡privilege ¡escala>on ¡ remote ¡control ¡ ¡ ¡
SLIDE 21
The ¡Ques>on ¡
A ¡client ¡wants ¡to ¡know ¡if ¡the ¡environment ¡is ¡ secure ¡ ¡ I ¡as ¡a ¡pentester ¡am ¡charged ¡with ¡finding ¡out ¡ ¡ There ¡are ¡smartphones ¡in ¡the ¡environment ¡ ¡ How ¡to ¡I ¡assess ¡the ¡threat ¡of ¡these ¡ smartphones? ¡
SLIDE 22
Smartphone ¡Pentest ¡Framework ¡
Wri_en ¡in ¡Perl ¡ ¡ Post ¡exploita>on ¡in ¡the ¡languages ¡of ¡the ¡devices ¡ ¡ Supported ¡in ¡Linux ¡ ¡ Included ¡in ¡Backtrack ¡5 ¡R3 ¡ ¡ ¡
SLIDE 23
What ¡you ¡can ¡test ¡for ¡
Remote ¡vulnerabili>es ¡ ¡ Client ¡side ¡vulnerabili>es ¡ ¡ Social ¡engineering ¡ ¡ Local ¡vulnerabili>es ¡ ¡
SLIDE 24
Requirements ¡
Uses ¡Perl ¡Expect, ¡Perl ¡SerialPort, ¡and ¡Perl ¡DB ¡ connectors ¡ ¡ Stores ¡data ¡in ¡a ¡MYSQL ¡or ¡Postgress ¡database ¡ ¡ Serves ¡malicious ¡pages ¡and ¡payloads ¡via ¡web ¡server ¡ ¡ Uses ¡Android ¡SDK ¡to ¡custom ¡build ¡agents ¡
SLIDE 25
Gegng ¡SPF ¡
Open ¡source ¡ ¡ ¡ On ¡github ¡ ¡ ¡ git ¡clone ¡h_ps://github.com/georgiaw/ Smartphone-‑Pentest-‑Framework.git ¡
SLIDE 26
Installa>on ¡
B>nstall ¡script ¡will ¡install ¡all ¡Perl ¡dependencies ¡ ¡ ¡ Downloads ¡and ¡installs ¡Android ¡SDK ¡if ¡not ¡ already ¡present ¡ ¡ Sets ¡up ¡database ¡
SLIDE 27
Config ¡File ¡
<SPF ¡folder>/frameworkconsole/config ¡ ¡ Tells ¡SPF ¡what ¡database ¡to ¡use, ¡etc. ¡ ¡ ¡
SLIDE 28
SLIDE 29
Star>ng ¡SPF ¡
¡ <SPF ¡directory>/frameworkconsole/ framework.pl ¡ ¡ ¡
SLIDE 30
Star>ng ¡SPF ¡
./framework.pl ¡ ¡ ¡
SLIDE 31
Mobile ¡Modems ¡
To ¡send ¡mobile ¡a_acks ¡SPF ¡allows ¡you ¡to ¡use ¡the ¡ mobile ¡modems ¡you ¡already ¡own ¡ ¡ Smartphone ¡based ¡app ¡ ¡ USB ¡modem ¡a_ached ¡to ¡SPF ¡machine ¡
SLIDE 32
A_aching ¡SPF ¡to ¡a ¡USB ¡mobile ¡modem ¡
Sakis3g ¡script ¡sets ¡up ¡modem ¡in ¡Linux ¡ ¡ root@bt:~/Desktop# ¡./sakis3g ¡switchonly ¡ Modem ¡switched ¡to ¡1c9e:9603. ¡ ¡ ¡
SLIDE 33
A_aching ¡SPF ¡to ¡a ¡USB ¡mobile ¡modem ¡
spf>4 ¡ ¡ ¡ Choose ¡a ¡type ¡of ¡modem ¡to ¡a_ach ¡to: ¡ ¡1.) ¡Search ¡for ¡a_ached ¡modem ¡ ¡2.) ¡A_ach ¡to ¡a ¡smartphone ¡based ¡app ¡ spf>1 ¡ USB ¡Modem ¡Found ¡ ATZ ¡ OK ¡ Spf> ¡
SLIDE 34
A_aching ¡SPF ¡to ¡a ¡USB ¡mobile ¡modem ¡
Searches ¡for ¡an ¡a_ached ¡modem ¡ ¡ Confirms ¡it ¡can ¡communicate ¡with ¡the ¡modem ¡ via ¡AT ¡commands ¡ ¡ Adds ¡modem ¡to ¡SPF ¡database ¡
SLIDE 35
SLIDE 36
SLIDE 37
SLIDE 38
A_aching ¡SPF ¡to ¡a ¡Phone ¡mobile ¡ modem ¡
App ¡for ¡Android ¡1.6 ¡and ¡above ¡ ¡ So ¡even ¡burner ¡phones ¡will ¡work ¡fine ¡ ¡ App ¡hooks ¡up ¡to ¡SPF ¡and ¡allows ¡it ¡to ¡use ¡the ¡ modem ¡ ¡ ¡
SLIDE 39
SLIDE 40
A_aching ¡SPF ¡to ¡a ¡Phone ¡mobile ¡ modem ¡
Tell ¡SPF ¡the ¡phone ¡number ¡of ¡the ¡phone ¡we ¡will ¡ use ¡(for ¡the ¡database) ¡ ¡ Tell ¡SPF ¡the ¡control ¡key ¡(terrible ¡crypto. ¡I ¡should ¡ really ¡fix ¡this) ¡ ¡ Tell ¡SPF ¡the ¡path ¡on ¡the ¡webserver ¡we ¡want ¡to ¡ use ¡
SLIDE 41
SLIDE 42
A_aching ¡SPF ¡to ¡a ¡Phone ¡mobile ¡ modem ¡
Install ¡the ¡app ¡on ¡your ¡tes>ng ¡phone ¡ ¡ Apk ¡and ¡source ¡are ¡in ¡the ¡ FrameworkAndroidApp ¡folder ¡in ¡the ¡git ¡repo ¡ ¡ Tell ¡the ¡app ¡the ¡IP ¡address ¡to ¡connect ¡to, ¡the ¡ same ¡key ¡and ¡path ¡ ¡
SLIDE 43
SLIDE 44
SLIDE 45
Post ¡Exploita>on ¡Agents ¡
Android ¡permission ¡model ¡based ¡agent ¡ ¡ Android ¡roo>ng ¡agent ¡ ¡ Android ¡network ¡agent ¡for ¡insider ¡threat ¡ ¡
SLIDE 46
Building ¡Agents ¡on ¡the ¡Fly ¡
Choose ¡a ¡template ¡(you ¡can ¡import ¡your ¡own) ¡ ¡ Give ¡SPF ¡the ¡informa>on ¡ ¡Mobile ¡modem ¡number ¡for ¡control ¡ ¡Key ¡ ¡ ¡Web ¡server ¡path ¡
SLIDE 47
SLIDE 48
SLIDE 49
SLIDE 50
SLIDE 51
SLIDE 52
Building ¡Custom ¡Agents ¡
Some ¡templates ¡included ¡in ¡SPF ¡ ¡ Can ¡backdoor ¡any ¡app ¡you ¡have ¡source ¡code ¡for ¡ with ¡SPF ¡agent ¡func>onality ¡ ¡
SLIDE 53
Network ¡A_ack ¡Example ¡
Test ¡for ¡default ¡SSH ¡password ¡on ¡jailbroken ¡ iPhone ¡ ¡ Log ¡in ¡and ¡drop ¡whatever ¡you ¡want ¡ ¡ Post ¡exploita>on ¡agent, ¡Meterpreter ¡
SLIDE 54
SLIDE 55
SLIDE 56
SLIDE 57
SLIDE 58
Client ¡Side ¡Example ¡
Browser ¡vulnerability ¡ ¡ ¡ Get ¡users ¡to ¡browse ¡to ¡my ¡page ¡ ¡ ¡ Get ¡shell ¡
SLIDE 59
SLIDE 60
SLIDE 61
SLIDE 62
SLIDE 63
SLIDE 64
SLIDE 65
SLIDE 66
Client ¡Side ¡A_ack ¡#2 ¡
USSD ¡vulnerability ¡in ¡some ¡Android ¡phones ¡ made ¡big ¡news ¡ ¡ Test ¡your ¡enterprise’s ¡phones ¡with ¡SPF ¡ ¡ Safe ¡(IMEI) ¡and ¡Dangerous ¡(wipe ¡phone) ¡checks ¡
SLIDE 67
SLIDE 68
SLIDE 69
SLIDE 70
SLIDE 71
SLIDE 72
Social ¡Engineering ¡Example ¡
Lure ¡users ¡to ¡malicious ¡websites ¡etc ¡ ¡ SMS ¡is ¡an ¡a_ack ¡vector ¡that ¡is ¡star>ng ¡to ¡be ¡ seen ¡in ¡the ¡wild ¡ ¡ Test ¡if ¡your ¡users ¡will ¡browse ¡to ¡website ¡or ¡even ¡ download ¡apps ¡using ¡SMS ¡
SLIDE 73
Social ¡Engineering ¡Vulnerability ¡ Example ¡
SMS ¡is ¡the ¡new ¡email ¡for ¡spam/phishing ¡a_acks ¡ ¡ “Open ¡this ¡website” ¡“Download ¡this ¡app” ¡ ¡ ¡ Will ¡your ¡users ¡click ¡on ¡links ¡in ¡text ¡messages? ¡ ¡ Will ¡they ¡download ¡apps ¡from ¡3rd ¡par>es? ¡
SLIDE 74
SLIDE 75
SLIDE 76
SLIDE 77
SLIDE 78
SLIDE 79
Agent ¡looks ¡like ¡the ¡normal ¡app ¡ ¡ ¡ With ¡hidden ¡func>onality ¡ ¡ Remotely ¡control, ¡gather ¡informa>on, ¡privilege ¡ escela>on ¡ ¡
SLIDE 80
Interact ¡with ¡SPF ¡agents ¡
A_ach ¡SPF ¡to ¡deployed ¡agents ¡and ¡send ¡them ¡ commands ¡ ¡ Permission ¡apps ¡and ¡root ¡apps ¡
SLIDE 81
SLIDE 82
SLIDE 83
SLIDE 84
SLIDE 85
SLIDE 86
SLIDE 87
Local ¡Vulnerability ¡Example ¡
Smartphones ¡have ¡kernel ¡vulnerabili>es ¡ ¡ Used ¡my ¡jailbreaks ¡and ¡malicious ¡apps ¡ ¡ Use ¡a ¡roo>ng ¡agent ¡to ¡try ¡to ¡install ¡as ¡root ¡or ¡ use ¡with ¡a ¡permission ¡agent ¡
SLIDE 88
SLIDE 89
SLIDE 90
SPF ¡App ¡
Used ¡to ¡a_ach ¡SPF ¡to ¡mobile ¡modem ¡ ¡ Can ¡also ¡perform ¡SPF ¡modem ¡based ¡ func>onality ¡straight ¡from ¡your ¡phone ¡
SLIDE 91
SLIDE 92
SLIDE 93
SLIDE 94
SLIDE 95
Contact ¡Informa>on ¡
¡ ¡ ¡ Georgia ¡Weidman ¡ Founder ¡and ¡CEO, ¡Bulb ¡Security ¡LLC ¡ georgia@bulbsecurity.com ¡ @georgiaweidman ¡ ¡