35
#root via SMS 4G IP access security assessment

#root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

Embed Size (px)

Citation preview

Page 1: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

#root via SMS

4G IP access security assessment

Page 2: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

Meanwhile somewhere else

Sergey @scadasl Gordeychik

Alex @arbitrarycode Zaitsev

Gleb @repdet Gritsai

Dmitry @_Dmit Sklarov

Dmitry Kurbatov

Sergey Puzankov

Pavel Novikov

http://scadasl.org

Page 3: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

the Evil

Page 4: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

Brazil 228

China 162

India 34

Colombia 14

USA 13

Japan 13

Malaysia 10

Kuwait 9

Germany 9

UAE 7

Page 5: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

Attacks

� GGSN PWN

� GPRS attacks

� DoS

� Information leakage

� Fraud

� APN guessing

Page 6: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

Example: GTP “Synflood”

http://blog.ptsecurity.com/2013/09/inside-mobile-internet-security.html http://bit.ly/195ZYMR

Page 7: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

Guter Weg um ist nie krumm

� All old IP stuff

� traces 1.1.1.1/10.1.1.1

� IP source routing

� Management ports

� All new IP stuff

� IPv6

� MPTCP

� Telco specific (GTP, SCTP M3UA, DIAMETER etc)

http://ubm.io/11K3yLT https://www.thc.org/thc-ipv6/

Page 8: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

Here There Be Tygers

Page 9: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

1990th

� Your balance is insufficient

� Connect to your favorite UDP VPN

Page 10: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

Resume

� For telcos

� Please scan all your Internets!

� Your subscribers network is not your internal network

� For auditors

� Check all states

� online/blocked/roaming

� Check all subscribers

� APN’s, subscribers plans

� Don’t hack other subscribers

http://www.slideshare.net/phdays/how-to-hack-a-telecommunication-company-and-stay-alive-gordeychik/32

Page 11: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

The Device

Page 12: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

6month’s homework: NSA at home

� You can rent the modem for 1 week

� You can use RCE and CSRF for local remote infection of the system

� Return it

� You can spy with opensource products (http://opencellid.org/ etc) via CellID and WiFi

� You can intercept HTTP/HTTPS via DNS spoofing

� Maybe more?

� Do not hack other subscribers!

Page 13: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

I’m watching you…

Page 14: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

Stat (1 week of detecting)

Modem Vulnerabilities Total

A RCE CSRF XSS WiFi Access 1411

B RCE CSRF XSS 1250

C RCE CSRF 1409

D ”Unvulnerable” 946

�1 step to 5000+ infected modems

Page 15: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

It still in USB!

Page 16: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

It still in (bad) USB!

https://srlabs.de/blog/wp-content/uploads/2014/07/SRLabs-BadUSB-BlackHat-v1.pdf

Page 17: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

USB gadgets & Linux

• drivers/usb/gadget/*

• Composite framework

– allows multifunctional gadgets

– implemented in composite.c

Page 18: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

Android gadget driver

• Implemented in android.c

• Composite driver wrapper with some UI

• /sys/class/android_usb/android0

– enabled

– functions

– Class/Protocol/SubClass etc.

– List of supported functions

• Your favorite phone can become audio_sourceinstead of mass storage

Page 19: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

What about HID device?

• Patch kernel, compile, flash new kernel =>

BORING!!!

Page 20: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

What about HID device?

• Android gadget driver works with

supported_functions

• We can patch it in runtime!

– Add new hid function in supported_functions

array

– Restart device

– …

– PROFIT

Page 21: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

Sad Linux

• By default kernel doesn’t have g_hid support

• Hard to build universal HID driver for different

versions

– vermagic

– Function prototypes/structures changes over time

– Different CPU

• Vendors have a hobby – rewrite kernel at

unexpected places

• Fingerprint device before hack it!

Page 22: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

DEMO

Page 23: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

Some Huawei

― Hisilicon hi6920― ARM― Linux box― Stack overflow― Remote firmware upload

Page 24: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

Unexpected VxWorks

― dmesg― [000003144ms] his_modem_load_vxworks:164:

>>loading:vxworks.....

Page 25: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

Baseband reversing

― Стек сетевых протоколов• ASN1 hell• Много 3GPP

― RTOS― Сложный дебаг

Page 26: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

VxWorks on baseband

― Загружается Linux’ом― Запакован на одном из разделов― dmesg => load vxworks ok, entey 0x50d10000― CShell

• Взаимодействие с ОС• Встроенный отладчик

― Имена всех практически всех объектов― POSIX + документация

Page 27: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other
Page 28: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

Resume

� For telcos

� All your 3/4G modems/routers are 5/\>< belong to us

� For everybody

� Please don’t plug computers into your USB

� Even if it your harmless network printer 4G modem

Page 29: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

The Chip

Page 30: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

DEMO

Page 31: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

So?

� Traffic decryption only takes 2 binary messages

� DoS takes 13 binary messages and can be done via SMS gate

� There are valuable SMS-packages. Catch the deal.

� There are also USSDs…

Page 32: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

“What a girl to do?”

� Change PIN, maybe…

� Run SIMTester!

� Use PSTN FTW:(

� Pigeon mail anyone?

Page 33: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

“What a girl to do?”

� Change PIN, maybe…

� Run SIMTester!

� Use PSTN FTW:(

� Pigeon mail anyone?

Page 34: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

Resume

� For telcos

� Check all your SIMs

� Train your/contractor of SIM/App/Sec

� For everybody

� Pray

Page 35: #root via SMS - WordPress.com · #root via SMS 4G IP access security assessment. Meanwhile somewhere else Sergey @scadasl Gordeychik Alex @arbitrarycode Zaitsev ... Don’t hack other

Thanks!