Why would the attackers obfuscate PowerShell
PowerShell is a regular Windows tool, stands on every machine starting with Windows 7. According to the classification MITRE ATT&CK this technique PowerShell (T1059.001, Execution), eh Powershell.exe included in LoLBAS catalog (Living Off The Land...
Navigation: Cross links and call graph
Static analysis of binary files is not a consistent reading of code from top to bottom. These are jumps between functions along the call chain: from a suspicious string to a function that uses it, from the function to the one who calls it.
Crosslinks...
What is Ghidra and why is it needed for the analysis of binary
Ghidra is a free, reversed-down software tool released by the NSA in 2019. Before its introduction, the market of disassemblers held an IDA Pro with the Hex-Rays plugin - a bundle of powerful, but with a price tag that closed the...
PDF Metadata Analysis: Hidden Objects and Streams
PDF is one of the most underrated formats in CTFS. Everyone drives EXIF in pictures, and PDF files in the meantime hide more: embedded files, JavaScript code, hidden objects and invisible text.
ExifTool on PDF. Launch exiftool document.pdf...
What metadata hide in CTF tasks
Metadata — file information embedded in the file itself. Depending on the format, they live in different containers, and each is a potential place for a flag.
EXIF (Exchangeable Image File Format) is the standard for JPEG, TIFF, RAW. Camera model, date of...
GDB analysis of binary file: find offset up to return address
Theoretically offset = buffer size (64) + size RBP (8) = 72 bytes. But the compiler can add an alignment padding or redraw the frame. Therefore, the offset is always tested experimentally. It's a habit that saves debugging hours...
Stack overflow: how data overwrites return address
The stack in x86-64 grows from senior addresses to juniors. When you call the function, the processor creates a stack frame - a stack is placed on the stack return address (the address of the instruction where the management will return after...
Why . NET and Java – the best start in reverse engineering
All Russian-language guides on reverse engineering for beginners start the same: “learn the assembler x86, put Ghidra, open the ELF-binary.” The way is working, but hard – the beginner sees the wall of mov, cmp, jmp and loses motivation...
Operation of SSTI Jinja2: from arithmetic to RCE
Flask Jinja2 vulnerability is the most frequent SSTI scenario on CTF. The problem arises when the developer writes render_template_string(user_input) instead of safe render_template("page.html", name=user_input). In the first case, the user input...
SSTI vs XSS: differences that determine the attack vector
Server-side template injection and XSS start the same way – custom input is displayed on the page. The difference is where the processing takes place. XSS-payload is performed in the victim's browser: the attacker implements JavaScript...
Parsing files and preparing data in bash
The third block of CTF routine is file processing. Download the archive, unpack, find among the hundreds of nested files the one where the flag is hidden. By hand, it takes forever. The Linux command line for CTF solves the task in seconds via the...
Why bash on CTF if there is Python and AutoRecon
Bash is everywhere. There are no stripped CTF containers and minimal Python images, but sh, grep and wget There are even BusyBox. I met tasks where there was nothing in a remote car except sh and awk - and that was enough for full file system...
Overkill of the JWT secret key
hashcat is the main tool for the JWT secret key brother. The regime -m 16500 designed for JWT (covers HS256, HS384, HS512).
echo -n "<JWT_TOKEN>" > jwt.txt && hashcat -a 0 -m 16500 jwt.txt /usr/share/wordlists/rockyou.txt
Flag -a 0 - dictionary attack. At the...
Where to search for JWT and what to check first
JWT is a three-part string separated by points: header.payload.signature. Each part is encoded in base64url. The token is hidden in one of four places: cookies (names jwt, token, session, auth), the title Authorization: Bearer <token>, URL...