├── 9447 CTF 2015 └── The real flag finder │ ├── flagFinderRedux │ ├── redux.rr2 │ └── solve.py ├── Atenea CTF ├── Counter │ ├── Counter-d060ed1dd46ee60319b7013d2b65f186.exe │ └── README.md ├── Crackme- if you can... │ └── README.md ├── Saint Seiya │ ├── README.md │ ├── Saint_Seiya-3db53d5cf73c57e698c0687738404478.exe │ └── dissas.PNG ├── Spear Phising... Can you catch me │ └── README.md └── WannaCry │ ├── README.md │ └── wannacry.exe ├── CSAW 2016 └── Gametime │ ├── Captura.PNG │ ├── README.md │ └── gametime.exe ├── Defcamp CTF Qualifications 2015 └── entry-language-100 │ ├── r100 │ ├── r100patch │ ├── r100patch.rr2 │ └── solve.py ├── Flare-On 2018 └── Ultimate Minesweeper │ ├── Captura.PNG │ ├── README.md │ ├── Solve │ └── Program.cs │ └── UltimateMinesweeper.exe ├── H4CK1T CTF 2016 └── Crypt00perator │ ├── crypt0_0perator.py │ └── crypt0_0perator_56e0a9f07f54b3634ab5cc2b30e5b29e.exe ├── Hack The Box ├── Find The Easy Pass │ ├── EasyPass.exe │ ├── README.md │ ├── output.PNG │ └── solve.7z └── Impossible Password │ ├── README.md │ ├── impossible_password.bin │ └── out.png ├── Hacklu CTF 2018 └── Baby Reverse │ ├── estimate.py │ └── public │ ├── chall │ └── notes ├── HoneyCON CTF 2018 ├── Basic Conditional Decision │ └── rev3 ├── Brute Me │ ├── rev4 │ └── solve.py └── Ultra Secure Bank Login │ └── reto5 ├── INSTRUO CTF 2018 └── Tez Bano Tez │ ├── rev150 │ ├── rev150.rr2 │ ├── rev_patch │ └── solve.py ├── InCTF 2018 └── Decoy │ ├── Decoy.exe │ └── README.md ├── LICENSE ├── Malware Data Science └── ch1 │ ├── README.md │ ├── fakepdfmalware.exe │ ├── fakeword.exe │ └── ircbot.exe ├── Navarra Lan Party CTF 2018 ├── In time │ ├── in-time │ ├── intime.rr2 │ └── solve_intime.py └── Key is the key │ ├── keyisthekey.bin │ ├── keyisthekey_patch │ └── reverse.py ├── PatataCTF └── Angry Potato │ ├── angry-potato │ └── reverse.py ├── Practical Malware Analysis Lab ├── Lab01-01 │ ├── Lab01-01.dll │ ├── Lab01-01.exe │ ├── README.md │ └── recon-lab1-1.py └── Lab01-02 │ ├── Lab01-02.exe │ ├── README.md │ ├── Unpacked_Lab01-02.exe │ └── recon-lab1-2.py ├── README.md ├── State machine └── Ret0 │ ├── Ret0.zip │ └── keygen.py ├── X-MAS CTF 2019 ├── LAST_XMAS └── main ├── babyrevjohnson └── main ├── basic.asm ├── entropy ├── entropy └── solver.py ├── r2con2018 ├── disqualified │ ├── disqualified │ ├── disqualified.rr2 │ └── solve.py ├── forceme │ ├── forceme │ ├── reverse-brute.py │ └── reverse.py ├── psv │ ├── psv │ └── solve.py └── scrabble │ ├── reverse-brute.py │ ├── reverse.py │ └── scrabble └── whats-a-rune ├── chall.py ├── main-chall.go └── the /9447 CTF 2015/The real flag finder/flagFinderRedux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/9447 CTF 2015/The real flag finder/flagFinderRedux -------------------------------------------------------------------------------- /9447 CTF 2015/The real flag finder/redux.rr2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/rarun2 2 | program=./flagFinderRedux 3 | arg1="AAAA" 4 | 5 | -------------------------------------------------------------------------------- /9447 CTF 2015/The real flag finder/solve.py: -------------------------------------------------------------------------------- 1 | import r2pipe 2 | 3 | r = r2pipe.open("./flagFinderRedux") 4 | r.cmd('e dbg.profile=redux.rr2') 5 | r.cmd('doo') # initially you are debugging rarun2 6 | r.cmd("db 0x00400729") #We realize with debugging that the flag is store at this memory address in stack... 7 | r.cmd('dc') 8 | flag = r.cmdj('pxj@rax') 9 | chrlist = [] 10 | for x in range(len(flag)): 11 | chrlist.append(chr(int(flag[x]))) 12 | if chr(int(flag[x])) == "}": 13 | print (chr(27) + "[0;33m" + "\tFlag: "+"".join(chrlist)+chr(27) + "[0m") 14 | break 15 | -------------------------------------------------------------------------------- /Atenea CTF/Counter/Counter-d060ed1dd46ee60319b7013d2b65f186.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Atenea CTF/Counter/Counter-d060ed1dd46ee60319b7013d2b65f186.exe -------------------------------------------------------------------------------- /Atenea CTF/Counter/README.md: -------------------------------------------------------------------------------- 1 | Packed .NET dnspy is your friend :) 2 | -------------------------------------------------------------------------------- /Atenea CTF/Crackme- if you can.../README.md: -------------------------------------------------------------------------------- 1 | # TL;TR 2 | Challenge
3 | We start finding interesting strings at first. After we realize that the program receive 2 arguments looking at stack memory 3.
4 | So if we put 2 arguments jle conditional doesn’t jump. Next we need path program to jnz conditional. Cool, after we enter in a function that retrieve the name of our computer in memory stack ebp-204h.
5 | We see a loop that compare our first argument with the name of our computer if it is correct go to ret and continue the program, if not exit. Next we see other important function because in this, compare the second argument and do some aritmetics operations for calculate the password. So the second argument is the password to solve this baby challenge. So --> crypt0.exe name_pc password.
6 | When our eip register retrieve cmp instruction to compare, we realize that the value of edx register is 0x4e so this is the correct first byte of password and ecx register is just our first char of second argument.
7 | So in the second lap we see that our second argument was just “N” or 0x4e and don’t put anything more so our ecx register is 0x0, but edx register is the second byte of password great!! We win then :)
8 | flag{TRY_BRO} 9 | 10 | 11 | -------------------------------------------------------------------------------- /Atenea CTF/Saint Seiya/README.md: -------------------------------------------------------------------------------- 1 | ![texto cualquiera por si no carga la imagen](https://github.com/naivenom/reversing-list/blob/master/Atenea%20CTF/Saint%20Seiya/dissas.PNG) 2 | -------------------------------------------------------------------------------- /Atenea CTF/Saint Seiya/Saint_Seiya-3db53d5cf73c57e698c0687738404478.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Atenea CTF/Saint Seiya/Saint_Seiya-3db53d5cf73c57e698c0687738404478.exe -------------------------------------------------------------------------------- /Atenea CTF/Saint Seiya/dissas.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Atenea CTF/Saint Seiya/dissas.PNG -------------------------------------------------------------------------------- /Atenea CTF/Spear Phising... Can you catch me/README.md: -------------------------------------------------------------------------------- 1 | Windows Defender is your friend :/ 2 | Challenge 3 | -------------------------------------------------------------------------------- /Atenea CTF/WannaCry/README.md: -------------------------------------------------------------------------------- 1 | Baby challenge :) 2 | -------------------------------------------------------------------------------- /Atenea CTF/WannaCry/wannacry.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Atenea CTF/WannaCry/wannacry.exe -------------------------------------------------------------------------------- /CSAW 2016/Gametime/Captura.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/CSAW 2016/Gametime/Captura.PNG -------------------------------------------------------------------------------- /CSAW 2016/Gametime/README.md: -------------------------------------------------------------------------------- 1 | # TL;TR 2 | We just need after playing the game is patch instruction to jz when we got failed and jumping to the success instead. Also it would be nice set a breakpoint after the conditional jump. 3 | ![texto cualquiera por si no carga la imagen](https://github.com/naivenom/reversing-list/blob/master/CSAW%202016/Gametime/Captura.PNG) 4 | -------------------------------------------------------------------------------- /CSAW 2016/Gametime/gametime.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/CSAW 2016/Gametime/gametime.exe -------------------------------------------------------------------------------- /Defcamp CTF Qualifications 2015/entry-language-100/r100: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Defcamp CTF Qualifications 2015/entry-language-100/r100 -------------------------------------------------------------------------------- /Defcamp CTF Qualifications 2015/entry-language-100/r100patch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Defcamp CTF Qualifications 2015/entry-language-100/r100patch -------------------------------------------------------------------------------- /Defcamp CTF Qualifications 2015/entry-language-100/r100patch.rr2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/rarun2 2 | program=./r100patch 3 | stdin="Code_" 4 | stdout= 5 | -------------------------------------------------------------------------------- /Defcamp CTF Qualifications 2015/entry-language-100/solve.py: -------------------------------------------------------------------------------- 1 | import r2pipe 2 | 3 | r = r2pipe.open("./r100patch") 4 | r.cmd('e dbg.profile=r100patch.rr2') 5 | r.cmd('doo') # initially you are debugging rarun2 6 | r.cmd('db 0x00400771') 7 | r.cmd('dc') 8 | #print r.cmd('drj') 9 | def step(): 10 | r.cmd('ds') 11 | r.cmd('sr rip') 12 | while True: 13 | list_ = [] 14 | disass = [] 15 | try: 16 | if r.cmdj('drj')["rip"] == 4196212: 17 | break 18 | except TypeError: 19 | print("No more RIP instruction, breaking loop") 20 | break 21 | print (chr(27) + "[1;36m" + "[+] STAGE 1 - SOLVE: Lenght of password is 11 = 0xb" + chr(27) + "[0m") 22 | while True: 23 | instruction = r.cmdj('pdj 1')[0] 24 | try: 25 | if r.cmdj('drj')["rip"] == 4196212: 26 | key = r.cmdj('drj')["rax"] 27 | print(key) 28 | password = key-1 29 | print(r.cmd('drj')) 30 | print (chr(27) + "[0;33m" + "\tSUB Operation EDX-EAX and flag value: " +chr(password)+chr(27) + "[0m") 31 | list_.append(chr(password)) 32 | except TypeError: 33 | print("No more RIP instruction, breaking loop") 34 | break 35 | if instruction['type'] == 'cmp eax, 1': 36 | if r.cmdj('drj')['rax'] == 1: 37 | continue 38 | else: 39 | break 40 | step() 41 | -------------------------------------------------------------------------------- /Flare-On 2018/Ultimate Minesweeper/Captura.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Flare-On 2018/Ultimate Minesweeper/Captura.PNG -------------------------------------------------------------------------------- /Flare-On 2018/Ultimate Minesweeper/README.md: -------------------------------------------------------------------------------- 1 | ![texto cualquiera por si no carga la imagen](https://github.com/naivenom/reversing-list/blob/master/Flare-On%202018/Ultimate%20Minesweeper/Captura.PNG) 2 | -------------------------------------------------------------------------------- /Flare-On 2018/Ultimate Minesweeper/Solve/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Ultimate_Minesweeper 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | uint grid = 30u; //VALLOC_NODE_LIMIT 14 | uint VALLOC_TYPE_HEADER_PAGE = 4294966400u; 15 | uint VALLOC_TYPE_HEADER_POOL = 4294966657u; 16 | uint VALLOC_TYPE_HEADER_RESERVED = 4294967026u; 17 | uint DeriveVallocType(uint r, uint c) 18 | { 19 | return ~(r * grid + c); 20 | } 21 | uint[] VALLOC_TYPES = new uint[3] 22 | { 23 | VALLOC_TYPE_HEADER_PAGE, 24 | VALLOC_TYPE_HEADER_POOL, 25 | VALLOC_TYPE_HEADER_RESERVED 26 | }; 27 | for (uint num = 0u; num < grid; num += 1u) 28 | { 29 | for (uint num2 = 0u; num2 < grid; num2 += 1u) 30 | { 31 | bool flag = true; 32 | uint row = num + 1u; 33 | uint colm = num2 + 1u; 34 | if (VALLOC_TYPES.Contains(DeriveVallocType(row, colm))) 35 | { 36 | flag = false; 37 | Console.WriteLine("FLAG--> Row:" + row + " Column:" + colm); 38 | Console.ReadLine(); 39 | } 40 | } 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Flare-On 2018/Ultimate Minesweeper/UltimateMinesweeper.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Flare-On 2018/Ultimate Minesweeper/UltimateMinesweeper.exe -------------------------------------------------------------------------------- /H4CK1T CTF 2016/Crypt00perator/crypt0_0perator.py: -------------------------------------------------------------------------------- 1 | def main_(): 2 | ea = idc.ScreenEA() 3 | print "0x%x %s" % (ea,ea) 4 | 5 | 6 | def debug_(addr): 7 | idc.RunTo(BeginEA()) 8 | idc.AddBpt(addr) #breakpoint 004016D5 9 | idc.GetDebuggerEvent(WFNE_SUSP,-1) 10 | idc.RunTo(addr) 11 | 12 | 13 | def help_(): 14 | print("""Functions: 15 | debug_(addr) 16 | recon() 17 | solve()""") 18 | 19 | def recon(): 20 | stdin = "abcdefghijklmnopqrstuvwxyz01234567890{}" 21 | GetDebuggerEvent(WFNE_SUSP, -1) 22 | rax = idc.GetRegValue('RAX') 23 | print("[+] Value of RAX is: %s "%rax) 24 | cipher = idc.GetString(rax) 25 | print("[+] Value of Substitution cipher is: %s "%cipher) 26 | sc = Strings() 27 | for s in sc: 28 | if s.ea == 4661280: 29 | print "%x: len=%d type=%d --> '%s'" % (s.ea, s.length, s.type, str(s)) 30 | key = str(s) 31 | print("[+] Value of Key: %s"%key) 32 | flag = '' 33 | for i in key: 34 | try: 35 | flag += stdin[cipher.index(i)] 36 | print(flag) 37 | except ValueError: 38 | pass 39 | def solve(): 40 | stdin = "abcdefghijklmnopqrstuvwxyz01234567890{}" 41 | cipher = "fedcba`onmlkjihwvutsrqp_~}76543210?>|z" 42 | key = "o3dl6s|41a42344d110746d574e35c2f77ab6>3z" 43 | flag = '' 44 | for i in key: 45 | flag += stdin[cipher.index(i)] 46 | print(flag) 47 | 48 | if __name__ == '__main__': 49 | #main_() 50 | #debug_(addr) 51 | #recon() 52 | #solve() 53 | help_() 54 | -------------------------------------------------------------------------------- /H4CK1T CTF 2016/Crypt00perator/crypt0_0perator_56e0a9f07f54b3634ab5cc2b30e5b29e.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/H4CK1T CTF 2016/Crypt00perator/crypt0_0perator_56e0a9f07f54b3634ab5cc2b30e5b29e.exe -------------------------------------------------------------------------------- /Hack The Box/Find The Easy Pass/EasyPass.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Hack The Box/Find The Easy Pass/EasyPass.exe -------------------------------------------------------------------------------- /Hack The Box/Find The Easy Pass/README.md: -------------------------------------------------------------------------------- 1 | # Output 2 | ![texto cualquiera por si no carga la imagen](https://github.com/naivenom/reversing-list/blob/master/Hack%20The%20Box/Find%20The%20Easy%20Pass/output.PNG) 3 | 4 | # Solve 5 |

 6 | [+] Value of EDX: 
 7 | 0xAAAAAAA
 8 | [+] Your password is: AAAAAAA
 9 | 
10 | -------------------------------------------------------------------------------- /Hack The Box/Find The Easy Pass/output.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Hack The Box/Find The Easy Pass/output.PNG -------------------------------------------------------------------------------- /Hack The Box/Find The Easy Pass/solve.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Hack The Box/Find The Easy Pass/solve.7z -------------------------------------------------------------------------------- /Hack The Box/Impossible Password/README.md: -------------------------------------------------------------------------------- 1 | # Output 2 | ![texto cualquiera por si no carga la imagen](https://github.com/naivenom/reversing-list/blob/master/Hack%20The%20Box/Impossible%20Password/out.png) 3 | -------------------------------------------------------------------------------- /Hack The Box/Impossible Password/impossible_password.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Hack The Box/Impossible Password/impossible_password.bin -------------------------------------------------------------------------------- /Hack The Box/Impossible Password/out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Hack The Box/Impossible Password/out.png -------------------------------------------------------------------------------- /Hacklu CTF 2018/Baby Reverse/estimate.py: -------------------------------------------------------------------------------- 1 | import random 2 | import sys 3 | import r2pipe 4 | import time 5 | 6 | '''profile: chall.rr2 7 | #!/usr/bin/rarun2 8 | program=./chall 9 | stdin="AAAA" 10 | stdout= 11 | ''' 12 | r = r2pipe.open("./chall") 13 | r.cmd('e dbg.profile=chall.rr2') 14 | r.cmd('doo') # initially you are debugging rarun2 15 | r.cmd('db 0x0040008e') 16 | r.cmd('dc') 17 | print r.cmd('drj') 18 | print (chr(27) + "[0;33m" + "[+]Key: "+chr(27) + "[0m") 19 | key = r.cmdj('pxj 46@%s'%0x0040010c) 20 | print(key) 21 | key_value = 10 22 | 23 | def check_key(key): 24 | char_sum = 0 25 | for c in key: 26 | char_sum += ord(c) 27 | sys.stdout.write("{0:3} | {1} \r".format(char_sum, key)) 28 | sys.stdout.flush() 29 | return char_sum 30 | 31 | timeout = time.time()+1 32 | print (chr(27) + "[1;36m" + "[+] STAGE 1 - RECON: Estimate first values" + chr(27) + "[0m") 33 | while True: 34 | test = 0 35 | if test == 1 or time.time() > timeout: 36 | break 37 | a = "" 38 | a += random.choice("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_!{}") 39 | b = "" 40 | b += random.choice("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_!{}") 41 | rand_a = check_key(a) 42 | rand_b = check_key(b) 43 | 44 | 45 | xored = rand_a ^ rand_b 46 | if key_value == xored: 47 | print (chr(27) + "[0;33m" + "\n\tEstimate values: %s, %s "%(chr(rand_a),chr(rand_b))+chr(27) + "[0m") 48 | test = test-1 49 | 50 | print (chr(27) + "[1;36m" + "[+] STAGE 2 - SOLVE" + chr(27) + "[0m") 51 | input_zero = raw_input("Input[0]>>>") 52 | input_one = raw_input("Input[1]>>>") 53 | input_n = ord(input_one) 54 | flag = [] 55 | for i in range(len(key)-1): 56 | input_n = key[i+1]^input_n 57 | flag.append(chr(input_n)) 58 | print("".join(input_zero)+"".join(input_one)+"".join(flag)) 59 | 60 | ''' 61 | 62 | 108 | l 63 | Estimate values: f, l 64 | 70 | F 65 | Estimate values: L, F 66 | 90 | Z 67 | Estimate values: P, Z 68 | 113 | q 69 | Estimate values: {, q 70 | [+] STAGE 2 - SOLVE 71 | Input[0]>>>f 72 | Input[1]>>>l 73 | flag{Yay_if_th1s_is_yer_f1rst_gnisrever_flag!} 74 | ''' 75 | -------------------------------------------------------------------------------- /Hacklu CTF 2018/Baby Reverse/public/chall: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Hacklu CTF 2018/Baby Reverse/public/chall -------------------------------------------------------------------------------- /Hacklu CTF 2018/Baby Reverse/public/notes: -------------------------------------------------------------------------------- 1 | Hey there, future Reverser! 2 | 3 | We created this small challenge to introduce you to reversing. This task might _still_ take quite some time, but trust us, it will be very rewarding! 4 | We sadly can't spoonfeed you, but we created a set of questions which you might want to answer yourself. We expect you to google on your own and find resources. 5 | 6 | Sooo, lets get started! 7 | 8 | - What kind of binary have you got infront of you? (Hint: "file" command) 9 | - How can you disassemble the file? (objdump, gdb, radare...) 10 | - Which programs are common debuggers? 11 | - How can I use them? (we recommend gdb with the peda plugin) 12 | - - how can I set breakpoints? 13 | - - in which different ways can I step through programs? 14 | - - how can I print/examine the content of memory/addresses 15 | - what is inside registers? what's rax, rip, rsp? 16 | - what is the linux syscall convention? 17 | - - In which register is the second argument? 18 | - - In which register is the syscall number? 19 | - - - where can I find the syscall numbers on my own linux system? 20 | - what happens at a call instruction? 21 | - how can I compare strings in assembly? 22 | - .. ask your teammates for more! annoy them if anything is unclear :P 23 | - .. if you don't got any teammates, use IRC and say that it's about the baby challenge 24 | 25 | There is a lot of work ahead of you, and maybe some sleepless nights with a lot of googling - but it will be worth it;-)! 26 | We are certain that with a dedicated mind you can solve this task and from there on you'll be ready for a bright future! 27 | Don't give up, we all have been there. Stick to it and you'll be rewarded =) 28 | -------------------------------------------------------------------------------- /HoneyCON CTF 2018/Basic Conditional Decision/rev3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/HoneyCON CTF 2018/Basic Conditional Decision/rev3 -------------------------------------------------------------------------------- /HoneyCON CTF 2018/Brute Me/rev4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/HoneyCON CTF 2018/Brute Me/rev4 -------------------------------------------------------------------------------- /HoneyCON CTF 2018/Brute Me/solve.py: -------------------------------------------------------------------------------- 1 | import random 2 | import sys 3 | def check_key(key): 4 | char_sum = 0 5 | for c in key: 6 | char_sum += ord(c) 7 | sys.stdout.write("{0:3} | {1} \r".format(char_sum, key)) 8 | sys.stdout.flush() 9 | return char_sum 10 | 11 | key = "" 12 | 13 | while True: 14 | key += random.choice("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_") 15 | s = check_key(key) 16 | key_= [13,60,15,72,30,87,48] 17 | xor = [] 18 | leak = [68,99,87,120] 19 | suma1 = 0 20 | suma2 = 0 21 | for b in range(len(leak)): 22 | suma1+=leak[b] 23 | if s > 666: 24 | key = "" 25 | elif s==666: 26 | if len(key[0:3])== 3: 27 | for x in range(len(key[0:3])): 28 | try: 29 | leak.append(ord(key[x])) 30 | suma1+= ord(key[x]) 31 | except IndexError: 32 | pass 33 | for i in range(len(key_)): 34 | xor.append(leak[i] ^ key_[i]) 35 | suma2 += xor[i] 36 | charr = '' 37 | if suma2 == 569 and suma1 ==666: 38 | for v in range(len(xor)): 39 | charr+=chr(xor[v]) 40 | print "Localizado una clave valida: {0}".format(charr) 41 | 42 | else: 43 | pass 44 | -------------------------------------------------------------------------------- /HoneyCON CTF 2018/Ultra Secure Bank Login/reto5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/HoneyCON CTF 2018/Ultra Secure Bank Login/reto5 -------------------------------------------------------------------------------- /INSTRUO CTF 2018/Tez Bano Tez/rev150: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/INSTRUO CTF 2018/Tez Bano Tez/rev150 -------------------------------------------------------------------------------- /INSTRUO CTF 2018/Tez Bano Tez/rev150.rr2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/rarun2 2 | program=./rev_patch 3 | stdin= 4 | stdout= 5 | -------------------------------------------------------------------------------- /INSTRUO CTF 2018/Tez Bano Tez/rev_patch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/INSTRUO CTF 2018/Tez Bano Tez/rev_patch -------------------------------------------------------------------------------- /INSTRUO CTF 2018/Tez Bano Tez/solve.py: -------------------------------------------------------------------------------- 1 | import r2pipe 2 | 3 | #r = r2pipe.open( 4 | #filename='', flags=['-d', 'rarun2', 'program=psv', 'stdin="r2con{"']) 5 | r = r2pipe.open("./rev_patch") 6 | r.cmd('e dbg.profile=rev150.rr2') 7 | r.cmd('doo') # initially you are debugging rarun2 8 | r.cmd('db 0x0040069a') 9 | r.cmd('dc') 10 | print r.cmd('drj') 11 | def step(): 12 | r.cmd('ds') 13 | r.cmd('sr rip') 14 | while True: 15 | list_ = [] 16 | disass = [] 17 | while True: 18 | instruction = r.cmdj('pdj 1')[0] 19 | disass.append(instruction['opcode']) 20 | if instruction['opcode'] == 'mov edx, ecx': 21 | print("[+]RCX Value: "+r.cmd('dr rcx')) 22 | value = r.cmdj('drj')["rcx"] 23 | list_.append(chr(value)) 24 | print("".join(list_)) 25 | 26 | step() 27 | -------------------------------------------------------------------------------- /InCTF 2018/Decoy/Decoy.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/InCTF 2018/Decoy/Decoy.exe -------------------------------------------------------------------------------- /InCTF 2018/Decoy/README.md: -------------------------------------------------------------------------------- 1 | # Write-up - Decoy 2 | We open the binary with IDA and we realize that the binary gets an input from stdin. Also the input password needs a 44 lenght value so we start with something like that aaaaaaaaaaabbbbbbbbbbbcccccccccccddddddddddd. We set a breakpoint here 0x0040341F and patch this instruction with jnz.
3 | After the fgets function call we will analyze important functions. 4 | ## sub_4018D9 5 | We are in this part of lenght bbbbbbbbbbb because of this instruction movzx eax, byte ptr [eax] move 0x62 byte. 6 | Here cmp dl, al we realize that this compare with the first byte of hardcoded key (mv|GLp+Gv+ xored, with our input byte xored two times so we need resolve this: 7 |
input[0] = ?
 8 | xor1 = 0xb
 9 | xor2 = 0x13
10 | al = 0x28
11 | 
12 | The first input should be 0x30 or 0 if we want that this comparation is equal to al register. After all iteration we will have 0und_Th3_n3 so we have currently this --> aaaaaaaaaaa0und_Th3_n3cccccccccccddddddddddd 13 | 14 | ## sub_401AB9 15 | Next part we enter in this function and we realize that corresponds to the first part of the flag as it uses aaaaaaaaaaa. 16 | In this instruction cmp bl, al we see that this compare with the first byte of hardcoded key }[2waHmrgxj with our input 0x61 + two bytes, so this 0x63. Also with + four bytes after sixth iteration. We need resolve this: 17 |
0x63-0x2 = 0x61 (our input)
18 | 0x7d-0x2 = 0x7b or { (correct input)
19 | 
20 | We get {Y0u_Finctf and the correct will be inctf{Y0u_F. We have currently this --> inctf{Y0u_F0und_Th3_n3cccccccccccddddddddddd
21 | In sub_4018A0 function we enter into and we realize that there is an IsDebuggerPresent so we just need patch the instruction with jnz. 22 | 23 | ## sub_401E73 24 | Next function we see that correspond with this part of lenght password ddddddddddd. 25 | In this code we need that eax register will be 0 after strncmp function call. 26 |
lea     eax, [ebp+var_2A]
27 | mov     [esp+48h+Str2], eax ; Str2
28 | lea     eax, [ebp+var_1F]
29 | mov     [esp+48h+Str1], eax ; Str1
30 | call    strncmp
31 | mov     [ebp+var_14], eax
32 | 
33 | Str1 is hardcoded string {`I5z%u5dL~ and Str2 is our input 0x64 + one byte, so this 0x65. 34 |
0x65-0x1 = 0x64 (our input)
35 | 0x7b-0x1 = 0x7a or z (correct input)
36 | 
37 | The string will be z_H4y$t4cK}. We have currently this --> inctf{Y0u_F0und_Th3_n3cccccccccccz_H4y$t4cK} 38 | 39 | ## sub_4024C3 40 | In last function we see that our input starts from the end towards the beginning so we replace this part ccccccccccc with ABCDEFGHIJK. To resolve this problem we have a key 7D 15 41 1E 70 39 66 55 39 5D 6E and other xored value: 41 |
First:
42 | 0x4a+0x1 = 0x4b (our input)
43 | 0x7d-0x1 = 0x7c or | (correct input)
44 | Second:
45 | xor = 0x4b^0x7d                               #0x4b = input and 0x7d second value of key.
46 | R= 0x15^0x7d = 0x68 or h (correct input)      #0x15 third value of key.
47 | Third:
48 | xor = 0x49^0x15                               #0x49 = input and 0x15 third value of key.
49 | R= 0x41^0x15 = 0x54 or T (correct input)      #0x41 third value of key.
50 | And so on...
51 | 
52 | Finally we get this string value 3dl3_In_Th| so the flag is: inctf{Y0u_F0und_Th3_n33dl3_In_Th|z_H4y$t4cK}
53 | PKTeam 54 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /Malware Data Science/ch1/README.md: -------------------------------------------------------------------------------- 1 | Code and Data 2 | -------------------------------------------------------------------------------- /Malware Data Science/ch1/fakepdfmalware.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Malware Data Science/ch1/fakepdfmalware.exe -------------------------------------------------------------------------------- /Malware Data Science/ch1/fakeword.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Malware Data Science/ch1/fakeword.exe -------------------------------------------------------------------------------- /Malware Data Science/ch1/ircbot.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Malware Data Science/ch1/ircbot.exe -------------------------------------------------------------------------------- /Navarra Lan Party CTF 2018/In time/in-time: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Navarra Lan Party CTF 2018/In time/in-time -------------------------------------------------------------------------------- /Navarra Lan Party CTF 2018/In time/intime.rr2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/rarun2 2 | program=./in-time 3 | stdin="flag{AAAAAAAAAAAAAAAA}" 4 | stdout= 5 | -------------------------------------------------------------------------------- /Navarra Lan Party CTF 2018/In time/solve_intime.py: -------------------------------------------------------------------------------- 1 | import r2pipe 2 | import sys 3 | 4 | def lenght(value): 5 | for i in value[:]: 6 | if i == 0: 7 | value.remove(i) 8 | return value 9 | 10 | #SYM.TR1 FUNCTION 11 | def symtr1(msg): 12 | list_ = [] #mov rax, qword obj.msg 13 | for i in range(len(msg)): #mov rdi, rax 14 | xor = msg[i] ^ 22 #call sym.imp.strlen 15 | list_.append(xor) #xor eax, ebx 16 | return list_ 17 | 18 | #SYM.TR2 + SWEETENED ESTIMATE TIME #lea rdx, obj.j 19 | def sweetened(xored,values,key): #movzx ecx, byte [rax + rdx] 20 | list_flag = [] #mov eax, dword obj.tiempo 21 | list_estimate = [] #add eax, eax 22 | for i in range(len(values)): #lea rdx, obj.t 23 | for b in range(44): #movzx eax, byte [rax + rdx] 24 | c = values[i] ^ key[b] #xor ecx, eax 25 | if xored[i] == c: 26 | list_flag.append(c) 27 | list_estimate.append(key[b]) 28 | break 29 | return list_flag[:-2],list_estimate[:-2] 30 | 31 | 32 | if __name__ == "__main__": 33 | 34 | r = r2pipe.open("./in-time") 35 | r.cmd('e dbg.profile=intime.rr2') 36 | r.cmd('doo') #initially you are debuggign rarun2 37 | r.cmd('db main') #Random memory address code so setting bp in main 38 | r.cmd('dc') 39 | rip = r.cmdj('drj')['rip'] 40 | bp = rip+139 #distance from main to offset we want to continue 41 | r.cmd('db %s'%hex(bp)) 42 | r.cmd('dc') 43 | 44 | print (chr(27) + "[1;36m" + "[+] STAGE 1 - RECON: Getting final value, key and initial xored with input" + chr(27) + "[0m") 45 | final_values = rip+11654 #distance from main to obj.s offset. We know that this obj is the final values to cmp with sym.imp.strcmp my obj.j xored 46 | 47 | print("[+] Final values:") 48 | print(r.cmd('px 24@%s'%hex(final_values))) 49 | values = r.cmdj('pxj 24@%s'%hex(final_values)) 50 | values_ = lenght(values) 51 | lenght_values = len(values_) 52 | 53 | print (chr(27) + "[0;33m" + "\tLenght of final values is exactly: "+str(lenght_values)+chr(27) + "[0m") 54 | 55 | raw_key = rip+11718 #distance from main to obj.t offset. This key is xored with xored lenght input value. 56 | print("[+] Key:") 57 | print(r.cmd('px 50@%s'%hex(raw_key))) 58 | key = r.cmdj('pxj 50@%s'%hex(raw_key)) 59 | key_ = lenght(key) 60 | lenght_key = len(key_) 61 | 62 | print (chr(27) + "[0;33m" + "\tLenght of key is exactly: "+str(lenght_key)+chr(27) + "[0m") 63 | 64 | input_password = rip+11942 #distance from main to obj.msg offset. This key is our input password via stdin. 65 | print("[+] Our stdin:") 66 | print(r.cmd('px 50@%s'%hex(input_password))) 67 | passwd = r.cmdj('pxj 50@%s'%hex(input_password)) 68 | passwd_ = lenght(passwd) 69 | lenght_passwd = len(passwd_) 70 | 71 | print (chr(27) + "[0;33m" + "\tLenght of our input: "+str(lenght_passwd)+chr(27) + "[0m") 72 | if lenght_passwd != lenght_values: 73 | print("[!] Error: Our input value has to be 22 of lenght and you put: %s"%str(lenght_passwd)) 74 | sys.exit(1) 75 | r.quit() 76 | print("[+] Final values: %s"%values_) 77 | print (chr(27) + "[1;36m" + "[+] STAGE 2 - ESTIMATED TIME: We estimate the time because of the frecuency key index used, using as example flag{ format" + chr(27) + "[0m") 78 | xored_input = symtr1(passwd_) 79 | print("[+] Xored input with input lenght: %s"%xored_input) 80 | estimated = sweetened(xored_input,values_,key_) 81 | print("[+] Valid Xored values: %s"%estimated[0]) 82 | tohex = [] 83 | est_ = estimated[1] 84 | for i in range(len(est_)): 85 | hex_ = hex(est_[i]) 86 | tohex.append(hex_) 87 | print("[+] Valid key values: %s"%estimated[1]+"~"+"".join(str(tohex))) 88 | hex_key = [] 89 | print("[+] Hex list key values reference:") 90 | for i in range(len(key_)): 91 | hex_key.append(hex(key_[i])) 92 | print(hex_key) 93 | print (chr(27) + "[0;33m" + "\tTo SOLVE XOR Operation: Final values ^ Valid key values = xored_input^0x16"+chr(27) + "[0m") 94 | -------------------------------------------------------------------------------- /Navarra Lan Party CTF 2018/Key is the key/keyisthekey.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Navarra Lan Party CTF 2018/Key is the key/keyisthekey.bin -------------------------------------------------------------------------------- /Navarra Lan Party CTF 2018/Key is the key/keyisthekey_patch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Navarra Lan Party CTF 2018/Key is the key/keyisthekey_patch -------------------------------------------------------------------------------- /Navarra Lan Party CTF 2018/Key is the key/reverse.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import time 3 | def time_sweetened(): 4 | b = time.strftime("%M",time.gmtime()) 5 | sweetened = int(b)+65 6 | return sweetened 7 | 8 | #SYM.Y FUNCTION 9 | def symy(key): 10 | key_list = [] 11 | try: 12 | key0 = 0xc9 ^ 0x91 13 | key0 = chr(key0) 14 | if key[0] == key0 and int(key[1]) in range(0,10): 15 | key_list.append(key0) 16 | key2 = 0x70 ^ 0x32 17 | key2 = chr(key2) 18 | if key[2] == key2 and int(key[3]) in range(0,10): 19 | key_list.append(key2) 20 | key5 = 0x94 ^ 0xce 21 | key5 = chr(key5) 22 | if key[5] == key5 and int(key[6]) in range(0,10): 23 | key_list.append(key5) 24 | key7 = 0x41 ^ 0x0b 25 | key7 = chr(key7) 26 | if key[7] == key7 and int(key[8]) in range(0,10): 27 | key_list.append(key7) 28 | key10 = 0x4c ^ 0x15 29 | key10 = chr(key10) 30 | if key[10] == key10 and int(key[11]) in range(0,10): 31 | key_list.append(key10) 32 | key12 = 0xa9 ^ 0xe2 33 | key12 = chr(key12) 34 | if key[12] == key12 and int(key[13]) in range(0,10): 35 | key_list.append(key12) 36 | key15 = 0x2d ^ 0x6e 37 | key15 = chr(key15) 38 | if key[15] == key15 and int(key[16]) in range(0,10): 39 | key_list.append(key15) 40 | key17 = 0x37 ^ 0x7b 41 | key17 = chr(key17) 42 | if key[17] == key17 and int(key[18]) in range(0,10): 43 | key_list.append(key17) 44 | else: 45 | print("[!] Error: Wrong KEY!") 46 | sys.exit(1) 47 | except ValueError: 48 | print("[!] Error: Wrong VALUE TYPE IN KEY!") 49 | sys.exit(1) 50 | return key_list 51 | 52 | #SYM.X FUNCTION 53 | def symx(y_value): 54 | list_ = [] 55 | xor_list = [] 56 | good = [] 57 | for x in range(0,10): 58 | list_.append("0x3"+str(x)) 59 | for i in range(0,10): 60 | if int(key[1]) or int(key[3]) or int(key[6]) or int(key[8]) or int(key[11]) or int(key[13]) or int(key[16]) or int(key[18]) == int(list_[i][3]): 61 | hex_key = list_[i] #movzx eax, byte [rax] 62 | #movsx eax, al 63 | sub = int(hex_key,16)-48 #sub eax, 0x30 64 | value = 6 #mov eax, dword [local_3ch] 65 | xor = sub ^ value #xor eax, dword [local_38h] 66 | xor_list.append(xor) #mov dword [local_34h], eax 67 | print (chr(27) + "[0;33m" + "\tXOR Values of 0x30 to 0x39: "+"".join(str(xor_list))+chr(27) + "[0m") 68 | for i in range(len(y_value)): 69 | rax = symc(y_value[i]) 70 | if y_value[i] == y_value[0]: 71 | if rax == xor_list[int(key[1])]: #cmp eax, dword [local_34h] 72 | print (chr(27) + "[0;33m" + "\tGood EAX = RBP-0x34: "+str(rax)+chr(27) + "[0m") 73 | good.append(int(key[1])) 74 | else: 75 | print("[!] Error: Wrong VALUE IN KEY!") 76 | sys.exit(1) 77 | elif y_value[i] == y_value[1]: 78 | if rax == xor_list[int(key[3])]: #cmp eax, dword [local_34h] 79 | print (chr(27) + "[0;33m" + "\tGood EAX = RBP-0x34: "+str(rax)+chr(27) + "[0m") 80 | good.append(int(key[3])) 81 | else: 82 | print("[!] Error: Wrong VALUE IN KEY!") 83 | sys.exit(1) 84 | elif y_value[i] == y_value[2]: 85 | if rax == xor_list[int(key[6])]: #cmp eax, dword [local_34h] 86 | print (chr(27) + "[0;33m" + "\tGood EAX = RBP-0x34: "+str(rax)+chr(27) + "[0m") 87 | good.append(int(key[6])) 88 | else: 89 | print("[!] Error: Wrong VALUE IN KEY!") 90 | sys.exit(1) 91 | elif y_value[i] == y_value[3]: 92 | if rax == xor_list[int(key[8])]: #cmp eax, dword [local_34h] 93 | print (chr(27) + "[0;33m" + "\tGood EAX = RBP-0x34: "+str(rax)+chr(27) + "[0m") 94 | good.append(int(key[8])) 95 | else: 96 | print("[!] Error: Wrong VALUE IN KEY!") 97 | sys.exit(1) 98 | elif y_value[i] == y_value[4]: 99 | if rax == xor_list[int(key[11])]: #cmp eax, dword [local_34h] 100 | print (chr(27) + "[0;33m" + "\tGood EAX = RBP-0x34: "+str(rax)+chr(27) + "[0m") 101 | good.append(int(key[11])) 102 | else: 103 | print("[!] Error: Wrong VALUE IN KEY!") 104 | sys.exit(1) 105 | elif y_value[i] == y_value[5]: 106 | if rax == xor_list[int(key[13])]: #cmp eax, dword [local_34h] 107 | print (chr(27) + "[0;33m" + "\tGood EAX = RBP-0x34: "+str(rax)+chr(27) + "[0m") 108 | good.append(int(key[13])) 109 | else: 110 | print("[!] Error: Wrong VALUE IN KEY!") 111 | sys.exit(1) 112 | elif y_value[i] == y_value[6]: 113 | if rax == xor_list[int(key[16])]: #cmp eax, dword [local_34h] 114 | print (chr(27) + "[0;33m" + "\tGood EAX = RBP-0x34: "+str(rax)+chr(27) + "[0m") 115 | good.append(int(key[16])) 116 | else: 117 | print("[!] Error: Wrong VALUE IN KEY!") 118 | sys.exit(1) 119 | elif y_value[i] == y_value[7]: 120 | if rax == xor_list[int(key[18])]: #cmp eax, dword [local_34h] 121 | print (chr(27) + "[0;33m" + "\tGood EAX = RBP-0x34: "+str(rax)+chr(27) + "[0m") 122 | good.append(int(key[18])) 123 | else: 124 | print("[!] Error: Wrong VALUE IN KEY!") 125 | sys.exit(1) 126 | return good 127 | #SYM.C FUNCTION 128 | def symc(y_value): 129 | rax = 0 130 | char_ = ord(y_value) #mov eax, dword [local_14h] 131 | while True: 132 | local4 = char_ & 1 #and eax, 1 133 | #mov dword [local_4h], eax 134 | char_ = char_>>1 #sar eax, 1 135 | if char_ == 1: 136 | rax = rax+1 #add eax, 1 137 | return rax 138 | if local4 == 1: #cmp dword [local_4h], 1 139 | rax = rax+1 #add dword [local_8h], 1 140 | 141 | if __name__ == "__main__": 142 | print(''' 143 | /$$ /$$ /$$$$$$ /$$ /$$ 144 | | $$ /$$/ /$$__ $$ | $$ | $$ 145 | | $$ /$$/ /$$$$$$ /$$ /$$ | $$ \ $$ /$$ /$$ /$$$$$$ | $$$$$$$ 146 | | $$$$$/ /$$__ $$| $$ | $$ /$$$$$$| $$$$$$$$| $$ | $$|_ $$_/ | $$__ $$ 147 | | $$ $$ | $$$$$$$$| $$ | $$|______/| $$__ $$| $$ | $$ | $$ | $$ \ $$ 148 | | $$\ $$ | $$_____/| $$ | $$ | $$ | $$| $$ | $$ | $$ /$$| $$ | $$ 149 | | $$ \ $$| $$$$$$$| $$$$$$$ | $$ | $$| $$$$$$/ | $$$$/| $$ | $$ 150 | |__/ \__/ \_______/ \____ $$ |__/ |__/ \______/ \___/ |__/ |__/ 151 | /$$ | $$ 152 | | $$$$$$/ Ultimate ultra-mega hacker key checker 153 | \______/ Version: 01.1337 (Only 1 key has been saved)''') 154 | try: 155 | if sys.argv[1] and sys.argv[2]: 156 | time_value = time_sweetened() 157 | print (chr(27) + "[0;33m" + "\tTime is time, do you know what I mean...: "+"".join(chr(time_value))+chr(27) + "[0m") 158 | try: 159 | if ord(sys.argv[1][1:]) == time_value and sys.argv[1][:1] == "-": 160 | if len(sys.argv[2]) == 19: 161 | key = sys.argv[2] 162 | if key[4] and key[9] and key[14] == "-": 163 | y_value = symy(key) 164 | if y_value == None: 165 | print("[!] Error: Wrong KEY!") 166 | sys.exit(1) 167 | else: 168 | print (chr(27) + "[1;36m" + "[+] STAGE 1: Checking A-Z char in Key succesfully!: %s"%(y_value) + chr(27) + "[0m") 169 | x_value = symx(y_value) 170 | print (chr(27) + "[1;36m" + "[+] STAGE 2: Checking 0-9 numbers in Key succesfully!: %s"%(x_value) + chr(27) + "[0m") 171 | final_key = [] 172 | for a in range(len(y_value)): 173 | final_key.append(y_value[a]) 174 | final_key.append(str(x_value[a])) 175 | if a == 1 or a == 3 or a == 5: 176 | final_key.append("-") 177 | print (chr(27) + "[0;33m" + "\tFlag: "+"".join(final_key)+chr(27) + "[0m") 178 | else: 179 | print("[!] Error: Wrong FORMAT KEY!") 180 | else: 181 | print("[!] Error: Wrong LENGHT!") 182 | else: 183 | print("[!] Error: Wrong TIME!") 184 | except TypeError: 185 | print("[!] Error: Wrong ARG FORMAT!") 186 | except IndexError: 187 | print("Usage: python reverse.py arg1 arg2") 188 | 189 | 190 | -------------------------------------------------------------------------------- /PatataCTF/Angry Potato/angry-potato: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/PatataCTF/Angry Potato/angry-potato -------------------------------------------------------------------------------- /PatataCTF/Angry Potato/reverse.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | #REVERSE ENGINEERING 4 | def control(suma): 5 | if len(hex(suma)) == 11: 6 | splitt = hex(suma).split()[0][3:] 7 | suma = int(splitt,16) 8 | return suma 9 | 10 | #SYM.HASH FUNCTION 11 | def symhash(password): 12 | for i in range(len(password)): 13 | if i == 0: 14 | fabada = 16431834 #mov eax, ebp-0x4 (0xfabada) 15 | shl = fabada<<6 #shl eax,6 16 | #print hex(shl) 17 | elif i == 1 or i == 2 or i == 3 or i == 4 or i == 5 or i == 6: 18 | #print hex(local4) 19 | fabada = local4 #mov eax, ebp-0x4 20 | shlOP = fabada<<6 #shl eax,6 21 | splitt = hex(shlOP).split()[0][4:] 22 | shl = int(splitt,16) 23 | #print hex(shl) 24 | 25 | #mov edx, eax 26 | #mov eax, ebp-0x4 27 | 28 | 29 | 30 | if len(hex(shl+fabada)) > 10: 31 | sum1 = control(shl+fabada) 32 | chrr = password[i] #mov eax, ebp-0x8 33 | #print chrr 34 | if len(hex(sum1+chrr)) > 10: 35 | sum2 = control(sum1+chrr) #add eax,edx 36 | sum3 = sum2+sum2 #add eax,eax 37 | local4 = sum3 #mov ebp-0x4,eax 38 | #print hex(local4) 39 | else: 40 | sum2 = sum1+chrr 41 | sum3 = sum2+sum2 42 | local4 = sum3 43 | #print hex(local4) 44 | else: 45 | sum1 = shl+fabada 46 | ##print(hex(sum1)) 47 | chrr = password[i] 48 | #print chrr 49 | if len(hex(sum1+chrr)) > 10: 50 | sum2 = control(sum1+chrr) 51 | sum3 = sum2+sum2 52 | local4 = sum3 53 | #print hex(local4) 54 | else: 55 | sum2 = sum1+chrr 56 | #print hex(sum2) 57 | if len(hex(sum2+sum2)) > 10: 58 | sum3 = control(sum2+sum2) 59 | local4 = sum3 60 | #print hex(local4) 61 | else: 62 | sum3 = sum2+sum2 63 | local4 = sum3 64 | #print hex(local4) 65 | 66 | return hex(local4) 67 | 68 | #SYM.HASH2 FUNCTION 69 | def symhash2(password): 70 | for i in range(len(password)): 71 | if i == 0: 72 | beef = 48879 #mov eax, ebp-0x4 (0xbeef) 73 | shl = beef<<5 #shl eax,6 74 | #print hex(shl) 75 | elif i == 1 or i == 2 or i == 3 or i == 4 or i == 5 or i == 6: 76 | #print hex(local4) 77 | beef = local4 #mov eax, ebp-0x4 78 | shlOP = beef<<5 #shl eax,5 79 | if len(hex(shlOP)) > 11: 80 | splitt = hex(shlOP).split()[0][4:] 81 | shl = int(splitt,16) 82 | #print hex(shl) 83 | elif len(hex(shlOP)) > 10: 84 | splitt = hex(shlOP).split()[0][3:] 85 | shl = int(splitt,16) 86 | #print hex(shl) 87 | else: 88 | shl = shlOP 89 | #print hex(shl) 90 | #mov edx,eax 91 | #mov eax,ebp-0x4 92 | 93 | 94 | if len(hex(shl+beef)) > 10: 95 | sum1 = control(shl+beef) #add edx, eax 96 | chrr = password[i] #mov eax, ebp-0x8 97 | #print chrr 98 | if len(hex(sum1+chrr)) > 10: 99 | sum2 = control(sum1+chrr) #add eax,edx 100 | local4 = sum2 #mov ebp-0x4,eax 101 | #print hex(local4) 102 | else: 103 | sum2 = sum1+chrr 104 | local4 = sum2 105 | #print hex(local4) 106 | else: 107 | sum1 = shl+beef 108 | ##print(hex(sum1)) 109 | chrr = password[i] 110 | #print chrr 111 | if len(hex(sum1+chrr)) > 10: 112 | sum2 = control(sum1+chrr) 113 | local4 = sum2 114 | #print hex(local4) 115 | else: 116 | sum2 = sum1+chrr 117 | #print hex(sum2) 118 | local4 = sum2 119 | #print hex(local4) 120 | 121 | return hex(local4) 122 | 123 | if __name__ == "__main__": 124 | try: 125 | if sys.argv[1]: 126 | password = [] 127 | for i in range(len(sys.argv[1])): 128 | password.append(ord(sys.argv[1][i])) 129 | if len(password) == 7: 130 | print (chr(27) + "[1;36m" + "[+] REVERSE ENGINEERING" + chr(27) + "[0m") 131 | local20 = 2941729636 #mov qword [local_20h], -0x50a8c49c == 0xffffffffaf573b64 == low part 0xaf573b64 132 | local28 = 1512702707 #mov QWORD PTR [rbp-0x28], 0x5a2a02f3 133 | hash1 = symhash(password) #ret 134 | print("First Hash: "+hash1) 135 | local30 = int(hash1, 16) #mov ebp-0x30, rax 136 | hash2 = symhash2(password) #ret 137 | print("Second Hash: "+hash2) 138 | local38 = int(hash2, 16) #mov ebp-0x38, rax 139 | rax = local30 #mov rax, ebp-0x30 140 | 141 | #Now the first check compare the first hash with local variable local20 whose content in stack is 0xaf573b64 142 | 143 | if rax == local20: #cmp rax,QWORD PTR [rbp-0x20] 144 | rax = local38 #mov rax,QWORD PTR [rbp-0x38] 145 | if rax == local28: #cmp rax,QWORD PTR [rbp-0x28] Second check with hash2 and local28 hardcoded 146 | print("\nGood!") #mov DWORD PTR [rbp-0x4],0x10 147 | 148 | else: 149 | print("\nBad") #mov DWORD PTR [rbp-0x4],0xc 150 | else: 151 | print("\nBad") #mov DWORD PTR [rbp-0x4],0xc 152 | else: 153 | print("[!] Error: Wrong LENGHT!") 154 | except IndexError: 155 | print("Usage: python reverse.py password") 156 | 157 | -------------------------------------------------------------------------------- /Practical Malware Analysis Lab/Lab01-01/Lab01-01.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Practical Malware Analysis Lab/Lab01-01/Lab01-01.dll -------------------------------------------------------------------------------- /Practical Malware Analysis Lab/Lab01-01/Lab01-01.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Practical Malware Analysis Lab/Lab01-01/Lab01-01.exe -------------------------------------------------------------------------------- /Practical Malware Analysis Lab/Lab01-01/README.md: -------------------------------------------------------------------------------- 1 | # Lab 01-01 2 | Scripting with r2pipe and getting information from malware binary. 3 | -------------------------------------------------------------------------------- /Practical Malware Analysis Lab/Lab01-01/recon-lab1-1.py: -------------------------------------------------------------------------------- 1 | import r2pipe 2 | import base64 3 | import socket 4 | def valid_ip(address): 5 | try: 6 | socket.inet_aton(address) 7 | return True 8 | except: 9 | return False 10 | 11 | r = r2pipe.open("Lab01-01.dll") 12 | r.cmd('aaa') 13 | print (chr(27) + "[1;36m" + "\t\t\t\t\tSTAGE 1 - RECON: Getting information from Strings in PE File" + chr(27) + "[0m") 14 | out = r.cmdj('izj') 15 | print("[+] Strings from binary:") 16 | for i in range(len(out)): 17 | encoded_ = out[i]["string"] #All base64 strings 18 | strings = base64.b64decode(encoded_) 19 | print(strings) 20 | if strings == "KERNEL32.dll": 21 | print (chr(27) + "[0;33m" + "[+] Suggestion: If we look imports from %s probably we see functions for opening and manipulating files"%strings + chr(27) + "[0m") 22 | elif strings == "FindNextFileA" or strings == "FindFirstFileA": 23 | print (chr(27) + "[0;33m" + "[+] Suggestion: %s function tell us that probably the malware searches through the filesystem, and that i can open and modify files"%strings + chr(27) + "[0m") 24 | elif strings == ".exe": 25 | print (chr(27) + "[0;33m" + "[+] Suggestion: %s string maybe it will search for executables on the victim's system"%strings + chr(27) + "[0m") 26 | elif strings == "CreateProcessA" or strings == "Sleep": 27 | print (chr(27) + "[0;33m" + "[+] Suggestion: %s function imported from Kernel32.dll which are commonly used by backdoors"%strings + chr(27) + "[0m") 28 | elif strings == "WS2_32.dll": 29 | print (chr(27) + "[0;33m" + "[+] Suggestion: %s probably connects to a network or performs network-related tasks"%strings + chr(27) + "[0m") 30 | elif strings == "exec": 31 | print (chr(27) + "[0;33m" + "[+] Suggestion: %s string is probably sent over the network to command the backdoor to run a program with CreateProcess"%strings + chr(27) + "[0m") 32 | elif strings == "sleep": 33 | print (chr(27) + "[0;33m" + "[+] Suggestion: %s string is probably used to command the backdoor program to sleep"%strings + chr(27) + "[0m") 34 | elif valid_ip(strings) == True: 35 | print (chr(27) + "[0;33m" + "[+] Suggestion: %s this IP Address should be routable and it would be a good network-based indicator for use in identifying probably malware"%strings + chr(27) + "[0m") 36 | -------------------------------------------------------------------------------- /Practical Malware Analysis Lab/Lab01-02/Lab01-02.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Practical Malware Analysis Lab/Lab01-02/Lab01-02.exe -------------------------------------------------------------------------------- /Practical Malware Analysis Lab/Lab01-02/README.md: -------------------------------------------------------------------------------- 1 | Scripting with r2pipe and getting information from malware binary. 2 | -------------------------------------------------------------------------------- /Practical Malware Analysis Lab/Lab01-02/Unpacked_Lab01-02.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/Practical Malware Analysis Lab/Lab01-02/Unpacked_Lab01-02.exe -------------------------------------------------------------------------------- /Practical Malware Analysis Lab/Lab01-02/recon-lab1-2.py: -------------------------------------------------------------------------------- 1 | import r2pipe 2 | import base64 3 | import socket 4 | import re 5 | 6 | def valid_url(string): 7 | url = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\), ]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', string) 8 | return url 9 | 10 | def valid_ip(address): 11 | try: 12 | socket.inet_aton(address) 13 | return True 14 | except: 15 | return False 16 | 17 | r = r2pipe.open("Unpacked_Lab01-02.exe") 18 | r.cmd('aaa') 19 | print (chr(27) + "[1;36m" + "\t\t\t\t\tSTAGE 1 - RECON: Getting information about Sections" + chr(27) + "[0m") 20 | out = r.cmdj('iSj') 21 | for i in range(len(out)): 22 | print(out[i]["name"]) 23 | print("[+] Virtual Size: %i"%out[i]["vsize"]) 24 | print("[+] Raw Data Size: %i"%out[i]["size"]) 25 | print("[+] Permission: %s"%out[i]["perm"]) 26 | 27 | print (chr(27) + "[1;36m" + "\t\t\t\t\tSTAGE 1 - RECON: Getting information from Strings in PE File" + chr(27) + "[0m") 28 | out = r.cmdj('izj') 29 | print("[+] Strings from binary:") 30 | for i in range(len(out)): 31 | encoded_ = out[i]["string"] #All base64 strings 32 | strings = base64.b64decode(encoded_) 33 | print(strings) 34 | if strings == "KERNEL32.dll" or strings == "KERNEL32.DLL": 35 | print (chr(27) + "[0;33m" + "[+] Suggestion: If we look imports from %s probably we see functions for opening and manipulating files"%strings + chr(27) + "[0m") 36 | elif strings == "FindNextFileA" or strings == "FindFirstFileA": 37 | print (chr(27) + "[0;33m" + "[+] Suggestion: %s function tell us that probably the malware searches through the filesystem, and that i can open and modify files"%strings + chr(27) + "[0m") 38 | elif strings == ".exe": 39 | print (chr(27) + "[0;33m" + "[+] Suggestion: %s string maybe it will search for executables on the victim's system"%strings + chr(27) + "[0m") 40 | elif strings == "CreateProcessA" or strings == "Sleep": 41 | print (chr(27) + "[0;33m" + "[+] Suggestion: %s function imported from Kernel32.dll which are commonly used by backdoors"%strings + chr(27) + "[0m") 42 | elif strings == "WS2_32.dll": 43 | print (chr(27) + "[0;33m" + "[+] Suggestion: %s probably connects to a network or performs network-related tasks"%strings + chr(27) + "[0m") 44 | elif strings == "exec": 45 | print (chr(27) + "[0;33m" + "[+] Suggestion: %s string is probably sent over the network to command the backdoor to run a program with CreateProcess"%strings + chr(27) + "[0m") 46 | elif strings == "sleep": 47 | print (chr(27) + "[0;33m" + "[+] Suggestion: %s string is probably used to command the backdoor program to sleep"%strings + chr(27) + "[0m") 48 | elif valid_ip(strings) == True: 49 | print (chr(27) + "[0;33m" + "[+] Suggestion: %s this IP Address should be routable and it would be a good network-based indicator for use in identifying probably malware"%strings + chr(27) + "[0m") 50 | elif strings == "WININET.dll": 51 | print (chr(27) + "[0;33m" + "[+] Suggestion: Imports from %s tell us that this code connects to the Internet"%strings + chr(27) + "[0m") 52 | elif strings == "ADVAPI32.dll": 53 | print (chr(27) + "[0;33m" + "[+] Suggestion: Imports from %s tell us that the code creates a service"%strings + chr(27) + "[0m") 54 | try: 55 | if valid_url(strings)[0] == strings: 56 | print (chr(27) + "[0;33m" + "[+] Suggestion: URL %s probably opened by InternetOpenURL function"%strings + chr(27) + "[0m") 57 | except IndexError: 58 | pass 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | It is a list of reversing challenges compiled from different CTF, whose content is the binary and solution using r2pipe, IDAPython or just reverse binary in high-level language like Python or C, and some writeups!. It is a list in continuous update so enjoy and learn!. 2 | # Baby 3 | | Challenge | Output and info| 4 | | ----- | ------ | 5 | | 9447 CTF 2015: The real flag finder | Usage: ./flagFinderRedux [arg1]
![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 6 | | Defcamp CTF Qualifications 2015: entry-language-100 | Enter the password: [stdin]
![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 7 | | Hack The Box: Find The Easy Pass | Enter Password: [stdin]
![#1aa3ff](https://placehold.it/15/1aa3ff/000000?text=+) Exe| 8 | | Hack The Box: Impossible Password | * [stdin]
![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 9 | | CCN-Cert Atenea CTF: WannaCry | ![#FF0000](https://placehold.it/15/ff0000/000000?text=+) Malware ![#1aa3ff](https://placehold.it/15/1aa3ff/000000?text=+) Exe| 10 | | CCN-Cert Atenea CTF: Saint Seiya | Enter Key: [stdin]
![#1aa3ff](https://placehold.it/15/1aa3ff/000000?text=+) Exe | 11 | | CCN-Cert Atenea CTF: Spear Phising... Can you catch me? | ![#FF0000](https://placehold.it/15/ff0000/000000?text=+) Malware ![#1aa3ff](https://placehold.it/15/1aa3ff/000000?text=+) Exe| 12 | | CCN-Cert Atenea CTF: Counter | ![#D2691E](https://placehold.it/15/d2691e/000000?text=+) Packed ![#1aa3ff](https://placehold.it/15/1aa3ff/000000?text=+) Exe| 13 | | CCN-Cert Atenea CTF: Crackme! if you can... | Usage: crypt0.exe [arg1] [arg2]
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#1aa3ff](https://placehold.it/15/1aa3ff/000000?text=+) Exe| 14 | | H4CK1T CTF 2016: Crypt00perator | Enter th3 k3y: [stdin]
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#1aa3ff](https://placehold.it/15/1aa3ff/000000?text=+) Exe| 15 | | CSAW 2016: Gametime | ![#1aa3ff](https://placehold.it/15/1aa3ff/000000?text=+) Exe| 16 | | Hack.lu CTF 2018: Baby Reverse | Welcome to this Chall! Enter the Key to win: [stdin]
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 17 | | INSTRUO CTF 2018: Tez Bano Tez | INSTRUO-2018 IIEST-S *** Calculating key...
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 18 | | HoneyCON CTF 2018: Basic Conditional Decision | Usage: rev3 [arg1],
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 19 | | X-MAS CTF 2019: Santa's crackme | [stdin], Binary: main
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 20 | | X-MAS CTF 2019: Santa's crackme | [stdin], Binary: main
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 21 | | Basic Algorithm Decrypt function | Usage: entropy [arg1], Binary: entropy
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 22 | | Iris CTF 2024, Baby rev Johnson | Usage: main [stdin], Binary: main
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 23 | | Iris CTF 2024, Whats a rune | Usage: main.go , Source Code: main.go
![#1aa3ff](https://placehold.it/15/1aa3ff/000000?text=+) Golang| 24 | 25 | # Easy 26 | | Challenge | Output and info| 27 | | ----- | ------ | 28 | | r2con2018: psv | Welcome to PSV (Perfectly Secure Vault)! Enter your secret key to unlock: [stdin]
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 29 | | r2con2018: scrabble | Usage: scrabble [arg1],
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 30 | | r2con2018: forceme | ****** As a Lockpicking master, Open the Lock! ******* Usage: forceme [arg]
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 31 | | Navarra Lan Party CTF 2018: Key is the key | Ultimate ultra-mega hacker key checker Version: 01.1337 (Only 1 key has been saved) Usage: keyisthekey [arg1] [arg2] by KaoRz (@alextaito99)
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#D2691E](https://placehold.it/15/d2691e/000000?text=+) Packed ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf ![#9900ff](https://placehold.it/15/9900ff/000000?text=+) Anti-Debugging| 32 | | Flare-On 2018: Ultimate Minesweeper | .NET Game by Nick Harbour (@nickharbour)
![#1aa3ff](https://placehold.it/15/1aa3ff/000000?text=+) Exe| 33 | | HoneyCON CTF 2018: Brute Me | Usage: rev4 [arg1],
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 34 | | HoneyCON CTF 2018: Ultra Secure Bank Login | Es necesario introducir los 8 PINes para realizar login en FWHIBBIT Bank PIN 1: [stdin],
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 35 | 36 | # Medium 37 | 38 | | Challenge | Output and info| 39 | | ----- | ------ | 40 | | r2con2018: disqualified | Show me what you got: [stdin] by Megabeets (@megabeets_)
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 41 | | Navarra Lan Party CTF 2018: In time | Introduce tu flag y comprueba si es la correcta [stdin] Espere unos instantes... by Gibdeon (@gibdeon)
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 42 | | PatataCTF 2018: Angry Potato | ./angry-patatas [arg] by Patatas (@HackingPatatas)
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf| 43 | | InCTF 2018: Decoy | Input: [stdin]
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#1aa3ff](https://placehold.it/15/1aa3ff/000000?text=+) Exe ![#9900ff](https://placehold.it/15/9900ff/000000?text=+) Anti-Debugging| 44 | | X-MAS CTF 2019: Last Christmas | Binary: LAST_XMAS
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf ![#D2691E](https://placehold.it/15/d2691e/000000?text=+) Packed ![#9900ff](https://placehold.it/15/9900ff/000000?text=+) Anti-Debugging| 45 | | CTF FWHIBBIT 2020: EB SECRET | Web Access DON'T RUN AS ROOT
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#ffff1a](https://placehold.it/15/ffff1a/000000?text=+) Elf ![#8000ff](https://placehold.it/15/8000ff/000000?text=+) Obfuscate ![#9900ff](https://placehold.it/15/9900ff/000000?text=+) Anti-Debugging| 46 | | State Machine 2018: Ret0 |CLS Team 2018 Enter Password: [stdin] by @Bym24v
![#c5f015](https://placehold.it/15/c5f015/000000?text=+) Crackme ![#1aa3ff](https://placehold.it/15/1aa3ff/000000?text=+) Exe| 47 | 48 | # Hard 49 | | Challenge | Output and info| 50 | | ----- | ------ | 51 | 52 | 53 | # Insane 54 | | Challenge | Output and info| 55 | | ----- | ------ | 56 | -------------------------------------------------------------------------------- /State machine/Ret0/Ret0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/State machine/Ret0/Ret0.zip -------------------------------------------------------------------------------- /State machine/Ret0/keygen.py: -------------------------------------------------------------------------------- 1 | import random 2 | import sys 3 | import time 4 | def check_key(key): 5 | char_sum = 0 6 | for c in key: 7 | char_sum += ord(c) 8 | sys.stdout.write("{0:3} | {1} \r".format(char_sum, key)) 9 | sys.stdout.flush() 10 | return char_sum 11 | 12 | print (chr(27) + "[1;32m" + "S T A T E M A C H I N E Keygen Ret0 by @naivenom"+chr(27) + "[0m") 13 | time.sleep(2) 14 | timeout = time.time()+1 15 | first = [];second = [];third = [];four = [];five = [];six = [];seven = [];eight = [];nine = [];ten = []; 16 | eleven = [];twelve = [] ;thirteen=[]; fourteen = []; fifteen = []; sixteen = []; seventeen = []; eighteen = []; 17 | nineteen = []; twenty = []; twenty_one = []; 18 | while True: 19 | test = 0 20 | if test == 1 or time.time() > timeout: 21 | break 22 | key = "" 23 | key += random.choice("a#bcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_!$%&'()*+,./:;<>=?@[]`{~}\"") 24 | v2 = check_key(key) 25 | #print(v2) 26 | v3 = v2>>1 27 | #print("Division %d"%v3) 28 | if v3 <= 33: 29 | mult = v3*2 30 | v0 = 27 31 | esi = mult*v0 >> v0/5 32 | if esi == 28: 33 | print (chr(27) + "[0;33m" + "\n\tCase 28: %s "%(chr(v2))+chr(27) + "[0m") 34 | first.append(chr(v2)) 35 | twenty_one.append(chr(v2)) 36 | elif esi == 55: 37 | print (chr(27) + "[0;33m" + "\n\tCase 55: %s "%(chr(v2))+chr(27) + "[0m") 38 | fourteen.append(chr(v2)) 39 | 40 | if v3 >= 125: 41 | pass 42 | 43 | else: 44 | v0 = 27 45 | esi = v3*v0 >> v0/5 46 | if esi == 39: 47 | print (chr(27) + "[0;33m" + "\n\tCase 39: %s "%(chr(v2))+chr(27) + "[0m") 48 | second.append(chr(v2)) 49 | seven.append(chr(v2)) 50 | thirteen.append(chr(v2)) 51 | twenty.append(chr(v2)) 52 | elif esi == 40: 53 | print (chr(27) + "[0;33m" + "\n\tCase 40: %s "%(chr(v2))+chr(27) + "[0m") 54 | six.append(chr(v2)) 55 | elif esi == 41: 56 | print (chr(27) + "[0;33m" + "\n\tCase 41: %s "%(chr(v2))+chr(27) + "[0m") 57 | eleven.append(chr(v2)) 58 | elif esi == 34: 59 | print (chr(27) + "[0;33m" + "\n\tCase 34: %s "%(chr(v2))+chr(27) + "[0m") 60 | third.append(chr(v2)) 61 | eight.append(chr(v2)) 62 | elif esi == 42: 63 | print (chr(27) + "[0;33m" + "\n\tCase 42: %s "%(chr(v2))+chr(27) + "[0m") 64 | four.append(chr(v2)) 65 | seventeen.append(chr(v2)) 66 | elif esi == 43: 67 | print (chr(27) + "[0;33m" + "\n\tCase 43: %s "%(chr(v2))+chr(27) + "[0m") 68 | ten.append(chr(v2)) 69 | eighteen.append(chr(v2)) 70 | elif esi == 44: 71 | print (chr(27) + "[0;33m" + "\n\tCase 44: %s "%(chr(v2))+chr(27) + "[0m") 72 | twelve.append(chr(v2)) 73 | elif esi == 45: 74 | print (chr(27) + "[0;33m" + "\n\tCase 45: %s "%(chr(v2))+chr(27) + "[0m") 75 | sixteen.append(chr(v2)) 76 | elif esi == 48: 77 | print (chr(27) + "[0;33m" + "\n\tCase 48: %s "%(chr(v2))+chr(27) + "[0m") 78 | five.append(chr(v2)) 79 | nine.append(chr(v2)) 80 | elif esi == 49: 81 | print (chr(27) + "[0;33m" + "\n\tCase 49: %s "%(chr(v2))+chr(27) + "[0m") 82 | nineteen.append(chr(v2)) 83 | elif esi == 50: 84 | print (chr(27) + "[0;33m" + "\n\tCase 50: %s "%(chr(v2))+chr(27) + "[0m") 85 | fifteen.append(chr(v2)) 86 | 87 | 88 | 89 | test = test-1 90 | print (chr(27) + "[1;32m" + "V A L I D S E R I A L S:"+chr(27) + "[0m") 91 | for i in range(48): 92 | print(chr(27) +"[0;33m"+"".join(first[i]*3)+ 93 | "".join(second[i]*2)+"".join(third[i]*1)+"".join(four[i]*1)+"".join(five[i]*1)+"".join(six[i]*1) 94 | +"".join(seven[i]*1)+"".join(eight[i]*1)+"".join(nine[i]*1)+"".join(ten[i]*1)+"".join(eleven[i]*1) 95 | +"".join(twelve[i]*1)+"".join(thirteen[i]*1)+"".join(fourteen[i]*1)+"".join(fifteen[i]*1) 96 | +"".join(sixteen[i]*1)+"".join(seventeen[i]*1)+"".join(eighteen[i]*1)+"".join(nineteen[i]*1) 97 | +"".join(twenty[i]*2)+"".join(twenty_one[i]*3)+chr(27) +"[0m") 98 | 99 | print("--------------------------------") 100 | -------------------------------------------------------------------------------- /X-MAS CTF 2019/LAST_XMAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/X-MAS CTF 2019/LAST_XMAS -------------------------------------------------------------------------------- /X-MAS CTF 2019/main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/X-MAS CTF 2019/main -------------------------------------------------------------------------------- /babyrevjohnson/main: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/babyrevjohnson/main -------------------------------------------------------------------------------- /basic.asm: -------------------------------------------------------------------------------- 1 | ; Assemble: nasm -f elf64 -l reto.lst reto.asm 2 | ; Link: gcc -m64 -o reto reto.o 3 | section .text 4 | global main 5 | main: 6 | mov ecx, 41 ;Mueve 0x29 a ECX 7 | lop: ;Bucle 8 | mov eax, msg ;Mueve la direccion de memoria de msg a EAX 9 | add eax, ecx ;Suma 0x29 a EAX 10 | mov edx, 0 ;Mueve 0 a EDX 11 | mov edx, [eax] ;Mueve el contenido de EAX a EDX 12 | xor edx, 0xb ;Operacion XOR de 0xb con EDX 13 | mov [eax], edx ;Mueve EDX, al contenido de EAX 14 | mov edx, 0 ;Mueve 0 a EDX 15 | mov dx, [eax] ;Mueve el contenido de EAX a DX (Parte baja de EDX, 16 bytes) 16 | rol dx, 0x5 ;Rota 5 bits a la izquierda a DX (16 bits) binary 0b0000000101100000 17 | mov edx, 0 ;Mueve a EDX 0 18 | mov dl, [eax] ;Mueve el contenido de EAX a DL (Parte baja de DX, 8 bytes) 19 | ror dl, 0x9d ;Rota 157 bits a la derecha a DL (8 bits) 20 | sub ecx, 1 ;Contador decrementa valor de msg 21 | cmp ecx, 0 ;Compara si es 0, si es 0 salta 22 | jge lop ;Salto condicional 23 | mov edx, 41 24 | mov ecx, msg 25 | mov ebx, 1 26 | mov eax, 4 27 | int 0x80 28 | mov eax, 1 29 | int 0x80 30 | 31 | section .data 32 | msg db 0x63, 0x64, 0x65, 0x6e, 0x72, 0x68, 0x64, 0x65, 0x39, 0x40, 0x3a, 0x33, 0x70, 0x3a, 0x54, 0x67, 0x3b, 0x7d, 0x38, 0x54, 0x73, 0x33, 0x3d, 0x54, 0x3f, 0x78, 0x78, 0x38, 0x66, 0x69, 0x67, 0x72, 0x54, 0x68, 0x3f, 0x69, 0x38, 0x78, 0x63, 0x3b, 0x76 33 | -------------------------------------------------------------------------------- /entropy/entropy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/entropy/entropy -------------------------------------------------------------------------------- /entropy/solver.py: -------------------------------------------------------------------------------- 1 | from z3 import * 2 | 3 | def func_input_transf(x): 4 | x = (x * 0x5deece66d + 0xb) & 0xffffffffffff; 5 | return simplify(x) 6 | 7 | input_transf = BitVec("x", 48 ) #creates a bit-vector variable in Z3 named x with 48 BITS 8*6 8 | 9 | #Decrypt 100 times 10 | for i in range(100): 11 | input_transf = func_input_transf(input_transf) 12 | 13 | #But check is just with func_input_transf 100 times, and not xored. 14 | solve(input_transf == 0xfd94e6e84a0a) 15 | #result in decimal, little endian 16 | -------------------------------------------------------------------------------- /r2con2018/disqualified/disqualified: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/r2con2018/disqualified/disqualified -------------------------------------------------------------------------------- /r2con2018/disqualified/disqualified.rr2: -------------------------------------------------------------------------------- 1 | #!/usr/bin/rarun2 2 | program=./disqualified 3 | stdin="AAAA" 4 | stdout= 5 | -------------------------------------------------------------------------------- /r2con2018/disqualified/solve.py: -------------------------------------------------------------------------------- 1 | import r2pipe 2 | import sys 3 | #r = r2pipe.open( 4 | #filename='', flags=['-d', 'rarun2', 'program=psv', 'stdin="r2con{"']) 5 | r = r2pipe.open("./disqualified") 6 | r.cmd('e dbg.profile=disqualified.rr2') 7 | r.cmd('doo') #initially you are debuggign rarun2 8 | r.cmd('db main') #Random memory address code so setting bp in main 9 | r.cmd('dc') 10 | #print r.cmd('drj') 11 | 12 | 13 | #STAGE 1 14 | if sys.argv[1] == "stage1": 15 | print (chr(27) + "[1;36m" + "[+] STAGE 1 - RECON: Getting key and xor 4 bytes with function prelude opcodes:554889e5" + chr(27) + "[0m") 16 | while True: 17 | list_ = [] 18 | disass = [] 19 | chrlist = [] 20 | if r.cmdj('drj')["rcx"] == 196: 21 | break 22 | while True: 23 | instruction = r.cmdj('pdj 1')[0] 24 | disass.append(instruction['opcode']) 25 | #RECON: Getting key and xor 4 bytes with function prelude opcodes:554889e5 26 | #push rbp 27 | #mov rbp, rsp 28 | if instruction['opcode'] == "movzx eax, byte [rax]": 29 | if r.cmdj('drj')["rcx"] == 28: 30 | print(instruction['opcode']) 31 | print(r.cmdj('drj')["rcx"]) 32 | xor = r.cmdj('drj')["rcx"] ^ 85 33 | list_.append(xor) 34 | elif r.cmdj('drj')["rcx"] == 101: 35 | print(instruction['opcode']) 36 | print(r.cmdj('drj')["rcx"]) 37 | xor = r.cmdj('drj')["rcx"] ^ 72 38 | list_.append(xor) 39 | elif r.cmdj('drj')["rcx"] == 197: 40 | print(instruction['opcode']) 41 | print(r.cmdj('drj')["rcx"]) 42 | xor = r.cmdj('drj')["rcx"] ^ 137 43 | list_.append(xor) 44 | elif r.cmdj('drj')["rcx"] == 196: 45 | print(instruction['opcode']) 46 | print(r.cmdj('drj')["rcx"]) 47 | xor = r.cmdj('drj')["rcx"] ^ 229 48 | list_.append(xor) 49 | #print(list_) 50 | for x in range(len(list_)): 51 | #print(chr(int(list_[x]))) 52 | chrlist.append(chr(int(list_[x]))) 53 | print (chr(27) + "[0;33m" + "\tFirst characters of flag: "+"".join(chrlist)+chr(27) + "[0m") 54 | break 55 | r.cmd('ds') 56 | r.cmd('sr rip') 57 | 58 | #STAGE 2 59 | elif sys.argv[1] == "stage2": 60 | print (chr(27) + "[1;36m" + "[+] STAGE 2 - SOLVE: Getting the next keys using the previous part of flag and xor 4 bytes with function prelude opcodes:554889e5" + chr(27) + "[0m") 61 | while True: 62 | list_ = [] 63 | disass = [] 64 | chrlist = [] 65 | opcodes = [85,72,137,229] #function prelude opcodes 66 | if r.cmdj('drj')["rax"] == 72: 67 | break 68 | while True: 69 | instruction = r.cmdj('pdj 1')[0] 70 | disass.append(instruction['opcode']) 71 | #SOLVE: Getting the next keys using the previous part of flag and xor 4 bytes with function prelude opcodes:554889e5 72 | #push rbp 73 | #mov rbp, rsp 74 | if instruction['opcode'] == "mov esi, eax": 75 | if r.cmdj('drj')["rax"] == 72: 76 | r.cmd('ds') 77 | r.cmd('sr rip') 78 | print("[+]Getting instruction: "+instruction['opcode']) 79 | #print(r.cmdj("drj")["rdi"]) 80 | dir_addr = hex(r.cmdj("drj")["rdi"]-664) #0x298 = Distance to get the next memory address whose content is the key 81 | print("[+]Memory address of key: "+dir_addr) 82 | key = r.cmdj("pxj 4 @%s"%dir_addr) 83 | for x in range(len(key)): 84 | xor = int(key[x]) ^ opcodes[x] 85 | chrlist.append(chr(xor)) 86 | print (chr(27) + "[0;33m" + "\tNext 4 Bytes of flag: "+"".join(chrlist)+chr(27) + "[0m") 87 | dir_ = r.cmdj("drj")["rdi"]-664-72 #We realize that the distance to get the other keys it is at 0x48 88 | print("[+]Memory address of key: "+hex(dir_)) #So we just need to subtraction 0x48 each time and xored for getting the flag 89 | for x in range(4): 90 | chrlist = [] 91 | key = r.cmdj("pxj 4 @%s"%dir_) 92 | for x in range(len(key)): 93 | xor = int(key[x]) ^ opcodes[x] 94 | chrlist.append(chr(xor)) 95 | print (chr(27) + "[0;33m" + "\tNext 4 Bytes of flag: "+"".join(chrlist)+chr(27) + "[0m") 96 | dir_ = dir_-72 97 | print("[+]Memory address of key: "+hex(dir_)) 98 | break 99 | r.cmd('ds') 100 | r.cmd('sr rip') 101 | -------------------------------------------------------------------------------- /r2con2018/forceme/forceme: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/r2con2018/forceme/forceme -------------------------------------------------------------------------------- /r2con2018/forceme/reverse-brute.py: -------------------------------------------------------------------------------- 1 | import random 2 | import sys 3 | 4 | def check_key(key): 5 | char_sum = 0 6 | for c in key: 7 | char_sum += ord(c) 8 | sys.stdout.write("{0:3} | {1} \r".format(char_sum, key)) 9 | sys.stdout.flush() 10 | return char_sum 11 | 12 | 13 | #REVERSE ENGINEERING 14 | #password = [101,115,105,108,114,117,108,101,122] #Solve it 15 | key_ = [0x90, 0xa6, 0x9c, 0x99, 0xa7, 0xa0, 0x99, 0x90, 0xaf] 16 | 17 | #SYM.CODE 18 | def code(): 19 | i = 0 20 | list_ = [] 21 | while True: 22 | key = "" 23 | key += random.choice("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_!$%&#'()*+,./:;<>=?@[]`{~}\"") 24 | local14 = check_key(key) 25 | local8 = 7 #mov dword [local_8h], 7 26 | local4 = 69 #mov dword [local_4h], 0x45 27 | shl = local8<<4 #shl eax,4 28 | xor = local14 ^ local4 29 | add = xor + shl 30 | if add == key_[i]: 31 | list_.append(chr(local14)) 32 | #print hex(add) 33 | if key_[i] == 0xaf: 34 | return list_ 35 | i += 1 36 | 37 | if __name__ == "__main__": 38 | hardcoded_check = code() 39 | print("Flag -->"+"".join(hardcoded_check)) 40 | -------------------------------------------------------------------------------- /r2con2018/forceme/reverse.py: -------------------------------------------------------------------------------- 1 | #REVERSE ENGINEERING 2 | password = [101,115,105,108,114,117,108,101,122] #Solve it 3 | 4 | 5 | #SYM.CODE 6 | def code(): 7 | list_ = [] 8 | for i in range(len(password)): 9 | local14 = password[i] 10 | local8 = 7 #mov dword [local_8h], 7 11 | local4 = 69 #mov dword [local_4h], 0x45 12 | shl = local8<<4 #shl eax,4 13 | xor = password[i] ^ local4 14 | add = xor + shl 15 | list_.append(hex(add)) 16 | #print hex(add) 17 | 18 | return list_ 19 | 20 | if __name__ == "__main__": 21 | hardcoded_check = code() 22 | print(hardcoded_check) 23 | 24 | -------------------------------------------------------------------------------- /r2con2018/psv/psv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/r2con2018/psv/psv -------------------------------------------------------------------------------- /r2con2018/psv/solve.py: -------------------------------------------------------------------------------- 1 | import r2pipe 2 | 3 | #r = r2pipe.open( 4 | #filename='', flags=['-d', 'rarun2', 'program=psv', 'stdin="r2con{"']) 5 | r = r2pipe.open("./psv") 6 | r.cmd('e dbg.profile=psv.rr2') 7 | r.cmd('doo') # initially you are debugging rarun2 8 | r.cmd('db 0x0040084a') 9 | r.cmd('dc') 10 | #print r.cmd('drj') 11 | def step(): 12 | r.cmd('ds') 13 | r.cmd('sr rip') 14 | while True: 15 | list_ = [] 16 | disass = [] 17 | if r.cmd('dr rdx') == "0x0000ffff": 18 | break 19 | while True: 20 | instruction = r.cmdj('pdj 1')[0] 21 | disass.append(instruction['opcode']) 22 | if instruction['type'] == 'xor': 23 | print("[+] RDX Value: "+r.cmd('dr rdx')+" RCX Value: "+r.cmd('dr rcx')+" RAX Value: "+r.cmd('dr rax')) 24 | xor = int(r.cmd('dr rdx'),16)^int(r.cmd('dr rax'),16) #xor operation to get password 25 | if xor > 256: 26 | print("\tNon chr") 27 | else: 28 | print (chr(27) + "[0;33m" + "\tXOR Operation RAX ^ RDX: " +chr(xor)+chr(27) + "[0m") 29 | value = r.cmdj('drj')["rcx"] 30 | list_.append(value) 31 | 32 | elif r.cmd('dr rdx') == "0x0000ffff": 33 | #print(list_) 34 | break 35 | step() 36 | -------------------------------------------------------------------------------- /r2con2018/scrabble/reverse-brute.py: -------------------------------------------------------------------------------- 1 | import random 2 | import sys 3 | 4 | #REVERSE ENGINEERING 5 | key_ = [87,107,50,112,50,112,109,51,119,103,55,101,111,55,100] #key 6 | #password = [84,104,49,115,49,115,110,48,116,100,52,102,108,52,103] 7 | def check_key(key): 8 | char_sum = 0 9 | for c in key: 10 | char_sum += ord(c) 11 | sys.stdout.write("{0:3} | {1} \r".format(char_sum, key)) 12 | sys.stdout.flush() 13 | return char_sum 14 | 15 | def main(): 16 | i = 0 17 | list_ = [] 18 | while True: 19 | key = "" 20 | key += random.choice("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_!$%&#'()*+,./:;<>=?@[]`{~}\"") 21 | password = check_key(key) 22 | local18 = 0 23 | xor = key_[i] ^ 3 #xor eax, 3 24 | local14 = xor-password #sub edx, eax 25 | #print("Distance: "+str(local14)) 26 | if local14 == 0: #cmp dword [local_14h], 0 Compare to win 27 | list_.append(chr(xor)) 28 | print("Distance: "+str(local14)) 29 | if key_[i] == 100: 30 | return list_ 31 | i += 1 32 | if __name__ == "__main__": 33 | print("For win the distance has to be = 0 cmp dword [local_14h], 0") 34 | hardcoded_check = main() 35 | print("Flag --> "+"".join(hardcoded_check)) 36 | -------------------------------------------------------------------------------- /r2con2018/scrabble/reverse.py: -------------------------------------------------------------------------------- 1 | #REVERSE ENGINEERING 2 | key = [87,107,50,112,50,112,109,51,119,103,55,101,111,55,100] #key 3 | password = [84,104,49,115,49,115,110,48,116,100,52,102,108,52,103] 4 | 5 | 6 | def main(): 7 | list_ = [] 8 | local18 = 0 9 | for i in range(len(key)): 10 | xor = key[i] ^ 3 #xor eax, 3 11 | resta = xor-password[i] #sub edx, eax 12 | local14 = resta 13 | print("Distance: "+str(local14)) 14 | if local14 == 0: #cmp dword [local_14h], 0 Compare to win 15 | list_.append(hex(xor)) 16 | 17 | return list_ 18 | 19 | if __name__ == "__main__": 20 | print("For win the distance has to be == 0 #cmp dword [local_14h], 0") 21 | hardcoded_check = main() 22 | print(hardcoded_check) 23 | -------------------------------------------------------------------------------- /r2con2018/scrabble/scrabble: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/naivenom/reversing-list/aeba6c734770ccac2824fb12f351a526e019f474/r2con2018/scrabble/scrabble -------------------------------------------------------------------------------- /whats-a-rune/chall.py: -------------------------------------------------------------------------------- 1 | def decrypt_flag(encrypted_flag): 2 | runed = [] 3 | z = "\x00" 4 | 5 | for v in encrypted_flag: 6 | runed.append(chr(ord(v) - ord(z))) 7 | z = runed[-1] 8 | 9 | return ''.join(runed) 10 | 11 | def main(): 12 | try: 13 | with open("the", "r") as file: 14 | encrypted_flag = file.read().strip() 15 | flag = decrypt_flag(encrypted_flag) 16 | print("Decrypted flag: ", flag) 17 | except Exception as e: 18 | print(e) 19 | finally: 20 | file.close() 21 | 22 | if __name__ == "__main__": 23 | main() 24 | 25 | -------------------------------------------------------------------------------- /whats-a-rune/main-chall.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "strings" 7 | ) 8 | 9 | var flag = "irisctf{this_is_not_the_real_flag}" 10 | 11 | 12 | func main() { 13 | runed := []string{} 14 | z := rune(0) 15 | 16 | for _, v := range flag { 17 | fmt.Println("v+z :",v+z) 18 | runed = append(runed, string(v+z)) 19 | fmt.Println("z :",z) 20 | fmt.Println("v :",v) 21 | fmt.Println("runed :",runed) 22 | z = v 23 | } 24 | 25 | flag = strings.Join(runed, "") 26 | fmt.Println(runed) 27 | fmt.Println("asdasd") 28 | file, err := os.OpenFile("the", os.O_RDWR|os.O_CREATE, 0644) 29 | if err != nil { 30 | fmt.Println(err) 31 | return 32 | } 33 | 34 | defer file.Close() 35 | if _, err := file.Write([]byte(flag)); err != nil { 36 | fmt.Println(err) 37 | return 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /whats-a-rune/the: -------------------------------------------------------------------------------- 1 | iÛÛÜÖ×ÚáäÈÑ¥gebªØšÔž’Íãâ£i¥§²ËÅÒÍÈä --------------------------------------------------------------------------------