Skip to content

Instantly share code, notes, and snippets.

@ttycelery
Last active December 5, 2017 06:58
Show Gist options
  • Save ttycelery/d930f21c134b355b5c1d4efd759e2d21 to your computer and use it in GitHub Desktop.
Save ttycelery/d930f21c134b355b5c1d4efd759e2d21 to your computer and use it in GitHub Desktop.
FEC KCFinder
#!/usr/bin/python
path = "panel/kcfinder/upload.php"
indicator = "Unknown" # don't change
import requests
import sys
print """\
+-+-+-+ File Existency Checker (KCFinder)
|F|E|C| Simple Version
+-+-+-+ https://github.com/p4kl0nc4t
"""
if len(sys.argv) != 2:
raise Exception("Usage: python {} [sites.txt]".format(sys.argv[0]))
x = open(sys.argv[1], "r")
i = 1
for line in x.readlines():
line = line.rstrip()
symbol = ""
indicator = ""
if line[len(line)-1] != "/":
symbol = "/"
if path[0] == "/":
raise Exception("The given URI path is not valid! Check the script.")
url = "{}{}{}".format(line,symbol,path)
try:
request = requests.get(url)
except:
exception = True
else:
exception = False
if not exception:
if indicator in request.text:
indicator = True
else:
indicator = False
print "[{}][{}][{}] {}".format(i,request.status_code,str(indicator), url)
else:
print "[{}][exception thrown] {}".format(i, url)
i += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment