Skip to content

Commit

Permalink
python version removed
Browse files Browse the repository at this point in the history
  • Loading branch information
gwen001 committed May 26, 2020
1 parent 66461c5 commit b85792d
Show file tree
Hide file tree
Showing 20 changed files with 173 additions and 162 deletions.
12 changes: 6 additions & 6 deletions apk-analyzer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.5
#!/usr/bin/python3

# I don't believe in license.
# You can do whatever you want with this program.
Expand Down Expand Up @@ -99,7 +99,7 @@ def listPermissionsCreated():
t_term.append( obj )
else:
t_noterm.append( obj )

printH2( 'PERMISSIONS CREATED (<permission>) (%d)' % len(t_all) )
printPermissionsCreated( t_term )
if len(t_term) and len(t_noterm):
Expand Down Expand Up @@ -130,7 +130,7 @@ def listPermissionsUsed():
t_term.append( obj )
else:
t_noterm.append( obj )

printH2( 'PERMISSIONS USED (<uses-permission>) (%d)' % len(t_all) )
printPermissionsUsed( t_term )
if len(t_term) and len(t_noterm):
Expand Down Expand Up @@ -387,7 +387,7 @@ def getProviderURI( authority ):
except Exception as e:
# sys.stdout.write( "%s[-] error occurred: %s%s\n" % (fg('red'),e,attr(0)) )
return t_uri

for l in output.split("\n"):
if not len(l):
continue
Expand All @@ -403,7 +403,7 @@ def getProviderURI( authority ):
# uri2 = 'content://' + tiktok + '/'
# if not uri2 in t_uri:
# t_uri.append( uri2 )

return t_uri


Expand Down Expand Up @@ -469,7 +469,7 @@ def _listFiles( dir ):
ignore = True
if not ignore:
t_files.append( {'filename':filename,'filesize':filesize} )

return t_all,t_files


Expand Down
28 changes: 14 additions & 14 deletions cloudflare-origin-ip.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python2.7
#!/usr/bin/python2

# I don't believe in license.
# You can do whatever you want with this program.
Expand Down Expand Up @@ -26,12 +26,12 @@

