Last active
December 5, 2017 06:58
-
-
Save lc-at/d930f21c134b355b5c1d4efd759e2d21 to your computer and use it in GitHub Desktop.
FEC KCFinder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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