debug=False def printdebug(ss): if debug: print ss def getval(strval): strval=strval.strip() if 'slice' in strval: strval=strval.split(".slice(")#.replace(',',':')+']' strval=strval[0]+"["+strval[1].split(')')[0].replace(',',':')+"]" elif 'String.fromCharCode' in strval: strval=strval.replace('String.fromCharCode','chr') elif 'charAt' in strval: strval=strval.replace('.charAt','[').replace('(','').replace(')','')+']' if 'substr' in strval: strval=strval.split(".substr(")#.replace(',',':')+']' f,t=strval[1].split(')')[0].split(',') strval=strval[0]+"["+f+":"+f+'+'+t +"]" printdebug( strval) return eval(strval) def getSecuriCookie(html): import re puts=re.findall("S='(.*?)';",html)[0] puts= puts.decode("base64") printdebug( puts) val=re.findall("[a-z]=([\"'].*?);",puts,re.DOTALL)[0] vals=re.findall('(.*?)[ ]?\+',val) v="" for vv in vals: v+=getval(vv) e=v val=re.findall("cookie=(.*?);",puts,re.DOTALL)[0] vals=re.findall('(.*?)[ ]?\+',val) printdebug( vals) c="" for vv in vals: c+=getval(vv) c+=v return c #print getSecuriCookie("You are being redirected...")