Exploit:
import requests
gn = open('file','w')
r = requests.get('hidden_URL')
res = r.text
cook = r.cookies
cookie = r.cookies['PHPSESSID']
print cookie.strip()
page = gn.write(res)
gn.close()
gn = open('file','r')
pn = gn.readlines()
pk = pn[0].split('sub>')
gn.close()
a = int(((pk[2])[5:8]).strip(' +'))
print a
b = int(((pk[4])[11:14]).strip(']'))
print b
u_0 = int((pn[1])[16:20])
print u_0
lolo = pn[2].split('sub>')
kle = int(((lolo[1])[0:6]).strip('<'))
print kle
tabl = [u_0]
if "-" in pk[4]:
print "minus"
for i in xrange(kle):
nast = (a + tabl[i]) - (b*i)
tabl.append(nast)
if "+" in pk[4]:
print "byl plus"
for i in xrange(kle):
nast = (a + tabl[i]) + (b*i)
tabl.append(nast)
ans = tabl[kle]
print ans
answ = requests.get('hidden_URL?result='+str(ans),cookies = cook)
print answ.text