text
stringlengths
1
93.6k
try:
with open(os.path.join(DEBUG_LOC, "httpd.log"), "a", encoding="utf-8") as buf:
buf.write("%s - %s - [%s] %s\n" % (self.address_string(), self.headers.get("Host"), self.log_date_time_string(), fmt % args))
except (IOError, PermissionError):
pass
if SETTINGS["Debug"]:
sys.stderr.write("%s - %s - [%s] %s\n" % (self.address_string(), self.headers.get("Host"), self.log_date_time_string(), fmt % args))
def check_root():
root = True
try:
if SETTINGS["Root_Check"]:
root = bool(os.getuid() == 0)
except AttributeError:
pass
return root
def get_lan():
ip = ""
soc = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
soc.connect(("10.255.255.255", 1))
ip = str(soc.getsockname()[0])
soc.close()
except socket.error:
soc.close()
return ip
def print_line():
print("##########################################################")
def center_menu_item(entry):
num = int((56 - len(entry)) / 2)
entry = "#" + (" " * num) + entry + (" " * num) + "#"
if len(entry) < 58:
entry = entry[:-1] + " #"
return entry
def payload_menu_item(number, entry):
entry = f"# {number}. {entry}"
if len(entry) > 58:
entry = entry[:56]
while len(entry) < 56:
entry += " "
entry += " #"
return entry
def payload_menu(input_array):
i = 1
choice = 0
print_line()
print("# Payload #")
print_line()
for entry in input_array:
print(payload_menu_item(i, entry))
i += 1
print_line()
while choice < 1 or choice >= i:
input_prompt = "Choose a payload to send: "
choice = input(input_prompt)
try:
choice = int(choice)
except (ValueError, NameError):
choice = 0
return choice - 1
def menu_header():
print_line()
version_spacing = VERSION
while len(version_spacing) < 29:
version_spacing += " "
print(f"# Exploit Host v{version_spacing}by Al Azif #")
print_line()
def ip_display():
if SETTINGS["HTTP"] and SETTINGS["DNS"]:
server_string = "Servers are running"
else:
server_string = "Server is running"
menu = center_menu_item(f"{server_string}")
if SETTINGS["HTTP"]: