Picker

Picker I

AUTHOR: LT 'SYREAL' JONES

Description

This service can provide you with a random number, but can it do anything else?

Connect to the program with netcat:$ nc saturn.picoctf.net <port> The program's source code can be downloaded herearrow-up-right.

Solution

The program takes in user input and passed is to eval => eval(user_input + '()').

The function which seems interesting is win. It prints flag characters as hex.

  75def win():
  76# This line will not work locally unless you create your own 'flag.txt' in
  77#   the same directory as this script
  78   │   flag = open('flag.txt', 'r').read()
  79#flag = flag[:-1]
  80   │   flag = flag.strip()
  81   │   str_flag = ''
  82for c in flag:
  83   │     str_flag += str(hex(ord(c))) + ' '
  84print(str_flag)
  85
circle-check

Picker II

Description

Can you figure out how this program works to get the flag?

Connect to the program with netcat: $ nc saturn.picoctf.net <port> The program's source code can be downloaded herearrow-up-right.

Solution

Since win is filtered from user input we have to improvise. We could have said ==> print(open('flag.txt').read()), but what if we didn't know the filename? I decided to pop a shell and cat the flag. (A bit overkill)

circle-check
circle-info

You can use Flatlinerarrow-up-right app to turn python code into one liners.

Picker III

Description

Can you figure out how this program works to get the flag?

Connect to the program with netcat: $ nc saturn.picoctf.net <port> The program's source code can be downloaded herearrow-up-right.

Solution

From reset_table we know what functions we can execute using indexes. write_variable looks interesting. If we overwrite func_table with the payload we can get flag.

I was fiddling around to spawn a shell, but couldnt. So final payload is:

circle-check

Picker IV

Description

Can you figure out how this program works to get the flag?

Connect to the program with netcat: $ nc saturn.picoctf.net <port> The program's source code can be downloaded herearrow-up-right. The binary can be downloaded herearrow-up-right.

Analysis

The main program takes in address and then makes a call to function at that address. The function which we should jump into (in this case) is win function.

Basic checks usin checksec (from pwntools)

chevron-rightArch: amd64-64-littlehashtag

Arch: `amd64-64-little` refers to the architecture of the binary, indicating that it is compiled for the AMD64 (x86-64) architecture, which is commonly used in 64-bit systems.

chevron-rightRELRO: Partial RELROhashtag

RELRO: `Partial RELRO` refers to the Relocation Read-Only (RELRO) protection. RELRO is a security feature that aims to protect against certain types of attacks, such as the Global Offset Table (GOT) overwrite attack. `Partial RELRO` means that only certain parts of the binary's relocation table are marked as read-only, providing partial protection.

chevron-rightStack: No canary foundhashtag

Stack: `No canary found` indicates that there is no stack canary present in the binary. A stack canary is a security mechanism used to detect stack-based buffer overflows. Its absence may make the program more vulnerable to such attacks.

chevron-rightNX: NX enabledhashtag

NX: `NX enabled` refers to the No-Execute (NX) or Execute Disable (XD) protection, which is a hardware feature that prevents executing code from regions of memory marked as data. With NX enabled, it is more difficult for attackers to execute arbitrary code in areas that should only contain data, helping to prevent certain types of exploits.

chevron-rightPIE: No PIE (0x400000)hashtag

PIE: `No PIE (0x400000)` indicates that the binary is not Position Independent Executable (PIE). PIE is a security feature that randomizes the base address of the executable in memory, making it harder for attackers to predict memory addresses and exploit certain vulnerabilities.

Since PIE is disabled it means local binary and remote binary have the same exact memory addresses.

Solution

circle-check

Last updated