def banner():
print("""
_ _ __ _ _ _ _
___| | ___ _ _ __| |/ _| | __ _ _ __ ___ ___ _ __(_) __ _(_)_ __ (_)_ __ _ __ _ _
_ _ __ _ _ _ _
___| | ___ _ _ __| |/ _| | __ _ _ __ ___ ___ _ __(_) __ _(_)_ __ (_)_ __ _ __ _ _
/ __| |/ _ \| | | |/ _` | |_| |/ _` | '__/ _ \ / _ \| '__| |/ _` | | '_ \ | | '_ \ | '_ \| | | |
| (__| | (_) | |_| | (_| | _| | (_| | | | __/ | (_) | | | | (_| | | | | | | | |_) | _ | |_) | |_| |
\___|_|\___/ \__,_|\__,_|_| |_|\__,_|_| \___| \___/|_| |_|\__, |_|_| |_| |_| .__/ (_) | .__/ \__, |
|___/ |_| |_| |___/
|___/ |_| |_| |___/
by @gwendallecoguic
Expand Down Expand Up @@ -272,12 +272,12 @@ def is_cloudflare2( ip ):
# except Exception as e:
# print( colored("[-] %s: %s" % (ip,e), 'red') )
# return

# if not 'Content-Type' in r.headers:
# r.headers['Content-Type'] = ''

# score = responseCompare( r_reference, r )

# if score['average'] > GOOD_CANDIDATE_SCORE:
# if is_cloudflare2( IPAddress(ip) ):
# sys.stdout.write( colored("%s" % ip, 'yellow') )
Expand All @@ -288,7 +288,7 @@ def is_cloudflare2( ip ):
# else:
# sys.stdout.write( "%s" % ip )
# sys.stdout.write( " is not a good candidate with an average similarity of %d%%\n" % score['average'] )

# print( colored("Status=%d (%d%%), Length=%d (%d%%), Headers=%d (%d%%), Content-Type=%s (%d%%)" % (r.status_code,score['dist_status_code'],len(r.content),score['dist_content'],len(r.headers),score['dist_headers'],r.headers['Content-Type'],score['dist_content_type']), 'white') )


Expand All @@ -310,19 +310,19 @@ def testBypass3( t_multiproc, r_reference, host, ip ):
except Exception as e:
print( colored("[-] %s: %s" % (ip,e), 'red') )
return

if not 'Content-Type' in r.headers:
r.headers['Content-Type'] = ''

score = responseCompare( r_reference, r )

if score['average'] > GOOD_CANDIDATE_SCORE:
sys.stdout.write( colored("%s" % ip, 'green') )
sys.stdout.write( " is a GOOD candidate with an average similarity of %d%%\n" % score['average'] )
else:
sys.stdout.write( "%s" % ip )
sys.stdout.write( " is not a good candidate with an average similarity of %d%%\n" % score['average'] )

print( colored("Status=%d (%d%%), Length=%d (%d%%), Headers=%d (%d%%), Content-Type=%s (%d%%)" % (r.status_code,score['dist_status_code'],len(r.content),score['dist_content'],len(r.headers),score['dist_headers'],r.headers['Content-Type'],score['dist_content_type']), 'white') )


Expand All @@ -341,14 +341,14 @@ def responseCompare( r_reference, r ):
else:
score['status_code'] = 'NOK'
score['dist_status_code'] = 0

dist = levenshtein( r.headers['Content-Type'], r_reference.headers['Content-Type'] )
score['dist_content_type'] = 100 - ( dist*100 / len(r_reference.headers['Content-Type']) )

dist = levenshtein( r.content[0:COMPARE_FIRST_CHARS], r_reference.content[0:COMPARE_FIRST_CHARS] )
score['dist_content'] = 100 - ( dist*100 / len(r_reference.content[0:COMPARE_FIRST_CHARS]) )
# score['content_dist'] = dist

s_headers = ''
s_reference_headers = ''
t_sorted_keys = sorted( r_reference.headers )
Expand Down
19 changes: 11 additions & 8 deletions cors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.5
#!/usr/bin/python3

# I don't believe in license.
# You can do whatever you want with this program.
Expand Down Expand Up @@ -27,11 +27,11 @@

def banner():
print("""
___ ___ _ __ ___ _ __ _ _
___ ___ _ __ ___ _ __ _ _
/ __/ _ \| '__/ __| | '_ \| | | |
| (_| (_) | | \__ \ _ | |_) | |_| |
\___\___/|_| |___/ (_) | .__/ \__, |
|_| |___/
|_| |___/
by @gwendallecoguic
Expand Down Expand Up @@ -71,14 +71,14 @@ def testURL( url ):
def testPayload( url, payload ):
t_urlparse = urlparse(url)
u = t_urlparse.scheme + '_' + t_urlparse.netloc

if not u in t_exceptions:
t_exceptions[u] = 0
if t_exceptions[u] >= MAX_EXCEPTION:
if _verbose >= 3:
print("skip too many exceptions %s" % t_urlparse.netloc)
return

if not u in t_vulnerable:
t_vulnerable[u] = 0
if t_vulnerable[u] >= MAX_VULNERABLE:
Expand All @@ -96,12 +96,12 @@ def testPayload( url, payload ):
if _verbose >= 3:
sys.stdout.write( "%s[-] error occurred: %s%s\n" % (fg('red'),e,attr(0)) )
return

if 'Content-Type' in r.headers:
content_type = r.headers['Content-Type']
else:
content_type = '-'

vuln = '-'
if 'Access-Control-Allow-Credentials' in r.headers and r.headers['Access-Control-Allow-Credentials'] == 'true':
if 'Access-Control-Allow-Origin' in r.headers:
Expand All @@ -118,7 +118,10 @@ def testPayload( url, payload ):
fp.close()

if _verbose >= 2 or (_verbose >= 1 and vuln == 'VULNERABLE'):
sys.stdout.write( '%s' % output )
if vuln == 'VULNERABLE':
sys.stdout.write( '%s%s%s' % (fg('light_red'),output,attr(0)) )
else:
sys.stdout.write( output )
if _verbose >= 3:
sys.stdout.write( '%s%s%s\n' % (fg('dark_gray'),headers,attr(0)) )

Expand Down
28 changes: 14 additions & 14 deletions crlf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.5
#!/usr/bin/python3

# I don't believe in license.
# You can do whatever you want with this program.
Expand Down Expand Up @@ -28,12 +28,12 @@

def banner():
print("""
_ __
___ _ __| |/ _| _ __ _ _
_ __
___ _ __| |/ _| _ __ _ _
/ __| '__| | |_ | '_ \| | | |
| (__| | | | _| _ | |_) | |_| |
\___|_| |_|_| (_) | .__/ \__, |
|_| |___/
|_| |___/
by @gwendallecoguic
Expand Down Expand Up @@ -63,7 +63,7 @@ def _parse_qs( query ):
t_params[pname] = []
pvalue = '' if len(t_param) < 2 else t_param[1]
t_params[pname].append( pvalue )

return t_params


Expand Down Expand Up @@ -101,7 +101,7 @@ def testFragment( t_urlparse, payload ):
def testPath( t_urlparse, payload ):
path = ''
t_path = ['/'] + t_urlparse.path.split('/')

for dir in t_path:
if len(dir):
path = path + '/' + dir
Expand Down Expand Up @@ -159,14 +159,14 @@ def realDoTest( t_params ):

t_urlparse = urllib.parse.urlparse(url)
u = t_urlparse.scheme + '_' + t_urlparse.netloc

if not u in t_exceptions:
t_exceptions[u] = 0
if t_exceptions[u] >= MAX_EXCEPTION:
if _verbose >= 3:
print("skip too many exceptions %s" % t_urlparse.netloc)
return

if not u in t_vulnerable:
t_vulnerable[u] = 0
if t_vulnerable[u] >= MAX_VULNERABLE:
Expand All @@ -189,13 +189,13 @@ def realDoTest( t_params ):
content_type = r.headers['Content-Type']
else:
content_type = '-'

t_headers = list( map( str.lower,r.headers.keys() ) )
if 'xcrlf' in t_headers:
vuln = 'VULNERABLE'
else:
vuln = '-'

if vuln == 'VULNERABLE':
t_vulnerable[u] = t_vulnerable[u] + 1

Expand Down Expand Up @@ -223,14 +223,14 @@ def realDoTest( t_params ):

# t_urlparse = urlparse(url)
# u = t_urlparse.scheme + '_' + t_urlparse.netloc

# if not u in t_exceptions:
# t_exceptions[u] = 0
# if t_exceptions[u] >= MAX_EXCEPTION:
# if _verbose >= 3:
# print("skip too many exceptions %s" % t_urlparse.netloc)
# return

# if not u in t_vulnerable:
# t_vulnerable[u] = 0
# if t_vulnerable[u] >= MAX_VULNERABLE:
Expand All @@ -250,13 +250,13 @@ def realDoTest( t_params ):
# content_type = r.headers['Content-Type']
# else:
# content_type = '-'

# t_headers = list( map( str.lower,r.headers.keys() ) )
# if 'xcrlf' in t_headers:
# vuln = 'VULNERABLE'
# else:
# vuln = '-'

# if vuln == 'VULNERABLE':
# t_vulnerable[u] = t_vulnerable[u] + 1

Expand Down
12 changes: 6 additions & 6 deletions csp-analyzer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python2.7
#!/usr/bin/python2

import sys
import requests
Expand All @@ -9,12 +9,12 @@

def banner():
print("""
_
___ ___ _ __ __ _ _ __ __ _| |_ _ _______ _ __ _ __ _ _
_
___ ___ _ __ __ _ _ __ __ _| |_ _ _______ _ __ _ __ _ _
/ __/ __| '_ \ / _` | '_ \ / _` | | | | |_ / _ \ '__| | '_ \| | | |
| (__\__ \ |_) | | (_| | | | | (_| | | |_| |/ / __/ | _ | |_) | |_| |
\___|___/ .__/ \__,_|_| |_|\__,_|_|\__, /___\___|_| (_) | .__/ \__, |
|_| |___/ |_| |___/
|_| |___/ |_| |___/
by @gwendallecoguic
Expand Down Expand Up @@ -120,13 +120,13 @@ def usage( err='' ):

def getWarningLevel( t_tld_orig, item ):
w_level = 0

if item in t_help:
return 0

if not item.startswith('http'):
item = 'https://'+item

tmp_parse = urlparse( item )
tmp_tld = tldextract.extract( tmp_parse.netloc )
# print(tmp_parse)
Expand Down
14 changes: 7 additions & 7 deletions dnsexpire.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3.5
#!/usr/bin/python3

# I don't believe in license.
# You can do whatever you want with this program.
Expand All @@ -21,12 +21,12 @@

def banner():
print("""
_ _
__| |_ __ ___ _____ ___ __ (_)_ __ ___ _ __ _ _
_ _
__| |_ __ ___ _____ ___ __ (_)_ __ ___ _ __ _ _
/ _` | '_ \/ __|/ _ \ \/ / '_ \| | '__/ _ \ | '_ \| | | |
| (_| | | | \__ \ __/> <| |_) | | | | __/ _ | |_) | |_| |
\__,_|_| |_|___/\___/_/\_\ .__/|_|_| \___| (_) | .__/ \__, |
|_| |_| |___/
|_| |_| |___/
by @gwendallecoguic
Expand Down Expand Up @@ -113,7 +113,7 @@ def getWhois( domain ):
def getExpirationDate( domain ):
whois = getWhois( domain )
# print(type(whois))

if not type(whois) is bool and 'expiration_date' in whois:
# if type(whois.expiration_date) is list:
# return whois.expiration_date[0]
Expand Down Expand Up @@ -173,7 +173,7 @@ def dnsexpire( host ):
else:
is_alias = re.findall( r'(.*) is an alias for (.*)\.', resolution );
# print(is_alias)

if not _testall and not is_alias:
if not _verbose:
sys.stdout.write( '%s%s is not an alias%s\n' % (fg('dark_gray'),host,attr(0)) )
Expand All @@ -192,7 +192,7 @@ def dnsexpire( host ):

if _verbose < 2 or ('WARNING' in output or 'TAKEOVER' in output): # remove the "progress:" text
sys.stdout.write( '%s\n%s' % (' '.rjust(100,' '),output) )

if not _testall:
sys.stdout.write( '\n' )

Expand Down
Loading

0 comments on commit b85792d

Please sign in to comment.