arrow-left

All pages
gitbookPowered by GitBook
1 of 8

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

misc

Differences

A Java file where some of the bytes have been corrupted to non-printable values. I went through and corrected it:

import java.util.*;
public class DifferenceTest {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter first number: ");
        int num1 = sc.nextInt();
        System.out.print("Enter second number: ");
        int num2 = sc.nextInt();
        int answer = num1 - num2;
        System.out.println("The difference is: " + answer);
    }
}

Then used:

f1 = open('DifferenceTest.java', 'rb').read()
f2 = open('Corrected.java', 'rb').read()
f1 = list(f1)
f2 = list(f2)

for one, two in zip(f1,f2):
    if one != two:
        print(chr(one-two), end='')
print('')

This takes the difference between any non-matching bytes and prints them as ascii

rgbCTF{tr1pl3_m34n1ng}

ye olde prng

We get that the numbers are generated by squaring the number and taking the middle digits or something?

script below:

n = int(input())
print(str(n**2)[50:-50])

hashtag
flag: rgbCTF{d0nt_us3_midd13_squ4r3}

Penguins

we see a .git directory, so we navigate to it, and check out the objects we can decompress all the zlib files with

for f in */*; do python -c "import zlib; print zlib.decompress(open('$f').read());";

one of them has a weird looking string in it: blob 149YXMgeW9kYSBvbmNlIHRvbGQgbWUgInJld2FyZCB5b3UgaSBtdXN0IgphbmQgdGhlbiBoZSBnYXZlIG1lIHRoaXMgLS0tLQpyZ2JjdGZ7ZDRuZ2wxbmdfYzBtbTE3c180cjNfdU5mMHI3dW40NzN9 removing the blob number gets us a b64decodable string, which gets us the flag:

hashtag
rgbctf{d4ngl1ng_c0mm17s_4r3_uNf0r7un473}

Picking Up The Pieces

so basically i grepped for flag format `CTF{`` from here we can simply just follow where the string goes (so use the endpoint of the previous as the next starting point)

135893 137329 287162841 bCTF{
137329 146596 54796009 1m_b
146596 152272 373997764 4d_4

hashtag
rgbCTF{1m_b4d_4t_sh0pp1ng}

Adventure

Similar to the original adventure, the flag is hidden in the easter egg thing of adventure

woa decided to diff the original and the given file, and found that 0xD80 to 0xDD0 changed

I went one step further and found an asm breakdown of the game https://github.com/johnidm/asm-atari-2600/blob/master/adventure.asmarrow-up-right

Which shows the easter egg graphic being hidden here

The easter egg is hidden with the byte being converted to binary, and then being shown with a lit pixel as a 1 and an unlit as a 0

We can then take the differenced bytes and do the same to display the flag

I dont know what the flag is but uhhhhhhhh yeah i read it as

rgbCTF{b4c0n_7nd_3665}

Script below:

hashtag
rgbCTF{b4c0n_7nd_3665}

insert witty algorithm name here

So basically just steal this code go brrr and remove the last 4 checks (since we dont want diagonals).

hashtag
flag: rgbCTF{119609}

https://www.geeksforgeeks.org/find-the-number-of-islands-set-2-using-disjoint-set/?ref=rparrow-up-right
a ="e0 80 80 01 07 e5 a7 60 e0 07 00 80 e7 a1 e3 01 07 60 80 87 84 67 05 07 e0 40 47 44 07 05 e7 80 c0 87 84 07 01 67 40 c0 46 62 03 02 86 e0 a0 e0 00 00 a0 a0 e0 20 20 00 00 e0 80 e0 00 00 e0 a0 a0 a0 e0 00 00 c0 a0 a0 00 00 e0 00 a0 a0 e0 20 20 00 00 c0 a0 a0 00 00 00 00 00 00 00 00 00 00"

a = a.split(" ")
for i in a:
  i = int(i,16)
  b = "{0:b}".format(i)
  c = ("0" * (8 -len(b))) + b
  d = c.replace("1","#")
  print(d.replace("0","-"))

hallo

Dtmf + multi tap phone cipher:

hashtag
rgbctf#yeet#dtmf#tones#