text
stringlengths
1
93.6k
def writeToFile(self, array):
with open(self.domain + ".txt", "a") as file:
for line in array:
file.write(line + "\n")
def manipulateRequest(self):
print((" Target URL: " + self.url + "\tTarget Path: " + self.dir + " ").center(121, "="))
results = []
p = requests.post(self.url + self.dir)
colour = self.checkStatusCode(p.status_code)
reset = Style.RESET_ALL
line_width = 100
target_address = "POST --> " + self.url + self.dir
info = f"STATUS: {colour}{p.status_code}{reset}\tSIZE: {len(p.content)}"
info_pure = f"STATUS: {p.status_code}\tSIZE: {len(p.content)}"
remaining = line_width - len(target_address)
print("\n" + target_address + " " * remaining + info)
results.append(target_address + " " * remaining + info_pure)
self.writeToFile(results)
self.manipulatePath()
def manipulatePath(self):
results = []
reset = Style.RESET_ALL
line_width = 100
for path in self.dirObject.newPaths:
r = requests.get(self.url + path)
colour = self.checkStatusCode(r.status_code)
target_address = "GET --> " + self.url + path
info = f"STATUS: {colour}{r.status_code}{reset}\tSIZE: {len(r.content)}"
info_pure = f"STATUS: {r.status_code}\tSIZE: {len(r.content)}"
remaining = line_width - len(target_address)
print(target_address + " " * remaining + info)
results.append(target_address + " " * remaining + info_pure)
self.writeToFile(results)
self.manipulateHeaders()
def manipulateHeaders(self):
results = []
line_width = 100
for header in self.dirObject.newHeaders:
r = requests.get(self.url + self.dir, headers=header)
colour = self.checkStatusCode(r.status_code)
reset = Style.RESET_ALL
target_address = "GET --> " + self.url + self.dir
info = f"STATUS: {colour}{r.status_code}{reset}\tSIZE: {len(r.content)}"
info_pure = f"STATUS: {r.status_code}\tSIZE: {len(r.content)}"
remaining = line_width - len(target_address)
print("\n" + target_address + " " * remaining + info)
print(f"Header= {header}")
results.append("\n" + target_address + " " * remaining + info_pure + f"\nHeader= {header}")
self.writeToFile(results)
results_2 = []
for header in self.dirObject.rewriteHeaders:
r = requests.get(self.url, headers=header)
colour = self.checkStatusCode(r.status_code)
reset = Style.RESET_ALL
target_address = "GET --> " + self.url
info = f"STATUS: {colour}{r.status_code}{reset}\tSIZE: {len(r.content)}"
info_pure = f"STATUS: {r.status_code}\tSIZE: {len(r.content)}"
remaining = line_width - len(target_address)
print("\n" + target_address + " " * remaining + info)
print(f"Header= {header}")
results_2.append("\n" + target_address + " " * remaining + info_pure + f"\nHeader= {header}")
self.writeToFile(results_2)
class Program():
def __init__(self, urllist, dirlist):
self.urllist = urllist
self.dirlist = dirlist
def initialise(self):
for u in self.urllist:
for d in self.dirlist:
if d != "/":