Skip to content

Instantly share code, notes, and snippets.

@pomo-mondreganto
Created April 11, 2020 09:32
Show Gist options
  • Save pomo-mondreganto/a864e3a259045846dee1fa0cb9fa68ea to your computer and use it in GitHub Desktop.
Save pomo-mondreganto/a864e3a259045846dee1fa0cb9fa68ea to your computer and use it in GitHub Desktop.
Script for submitting flags to ForcAD
#!/usr/bin/env python3
import time
import socket
SYSTEM_IP = '10.10.10.10'
SYSTEM_PORT = 31337
TEAM_TOKEN = '<your team token>'
def submit_flags(flags=[]):
sock = socket.socket()
sock.connect((SYSTEM_IP, SYSTEM_PORT))
time.sleep(0.5)
greeting = sock.recv(1024).decode().strip()
print('Greeting:', greeting)
if 'unavailable' in greeting:
return False
sock.send((TEAM_TOKEN + '\n').encode())
time.sleep(0.5)
response = sock.recv(1024).decode().strip()
print('Token response:', response)
if 'Invalid' in response:
return False
for flag in flags:
sock.send((flag + '\n').encode())
time.sleep(0.5)
response = sock.recv(1024).decode().strip()
print('Flag response:', response)
sock.close()
return True
submit_flags(['A' * 31 + '=', 'B' * 31 + '='])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment