On the tutorial by Megabeets, "A journey into Radare 2 – Part 2: Exploitation", he shows an example of how to create a payload with Python2
# Initial payload
payload = "A"*140 # padding
ropchain = p32(puts_plt)
ropchain += p32(entry_point)
ropchain += p32(puts_got)
payload = payload + ropchain
How would that get ported to Python3? p32
is a 32bit integer. Python3 uses bytes()
instead of strings. What's the right way to do this?
python3-pwntools
's docs show that there are some payload helpers. But, I couldn't get them to work. Worse yet, those helpers were available in Python2 as well, but not used (not sure why).
How would I write Megabeet's example using python3-pwntools
?