from 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())from 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')