import socket import time
chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' def shift(in_put, key, chars): global new new = [] for i in in_put: if i in chars: check = (chars.index(i)+key)
if check>len(chars)-1:
new.append(chars[check-len(chars)])
else:
new.append(chars[check])
return ''.join(new)
dic = {1:1, 2:1, 3:2, 4:3, 5:5, 6:8, 7:13, 8:21, 9:8, 10:3,
11:11, 12:14, 13:25, 14:13, 15:12, 16:25, 17:11, 18:10, 19:21, 20:5,
21:26, 22:5, 23:5, 24:10, 25:15, 26:25, 27:14, 28:13, 29:1, 30:14,
31:15, 32:3, 33:18, 34:21, 35:13, 36:8, 37:21, 38:3, 39:24, 40:1,
41:25, 42:26, 43:25, 44:25, 45:24, 46:23, 47:21, 48:18, 49:13, 0:26}
i = 0
with socket.socket(socket.AF_INET,socket.SOCK_STREAM) as s:
s.connect(("misc.2020.chall.actf.co",20300))
while i<51:
data = s.recv(8099).decode('UTF-8')
number = data.find('=')
word = data.find(':')
num = data[number+1:word]
cip1 = data.find('Shift ')
cip2 = data.find(' by')
print(data)
cipher = data[cip1+6:cip2]
if dic.get(int(num)) == 'n':
decode = 'n'
elif dic.get(int(num)) == 26:
decode = cipher
else:
decode = shift(cipher, dic.get(int(num)), chars)
s.send(bytes(decode+'\n', 'utf8'))
i+=1
Action | Rating | Author team |
---|---|---|
Read writeup |
not rated
|
P1rates |
Read writeup |
not rated
|
Fword |
Read writeup |
not rated
|
hack-me |
Read writeup |
not rated
|
Root Lee |
Read writeup |
not rated
|
S1gm0id |