transparent botnet control for smartphones over sms...example payloads spam creating sms-send pdus...

47
© Georgia Weidman 2011 1 Transparent Botnet Control for Smartphones over SMS Georgia Weidman

Upload: others

Post on 10-Jan-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 1

Transparent Botnet Control for Smartphones over SMS

Georgia Weidman

Page 2: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 2

Why Smartphone Botnets?

Nearly 62 million smartphones sold in Q2 2010

Development is similar to standard platformsAndroid = LinuxiPhone = OSXWindows Mobile = Windows

Technical specs not as good as top of the line desktops. They are capable and improving rapidly.

Page 3: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 3

Why SMS C&C?

Battery Management: IP runs down battery quickly

Fault Tolerant: If SMS fails it will queue and retry

Difficult for security researchers to monitor

Page 4: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 4

How an SMS is sent and received

Page 5: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 5

How an SMS is sent and received

Page 6: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 6

How an SMS is sent and received

Page 7: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 7

How an SMS is sent and received

Page 8: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 8

How an SMS is sent and received

Page 9: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 9

How an SMS is sent and received

Page 10: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 10

How an SMS is sent and received

Page 11: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 11

How an SMS is sent and received

Page 12: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 12

How an SMS is sent and received

Page 13: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 13

How an SMS is sent and received

Page 14: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 14

Previous Work: SMS Fuzzing

At Blackhat 2009, Charlie Miller & Collin Mulliner

proxied the application layer and modem to crash

smartphones with SMS.

http://www.blackhat.com/presentations/bh-usa-09/MILLER/BHUSA09-Miller-FuzzingPhone-PAPER.pdf

Page 15: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 15

Previous Work: SMS Fuzzing

Page 16: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 16

Previous Work: SMS Fuzzing

Page 17: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 17

Previous Work: SMS Fuzzing

Page 18: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 18

My Work: SMS Botnet C&C

Page 19: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 19

My Work: SMS Botnet C&C

Page 20: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 20

SMS-Deliver PDU

Field ValueLength of SMSC 07

Type of Address (SMSC) 91Service Center Address (SMSC) 41 40 54 05 10 F1SMS Deliver Info 04Length of Sender Number 0BType of Sender Number 91Sender Number 51 17 34 45 88 F1Protocol Identifier 00Data Coding Scheme 00Time Stamp 01 21 03 71 40 04 4AUser Data Length 0AUser Data E8 32 9B FD 46 97 D9 EC 37

07914140540510F1040B916117345476F100000121037140044A0AE8329BFD4697D9EC37

http://www.dreamfabric.com/sms/

Page 21: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 21

SMS-Deliver PDU

Field ValueLength of SMSC 07Type of Address (SMSC) 91Service Center Address (SMSC) 41 40 54 05 10 F1SMS Deliver Info 04Length of Sender Number 0BType of Sender Number 91Sender Number 61 17 34 54 76 F1Protocol Identifier 00Data Coding Scheme 00Time Stamp 01 21 03 71 40 04 4AUser Data Length 0AUser Data E8 32 9B FD 46 97 D9 EC 37

07914140540510F1040B916117345476F100000121037140044A0AE8329BFD4697D9EC37

Page 22: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 22

How the Botnet Works

1. Bot Receives Message

2. Bot Decodes User Data

3. Bot Checks for Bot Key

4. Bot Performs Payload Functionality

Page 23: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 23

How It Works

1. Bot Receives MessageBot receives all communication from modemIf SMS (code CMT) continue analysisIf not SMS pass up to user space

2. Bot Decodes User Data

3. Bot Checks for Bot Key

4. Bot Performs Payload Functionality

Page 24: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 24

How It Works

1. Bot Receives Message

2. Bot Decodes User DataMoves through PDU to User DataDecode 7 bit GSM to plaintext

3. Bot Checks for Bot Key

4. Bot Performs Payload Functionality

Page 25: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 25

How It Works

1. Bot Receives Message

2. Bot Decodes User Data

3. Bot Checks for Bot KeyBot checks for secret key in messageIf bot message continue analysis and swallows message (user never sees it)If not bot message passed to user space

4. Bot Performs Payload Functionality

Page 26: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 26

How It Works1. Bot Receives Message

2. Bot Decodes User Data

3. Bot Checks for Bot Key

4. Bot Performs Payload Functionality Bot reads functionality request in message

If found perform functionalityIf not found fail silently

Page 27: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 27

