GSR-IconBannerAd_v1d

Security Advisories

Trustwave Press Releases

« Baby's first NX+ASLR bypass | Main | 2014 Trustwave Global Security Report Available Now »

20 May 2014

Comments

John73447:

Here's the source of my 3dttt solver and the list of 3d tic tac toe choices sorted most advantageous to least (spaces replaced with dashes because typepad screws up formatting).:

3dttt.py:
#!/usr/bin/python
#3dttt solver
import socket
from time import sleep

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("3dttt_87277cd86e7cc53d2671888c417f62aa.2014.shallweplayaga.me", 1234))

while s:
--choices = open('bestchoices.txt')
--choice_array = choices.readlines()
--choices.close()
--for choice in choice_array:
----s.send(choice)
----response = s.recv(1024)
----if response.find("You've won") != -1:
------print response
------break

bestchoices.txt:
1,1,1
1,1,0
1,1,2
0,0,0
0,2,0
2,0,0
2,2,0
0,0,2
0,2,2
2,0,2
2,2,2
0,0,1
0,2,1
2,0,1
2,2,1
1,0,0
0,1,0
1,2,0
2,1,0
1,0,2
0,1,2
1,2,2
2,1,2
1,0,1
0,1,1
1,2,1
2,1,1

I could have made some improvements: "while s" will keep perpetuating the loop endlessly but if I win or lose the game the connection is cut anyway, so the program times out and exits anyway. I also read the bestchoices.txt file into an array every single iteration of the loop, which is unnecessary. I could have done that outside the loop.

Cheers!

John73447:

Here's the source of my 3dttt solver and the list of 3d tic tac toe choices sorted most advantageous to least:

3dttt.py:
#!/usr/bin/python
#3dttt solver
import socket
from time import sleep

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("3dttt_87277cd86e7cc53d2671888c417f62aa.2014.shallweplayaga.me", 1234))

while s:
choices = open('bestchoices.txt')
choice_array = choices.readlines()
choices.close()
for choice in choice_array:
s.send(choice)
response = s.recv(1024)
if response.find("You've won") != -1:
print response
break

bestchoices.txt:
1,1,1
1,1,0
1,1,2
0,0,0
0,2,0
2,0,0
2,2,0
0,0,2
0,2,2
2,0,2
2,2,2
0,0,1
0,2,1
2,0,1
2,2,1
1,0,0
0,1,0
1,2,0
2,1,0
1,0,2
0,1,2
1,2,2
2,1,2
1,0,1
0,1,1
1,2,1
2,1,1

Nice writeup!

Any chance you could post your Pyhton script for the 3dttt.

Thats the challenge on i focused on the most, but my scripting skills were lacking :)

Love to know how you did it.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment