HTB Santa CTF 2022
Toy Workshop [ Web ]

Homepage

The homepage had nothing intresting
Source Code
/web_toy_workshop/challenge/routes/index.js
So we have to send our query ( json data ) in
/api/submitIt's a XSS
Solution
I used python3 http server with ngrok ( appended the link in )
Flag
After you sent the the POST request to the website, It will use the query and store it in it's database, and retrive the flag ( cookie ) for us
Start the python3 server , use ngrok , update the query

Common Mistake [ Crypto ]

Challenge files
Hex values
Integer values
Solution
The encryption flag has 2 modulus with same flag ( message )
The attack used to get the flag is
Common Modulus AttackLearn more about this attack : https://infosecwriteups.com/rsa-attacks-common-modulus-7bdb34f331a5
Solve.py
Giftwrap [ Reversing ]

This is day 2 challenge
Binary Info
by using strings we get to know the binary is compressed by UPX
What is UPX ?
UPX achieves an excellent compression ratio and offers very fast decompression. Your executables suffer no memory overhead or other drawbacks for most of the formats supported, because of in-place decompression
Decompressing the binary
Analyzing Binary
The binary is a typical crackme challenge
Let's boot up the binary in ghidra
Main function
Each character of the user input is
xoredwith0xf3
After xoring the value ( xored input ) is compared with
CHECKvariable
Solution
Let's the data stored in
CHECKvariable
Let's store the
CHECKvalues locally andxorit with0xf3to get flag
solve.py
Flag
Mr Snowy [ Pwn ]

Solution
Checksec

The
NXis enabled which makes the stack unexecutabbleTHe
PIEis disabled so we dont have to find the addressThe binary is just a simple bufferoverflow
Functions of the binary has

Main function

The main funciton after executing calls 3 functions , let's checkout the snowman function
It's quiet difficult to do the task only with asm , I've used Ghidra which has a feature of converting ( almost same ) asm back to the original C code
Snowman Function
This code is basically the first part

When option
1is selected it calls antoher funtion :investigate()
Inverstigate Function
There's another function named deactivate camera
deactivate cameraOverflow
So we basically have to find the offset in investigation function, overflow it and set the
$rip( Instruction pointter ) todeactivate_camerafunctionFind OFFSET
Set breakpoint at
exitininvestigate()[ address of exit : 0x00000000004013ea ] and create a pattern to find offset

Run the program , give option
1to go ininvestigatefunction

This is how stack will look when we hit our breakpoint


So the OFFSET is 72
Exploit
Send buffer of 72 characters
Add the addresss of
deactivate camerafunctionSend the payload and get the flag
Solve.py
Flag

baby APT [ Forensics ]

Note
This is unintended way to do the challenge
Solution
Strings command showed some HTTP requets

URL encoded
URL decoded
Flag
Last updated