ChrisTheCoolHut / Zeratool

Automatic Exploit Generation (AEG) and remote flag capture for exploitable CTF problems
GNU General Public License v3.0
1.11k stars 147 forks source link

b64decode TypeError: Incorrect padding #13

Closed sln-1550 closed 4 years ago

sln-1550 commented 4 years ago

I use the sample script, but failed. The output is following: (zeratool) test@ubuntu:~/tools/Zeratool$ python zeratool.py challenges/ret -u ctf.hackucf.org -p 9003 [+] Checking pwn type... [+] Checking for overflow pwn type... [+] Vulnerable path found '0000000000000000000000000p00000000000000000000000000000000000000\xef\xbe\xad\xde000000000000AAAA000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' [+] Triggerable with STDIN : '0000000000000000000000000p00000000000000000000000000000000000000\xef\xbe\xad\xde000000000000AAAA000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' [+] Getting binary protections Traceback (most recent call last): File "zeratool.py", line 80, in main() File "zeratool.py", line 61, in main properties['win_functions'] = winFunctionDetector.getWinFunctions(args.file) File "/home/test/tools/Zeratool/lib/winFunctionDetector.py", line 34, in getWinFunctions decoded_value = base64.b64decode(value) File "/usr/lib/python2.7/base64.py", line 78, in b64decode raise TypeError(msg) TypeError: Incorrect padding

Any way, my ubuntu is 16.04.

Error996 commented 4 years ago

$ python zeratool.py challenges/easy_format [+] Checking pwn type... [+] Checking for overflow pwn type... [+] Checking for format string pwn type... [+] Found symbolic buffer at position 0 of length 49 [+] Found symbolic buffer at position 0 of length 49 [+] Found symbolic buffer at position 0 of length 49 [+] Found symbolic buffer at position 0 of length 49 [+] Found symbolic buffer at position 0 of length 49 [+] Getting binary protections Traceback (most recent call last): File "zeratool.py", line 80, in main() File "zeratool.py", line 61, in main properties['win_functions'] = winFunctionDetector.getWinFunctions(args.file) File "/home/kali/Documents/Zeratool/lib/winFunctionDetector.py", line 38, in getWinFunctions decoded_value = base64.b64decode(value) File "/usr/lib/python2.7/base64.py", line 78, in b64decode raise TypeError(msg) TypeError: Incorrect padding

ChrisTheCoolHut commented 4 years ago

157d9fd

It looks like radare2 no longer base64 encodes all it's strings. So I removed the base64 decode