Botnet Structure

Page 28: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 28

Master Bot

Page 29: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 29

Master Bot Handled by botherders

Switched out regularly to avoid detection Prepay SIM Cards + Kleptomania

In charge of bot structure

Sends instructions to Sentinel Bots

Page 30: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 30

Sentinel Bots

Page 31: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 31

Sentinel Bots

Several “trustworthy” long infected bots

Receive instructions from master bot

Pass on instructions to a set of slave bots

Page 32: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 32

Slave Bots

Page 33: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 33

Slave Bots

Receive instructions from sentinel bots

No direct contact with master bots

Carry out botnet payload functionality (DDOS, SPAM, etc.)

Page 34: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 34

Robustness

Master Bot:May change device, platform, SIM at will Prepayed phones are difficult to trackHas knowledge of all active bots

Sentinel Bots:Reserved for long time bots The only bots that interact directly with the masterMaster may promote any slave when needed

Slave Bots: A compromise results in at most finding the identity of a single sentinel

Page 35: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 35

Security Concerns

Impersonation:Use cryptographic keys to authenticate master bot and sentinel bots

Replay:SMS timestamps Sequence numbers/ one time keys

Elliptic Curve Algorithm

Page 36: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 36

Limitations

Possibility of detection from phone bills

User Data is limited to 160 characters (instructions and keys must fit in this space)

On some platforms only the modem knows the phone number

Page 37: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 37

Getting The Bot Installed

Regular Users:App + Local Root Exploit (Sendpage etc.)Example: John Oberheide's Twilight Android Botnet Defcon Skytalks 2010

Root-level/Jailbroken Users:Root level app using proxy function for AWESOME + Bot Example: flashlight + tether for iPhone

Remote:Remote root exploit (rooted and nonrooted)Example: iKee-B “Duh” Worm for iPhone

Page 38: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 38

Example PayloadsSpam

Creating SMS-Send PDUs and passing them to the modem Example: SMS ads

DDOSMillions of smartphones vs. a server

Loading New Functionality Send URL in payloadDownload the module into known payloads

Degrading GSM serviceOverloading the network with bogus requests

Page 39: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 39

What This Really Means

If attackers can get the bot installed they can remotely control a user's phone without giving any sign of compromise to the user.

Page 40: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 40

Mitigation

Integrity checks of base smartphone operating systems

Liability for smartphone applications including root level

User awareness

Page 41: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 41

Parallel Research:

Rise of the iBots: Owning a Telco NetworkCollin Mulliner and Jean-Pierre Seifert

SMS/P2P hybrid smartphone botnet research

iPhone based

http://mulliner.org/collin/academic/publications/ibots_malware10_mulliner_seifert.pdf

Page 42: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 42

DEMO : )

Android Bot with SMS Spam Payload

Released code has the bot without payloads (have fun)

Page 43: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 43

To Mom for helping me master stuff like this:

char* encodedmessage;encodedmessage = malloc(13);encodedmessage = hellogeorgia;

Thanks

Page 44: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 44

Contact

Georgia Weidman Email: [email protected]: http://www.grmn00bs.comTwitter: vincentkadmon

Slides and Code are on the website

Page 45: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 45

Selected Bibliography

SMS fuzzing: http://www.blackhat.com/presentations/bh-usa-09/MILLER/BHUSA09-Miller-FuzzingPhone-PAPER.pdfCell bots attack GSM core: http://www.patrickmcdaniel.org/pubs/ccs09b.pdfTwilight botnet: http://jon.oberheide.org/files/summercon10-androidhax-jonoberheide.pdfSMS/P2P iPhone bots: http://mulliner.org/collin/academic/publications/ibots_malware10_mulliner_seifert.pdf

Page 46: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 46

False Starts: User Header Data

User Header Data (UHD) is just ahead of User Data in a PDU

Tells the phone how to handle the SMS (ex. Concatenated message)

Previous security research found faws in how these are handled resulting in compromises

Page 47: Transparent Botnet Control for Smartphones over SMS...Example Payloads Spam Creating SMS-Send PDUs and passing them to the modem Example: SMS ads DDOS Millions of smartphones vs. a

© Georgia Weidman 2011 47

False Starts: User Header Data

Not all UHD codes are used

Planned to use unused codes for bot instruction indicators

This worked fine with fuzzers and emulators

SMSCs drop PDUs with unused codes. UHD based bots are not usable in the wild

Some used codes are also dropped