90 InternetWache2016 Code90



Very similar to the InternetWache2016 code 50 challenge, much of the code was actually reused. Since I couldn't use any loops as part of a bet, it resulted in some very cringe worthy code

from pwn import *  
from sympy import *

url = "188.166.133.53"  
port= 11027

equation =""

conn = remote("188.166.133.53", "11059")  
print conn.recvline() #prints i'm lost in a forest. blah

#since we will need to do this repeatively
def findAnswer():

    print conn.recvuntil("after ");     #prints level x: 
    num = conn.recvline();  #gets the tree
    num = num.replace('\n', '') ##removes \n
    num = num.replace(':', '')
    print num

    prime = str( findPrime( int(num )) )
    print prime
    conn.send(prime)    
    trigger = conn.recvuntil(",")
    print trigger + conn.recvline()




def findPrime(num):

    i = num +1;
    upperBound = 999999999
    while (isprime(i)!= true ):
        i+= 1
    return i

findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
#10
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
#20
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
#30
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
#40
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
#50
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
#60
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
#70
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
#80
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
#90
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
findAnswer()  
#100


print "end find answer"  
print conn.recvline()  
Press ` to check out my sick terminal!