#NEWLINE# def get_sucuri_cookie( html ) : #NEWLINE# #INDENT# if ( 'sucuri_cloudproxy_js' in html ) : #NEWLINE# #INDENT# match = re . search ( "S\\s*=\\s*'([^']+)" , s ) #NEWLINE# if match : #NEWLINE# #INDENT# s = base64 . b64decode ( match . group ( 1 ) ) #NEWLINE# s = s . replace ( ' ' , '' ) #NEWLINE# s = re . sub ( 'String\\.fromCharCode\\(([^)]+)\\)' , 'chr(\\1)' , s ) #NEWLINE# s = re . sub ( '\\.slice\\((\\d+),(\\d+)\\)' , '[\\1:\\2]' , s ) #NEWLINE# s = re . sub ( '\\.charAt\\(([^)]+)\\)' , '[\\1]' , s ) #NEWLINE# s = re . sub ( '\\.substr\\((\\d+),(\\d+)\\)' , '[\\1:\\1+\\2]' , s ) #NEWLINE# s = re . sub ( ';location.reload\\(\\);' , '' , s ) #NEWLINE# s = re . sub ( '\\n' , '' , s ) #NEWLINE# s = re . sub ( 'document\\.cookie' , 'cookie' , s ) #NEWLINE# try : #NEWLINE# #INDENT# cookie = '' #NEWLINE# exec ( s ) #NEWLINE# match = re . match ( '([^=]+)=(.*)' , cookie ) #NEWLINE# if match : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# match . group ( 1 ) : match . group ( 2 ) , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# control . log ( ( 'Exception during sucuri js: %s' % e ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# }