Rating:

### Streams
>>>
70 points
White noise is useful whether you are trying to sleep, relaxing, or concentrating on writing papers. Find some natural white noise [here](https://streams.2019.chall.actf.co/).

Note: The flag is all lowercase and follows the standard format (e.g. actf{example_flag})

Author: ctfhaxor
>>>

1. https://streams.2019.chall.actf.co/ contains some images and a video stream
2. Initially tried `youtube-dl` and other stream downloaders with no luck
2. view source > download mp4 file
3. `file stream.mp4` reveals it is a xml MPD document
4. MPD contains data about MPEG DASH streams -- namely mpeg **streams** [^1]
5. There seem to be a total of three streams as seen on line 38 `<AdaptationSet id="2"`:

`id=0` video `id=1` audio `id=2` audio
6. By using devtools > network we can see that init streams and chunks of both stream 0 and stream 1 are being downloaded:
![stream1](2019/assets/img/stream1.png)
7. I simply followed the URI of these and replaced the names with `stream2` e.g. https://streams.2019.chall.actf.co/video/chunk-stream2-00001.m4s and https://streams.2019.chall.actf.co/video/init-stream2.m4s

8. All 9 stream2 chunks and 1 init stream were downloaded (all `.m4s` files)
9. Use this nifty one liner[^2] to piece these chunks together

```bash
cat init-stream2.m4s *.m4s > stream2.wav
```
10. This is morse code :zap:
11. After trying a few online audio decoders for morse code I gave up and did it by hand. I used audiacity to find the waveform and figure out the dashes and dots. Plugged it into an [online decoder](https://morsecode.scphillips.com/labs/decoder/)
![stream2](2019/assets/img/stream2.png)

12. flag :triangular_flag_on_post:

```
actf{f145h_is_d34d_l0n9_l1v3_mp39_d45h}
```

Original writeup (https://gitlab.com/drsh0/ctf-writeups/blob/master/2019/%C3%A5ngstromCTF.md#streams).