Skip to content

Instantly share code, notes, and snippets.

@N4NU
Created January 19, 2015 07:37
Show Gist options
  • Save N4NU/66f6963c69b177802e5b to your computer and use it in GitHub Desktop.
Save N4NU/66f6963c69b177802e5b to your computer and use it in GitHub Desktop.
Ghost in the Shellcode 2015 crypt 200 MTGO
import socket
import datetime
import random
basedeck = [
"Birds of Paradise1",
"Birds of Paradise2",
"Birds of Paradise3",
"Birds of Paradise4",
"Eternal Witness1",
"Kitchen Finks1",
"Kitchen Finks2",
"Kitchen Finks3",
"Linvala, Keeper of Silence1",
"Murderous Redcap1",
"Noble Hierarch1",
"Noble Hierarch2",
"Orzhov Pontiff1",
"Reclamation Sage1",
"Restoration Angel1",
"Restoration Angel2",
"Reveillark1",
"Scavenging Ooze1",
"Shriekmaw1",
"Siege Rhino1",
"Siege Rhino2",
"Sin Collector1",
"Spellskite1",
"Voice of Resurgence1",
"Voice of Resurgence2",
"Voice of Resurgence1",
"Wall of Roots1",
"Wall of Roots2",
"Abrupt Decay1",
"Abrupt Decay2",
"Abrupt Decay1",
"Birthing Pod1",
"Birthing Pod2",
"Birthing Pod1",
"Birthing Pod2",
"Thoughtseize1",
"Thoughtseize2",
"Forest1",
"Forest2",
"Forest3",
"Gavony Township1",
"Gavony Township2",
"Godless Shrine1",
"Marsh Flats1",
"Overgrown Tomb1",
"Overgrown Tomb2",
"Plains1",
"Razorverge Thicket1",
"Razorverge Thicket2",
"Razorverge Thicket1",
"Swamp1",
"Temple Garden1",
"Verdant Catacombs1",
"Verdant Catacombs2",
"Verdant Catacombs1",
"Verdant Catacombs2",
"Windswept Heath1",
"Windswept Heath2",
"Windswept Heath3",
"Windswept Heath4",
]
def shuffle(deck):
for i in xrange(len(deck)):
s = random.randint(0, len(deck) - 1)
t = deck[s]
deck[s] = deck[i]
deck[i] = t
return deck
def get_tick():
# gives you a string down to the millisecond*10
return datetime.datetime.utcnow()
host = '54.144.207.217'
port = 7463
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
count = 0
flag = True
while flag and count < 20:
flag = False
c_time = get_tick()
rcvmsg = s.recv(1024)
for t in range(0, 100000, 10):
random.seed((c_time + datetime.timedelta(milliseconds=t)).isoformat()[:-4])
deck = shuffle(list(basedeck))
h_deck = []
for i in range(1, 15, 2):
h_deck.append(rcvmsg.split("'")[i])
if h_deck == deck[:7]:
flag = True
break
if flag:
s.sendall(','.join(deck[7:20])+'\n')
basedeck = list(deck)
count += 1
print count
if count == 20:
s.recv(1024)
rcvmsg = s.recv(1024)
print rcvmsg,
else:
print count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment