├── README.md ├── DCTF ├── Get Admin │ ├── flag.png │ └── README.md └── Message │ ├── README.md │ └── message.txt ├── 34C3 - JuniorsCTF ├── kim │ ├── demo.png │ ├── kimSolve.py │ ├── kim.py │ ├── README.md │ └── hlextend.py ├── dotr │ ├── demo.png │ ├── dotr.py │ ├── dotrSolve.py │ └── README.md └── nohtyp │ ├── images │ ├── edit1.png │ ├── edit2.png │ └── edit3.png │ ├── modified.py │ ├── nohtyp.py │ ├── README.md │ └── solve.py ├── b00t2root '18 └── Teleport │ ├── demo.png │ ├── teleportSolve.py │ ├── teleport.py │ └── README.md ├── 3DSCTF └── Capo Di Tutti Capi │ ├── images │ ├── demo.png │ ├── list.png │ ├── list2.png │ ├── list3.png │ └── page1.png │ ├── solve.py │ └── README.md ├── CSAW Quals 2018 ├── Take an L │ ├── description.pdf │ ├── README.md │ └── tiling.py └── Algebra │ ├── README.md │ └── algebra.py ├── Google CTF 2018 ├── JS Safe 2.0 │ ├── images │ │ ├── img0.png │ │ ├── img1.png │ │ ├── img2.png │ │ ├── img3.png │ │ ├── img4.png │ │ ├── img5.png │ │ ├── img6.png │ │ └── challenge.png │ ├── js_safe.py │ ├── js_safe_2.html │ └── README.md └── Shall We Play a Game? │ ├── app.apk │ ├── modded.apk │ ├── images │ ├── mod.jpg │ ├── fail.jpg │ ├── flag.jpg │ ├── game.png │ ├── smali.png │ └── challenge.png │ ├── GameActivity.java │ ├── README.md │ └── Modded_GameActivity.smali ├── CSAW Finals 2018 └── Disastrous Security Apparatus │ ├── images │ ├── warning.png │ └── challenge.png │ ├── solve.py │ ├── main.py │ ├── README.md │ └── cracker.py ├── RCTF └── Number Game │ ├── README.md │ └── solve.py ├── b00t2root '19 └── Xorxery │ ├── xorxery.py │ └── solve.py └── CSAW Finals 2017 └── LuPiN ├── solve.py ├── README.md └── lpn_chal.py /README.md: -------------------------------------------------------------------------------- 1 | # ctf-write-ups 2 | Capture The Flag Write-ups 3 | -------------------------------------------------------------------------------- /DCTF/Get Admin/flag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/DCTF/Get Admin/flag.png -------------------------------------------------------------------------------- /34C3 - JuniorsCTF/kim/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/34C3 - JuniorsCTF/kim/demo.png -------------------------------------------------------------------------------- /34C3 - JuniorsCTF/dotr/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/34C3 - JuniorsCTF/dotr/demo.png -------------------------------------------------------------------------------- /b00t2root '18/Teleport/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/b00t2root '18/Teleport/demo.png -------------------------------------------------------------------------------- /34C3 - JuniorsCTF/nohtyp/images/edit1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/34C3 - JuniorsCTF/nohtyp/images/edit1.png -------------------------------------------------------------------------------- /34C3 - JuniorsCTF/nohtyp/images/edit2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/34C3 - JuniorsCTF/nohtyp/images/edit2.png -------------------------------------------------------------------------------- /34C3 - JuniorsCTF/nohtyp/images/edit3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/34C3 - JuniorsCTF/nohtyp/images/edit3.png -------------------------------------------------------------------------------- /3DSCTF/Capo Di Tutti Capi/images/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/3DSCTF/Capo Di Tutti Capi/images/demo.png -------------------------------------------------------------------------------- /3DSCTF/Capo Di Tutti Capi/images/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/3DSCTF/Capo Di Tutti Capi/images/list.png -------------------------------------------------------------------------------- /3DSCTF/Capo Di Tutti Capi/images/list2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/3DSCTF/Capo Di Tutti Capi/images/list2.png -------------------------------------------------------------------------------- /3DSCTF/Capo Di Tutti Capi/images/list3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/3DSCTF/Capo Di Tutti Capi/images/list3.png -------------------------------------------------------------------------------- /3DSCTF/Capo Di Tutti Capi/images/page1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/3DSCTF/Capo Di Tutti Capi/images/page1.png -------------------------------------------------------------------------------- /CSAW Quals 2018/Take an L/description.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/CSAW Quals 2018/Take an L/description.pdf -------------------------------------------------------------------------------- /Google CTF 2018/JS Safe 2.0/images/img0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/Google CTF 2018/JS Safe 2.0/images/img0.png -------------------------------------------------------------------------------- /Google CTF 2018/JS Safe 2.0/images/img1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/Google CTF 2018/JS Safe 2.0/images/img1.png -------------------------------------------------------------------------------- /Google CTF 2018/JS Safe 2.0/images/img2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/Google CTF 2018/JS Safe 2.0/images/img2.png -------------------------------------------------------------------------------- /Google CTF 2018/JS Safe 2.0/images/img3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/Google CTF 2018/JS Safe 2.0/images/img3.png -------------------------------------------------------------------------------- /Google CTF 2018/JS Safe 2.0/images/img4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/Google CTF 2018/JS Safe 2.0/images/img4.png -------------------------------------------------------------------------------- /Google CTF 2018/JS Safe 2.0/images/img5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/Google CTF 2018/JS Safe 2.0/images/img5.png -------------------------------------------------------------------------------- /Google CTF 2018/JS Safe 2.0/images/img6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/Google CTF 2018/JS Safe 2.0/images/img6.png -------------------------------------------------------------------------------- /Google CTF 2018/Shall We Play a Game?/app.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/Google CTF 2018/Shall We Play a Game?/app.apk -------------------------------------------------------------------------------- /Google CTF 2018/JS Safe 2.0/images/challenge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/Google CTF 2018/JS Safe 2.0/images/challenge.png -------------------------------------------------------------------------------- /Google CTF 2018/Shall We Play a Game?/modded.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/Google CTF 2018/Shall We Play a Game?/modded.apk -------------------------------------------------------------------------------- /Google CTF 2018/Shall We Play a Game?/images/mod.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/Google CTF 2018/Shall We Play a Game?/images/mod.jpg -------------------------------------------------------------------------------- /Google CTF 2018/Shall We Play a Game?/images/fail.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/Google CTF 2018/Shall We Play a Game?/images/fail.jpg -------------------------------------------------------------------------------- /Google CTF 2018/Shall We Play a Game?/images/flag.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/Google CTF 2018/Shall We Play a Game?/images/flag.jpg -------------------------------------------------------------------------------- /Google CTF 2018/Shall We Play a Game?/images/game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/Google CTF 2018/Shall We Play a Game?/images/game.png -------------------------------------------------------------------------------- /Google CTF 2018/Shall We Play a Game?/images/smali.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/Google CTF 2018/Shall We Play a Game?/images/smali.png -------------------------------------------------------------------------------- /Google CTF 2018/Shall We Play a Game?/images/challenge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/Google CTF 2018/Shall We Play a Game?/images/challenge.png -------------------------------------------------------------------------------- /CSAW Finals 2018/Disastrous Security Apparatus/images/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/CSAW Finals 2018/Disastrous Security Apparatus/images/warning.png -------------------------------------------------------------------------------- /CSAW Finals 2018/Disastrous Security Apparatus/images/challenge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AdityaVallabh/ctf-write-ups/HEAD/CSAW Finals 2018/Disastrous Security Apparatus/images/challenge.png -------------------------------------------------------------------------------- /CSAW Quals 2018/Algebra/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Algebra - 200 4 | 5 | ### Are you a real math wiz? 6 | 7 | nc misc.chal.csaw.io 9002 8 | 9 | ## Solution: 10 | 11 | Script: [algebra.py](./algebra.py) 12 | -------------------------------------------------------------------------------- /CSAW Quals 2018/Take an L/README.md: -------------------------------------------------------------------------------- 1 | # Take an L - 200 2 | 3 | ### Fill the grid with L's but avoid the marked spot for the W 4 | 5 | 6 | nc misc.chal.csaw.io 9000 7 | 8 | The origin is at (0,0) on the top left 9 | 10 | 11 | [description.pdf](./description.pdf) 12 | 13 | ## Solution 14 | 15 | Script: [tiling.py](./tiling.py) 16 | -------------------------------------------------------------------------------- /RCTF/Number Game/README.md: -------------------------------------------------------------------------------- 1 | # Number Game - 206 Points 2 | 3 | ### Guess Guess Guess 4 | 5 | Server: nc 149.28.139.172 10002 6 | 7 | ## Solution: 8 | 9 | Script: [solve.py](./solve.py) 10 | 11 | Bruteforce the input using alphanumeric characters. Then play the old game of [Cows and Bulls](https://en.wikipedia.org/wiki/Bulls_and_Cows) 8 times to get the flag! 12 | 13 | The code to play the game was found here: [Cows and Bulls Solution](https://rosettacode.org/wiki/Bulls_and_cows/Player#Python) 14 | -------------------------------------------------------------------------------- /34C3 - JuniorsCTF/dotr/dotr.py: -------------------------------------------------------------------------------- 1 | import random 2 | 3 | 4 | def encrypt(msg, key): 5 | keylen = len(key) 6 | k = [x[1] for x in sorted(zip(key[:keylen], range(keylen)))] 7 | 8 | m = '' 9 | for i in k: 10 | for j in range(i, len(msg), keylen): 11 | m += msg[j] 12 | 13 | return m 14 | 15 | 16 | 17 | m = input() 18 | while True: 19 | k = [random.randrange(256) for _ in range(16)] # generate 2 keys 20 | if len(k) == len(set(k)): 21 | break 22 | 23 | m = encrypt(m, k[:8]) 24 | m = encrypt(m, k[:8]) 25 | 26 | print(m) 27 | 28 | -------------------------------------------------------------------------------- /34C3 - JuniorsCTF/kim/kimSolve.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import hlextend 3 | 4 | base = "http://35.198.133.163:1337/files/" 5 | sha = hlextend.new('sha1') 6 | 7 | for saltLen in range(13, 20, 1): 8 | print("Attempting with len(SECRET)= " + str(saltLen)) 9 | 10 | query = sha.extend('&f=flag', "f=sample.gif", saltLen, "952bb2a215b032abe27d24296be099dc3334755c") 11 | umac = sha.hexdigest() 12 | 13 | query = repr(query).replace("\\\\x","%")[1:-1] 14 | url = base + umac + "/?" + query 15 | r = requests.get(url) 16 | 17 | # if no redirect, success! 18 | if(url == r.url): 19 | print("Hash found!\n") 20 | print("Url: " + url) 21 | print("\nFlag: " + r.text) 22 | break 23 | -------------------------------------------------------------------------------- /34C3 - JuniorsCTF/nohtyp/modified.py: -------------------------------------------------------------------------------- 1 | 2 | addXor=lambda x,y:x+(y^21) 3 | printResult = {False: lambda: print('Almost!!'), True: lambda: print('Correct!')} 4 | 5 | # l = reverse of the given list 6 | l = [160,155,208,160,190,215,237,134,210,126,212,222,224,238,128,240,164,213,183,192,162,178,163,162][::-1] 7 | 8 | 9 | def check(flag): 10 | 11 | if 'mo4r' in flag and '34C3_' in flag and flag.split('_')[3] == 'tzzzz': 12 | revFlag = flag[::-1] 13 | ascFlag = list(map(ord,flag)) 14 | ascRevFlag = list(map(ord,flag)) 15 | 16 | if [addXor(*pair) for pair in zip(ascFlag, ascRevFlag)] == l: 17 | return True 18 | 19 | return False 20 | 21 | flag = input() 22 | printResult[check(flag)]() 23 | -------------------------------------------------------------------------------- /34C3 - JuniorsCTF/nohtyp/nohtyp.py: -------------------------------------------------------------------------------- 1 | ____=input;__________________=print;___________=____();_________=map;__________=ord;_______________=zip;____________________________=list;___=21;_____=lambda ______,_______:______+(_______^___);______________={not not not ___ and not not ___:lambda:__________________('\x41\x6c\x6d\x6f\x73\x74\x21\x21'),not not ___ and not not ___:lambda:__________________('\x43\x6f\x72\x72\x65\x63\x74\x21')};______________[[_____(*________) for ________ in _______________(____________________________(_________(__________,___________)),____________________________(_________(__________,___________))[::-1])][::-1]==[160,155,208,160,190,215,237,134,210,126,212,222,224,238,128,240,164,213,183,192,162,178,163,162] and 'mo4r' in ___________ and '34C3_' in ___________ and ___________.split('_')[3] == 'tzzzz']() 2 | 3 | -------------------------------------------------------------------------------- /CSAW Quals 2018/Algebra/algebra.py: -------------------------------------------------------------------------------- 1 | import sympy 2 | from sympy.solvers import solve 3 | from pwn import remote 4 | 5 | def find(a): 6 | X = sympy.Symbol('X') 7 | left, right = a.split('=') 8 | eqn = left + '-(' + right + ')' 9 | try: 10 | sol = solve(eval(eqn), X)[0] 11 | except: 12 | sol = 0 13 | return str(eval(str(sol))) 14 | 15 | def recv(sh): 16 | return sh.recvline().decode('ascii')[:-1] 17 | 18 | def main(): 19 | sh = remote('misc.chal.csaw.io', 9002) 20 | print(recv(sh)); print(recv(sh)); print(recv(sh)); print(recv(sh)); print(recv(sh)); print(recv(sh)) 21 | i = 0 22 | while True: 23 | i += 1 24 | print(recv(sh)) 25 | data = recv(sh) 26 | print(sh.recv().decode('ascii')) 27 | print(data) 28 | if 'flag' in data: 29 | break 30 | r = find(data) 31 | print(r) 32 | sh.sendline(r) 33 | print('Solved: ' + str(i)) 34 | 35 | if __name__ == '__main__': 36 | main() -------------------------------------------------------------------------------- /34C3 - JuniorsCTF/dotr/dotrSolve.py: -------------------------------------------------------------------------------- 1 | 2 | import itertools 3 | 4 | def dec(ctxt, key): 5 | groups = [] 6 | i = 0 7 | 8 | # split the ctxt into 8 groups 9 | for k in range(8): 10 | grp = [] 11 | tmp = 0 12 | if key[k] < len(ctxt)%8: tmp = 1 13 | for j in range(int(len(ctxt)/8) + tmp): 14 | grp += [ctxt[i+j]] 15 | groups += [grp] 16 | i += j+1 17 | 18 | # arrange the letters wrt key 19 | m = ['*']*len(ctxt) 20 | for k in range(8): 21 | i = 0 22 | for j in range(key[k], len(ctxt), 8): 23 | m[j] = groups[k][i] 24 | i += 1 25 | 26 | return ''.join(m) 27 | 28 | ctxt = "03_duCbr5e_i_rY_or cou14:L4G f313_Th_etrph00 Wh03UBl_oo?n07!_e" 29 | allPossibleKeys = list(itertools.permutations([0, 1, 2, 3, 4, 5, 6, 7])) 30 | print('Possible Flags: ') 31 | 32 | # bruteforce the key 33 | for key in allPossibleKeys: 34 | m = dec(ctxt, key) 35 | m = dec(m, key) 36 | if "34C3_" in m: 37 | print(m) 38 | -------------------------------------------------------------------------------- /34C3 - JuniorsCTF/kim/kim.py: -------------------------------------------------------------------------------- 1 | from bottle import route, run, template, request, redirect, static_file 2 | import hashlib 3 | SECRET = "hello" 4 | 5 | INDEX = '

Download a sample here!' 6 | FILES = '