Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pylint alerts corrections as part of intervention experiment #34

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
2 changes: 0 additions & 2 deletions Vi/vi.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ def parse_javascript_file(js_filename: str):
'''
TYPE = 'DEBUG'
print(f"[{TYPE}] parsing {js_filename} for interesting stuff...")
pass


def tear_off():
Expand All @@ -61,7 +60,6 @@ def tear_off():
for js_filename in javascript_files:
parse_javascript_file(js_filename)

pass


def recon(emails: set, javascript_files: set):
Expand Down
39 changes: 22 additions & 17 deletions denumerator/denumerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,15 +408,7 @@ def enumerate_domains(domains, output_file, html_output, allowed_http_responses,
# IP address
ip = subprocess.run(
["host", d], capture_output=True, timeout=15).stdout
nmap_output = ''

if nmap == True:
# perform nmap scan
nmap_output = subprocess.run(
["nmap", "--top-ports", str(nmap_top_ports), "-n", d], capture_output=True)
print('{} nmap: '.format(colors['grey']), [port.decode("utf-8")
for port in nmap_output.stdout.split(b"\n") if
port.find(b"open") > 0], '{}'.format(colors['white']))
nmap_output = _handle_nmap(nmap_top_ports, d)

send_request('http', d, output_file,
html_output, allowed_http_responses, nmap_output, ip, output_directory)
Expand All @@ -442,13 +434,22 @@ def enumerate_domains(domains, output_file, html_output, allowed_http_responses,
except requests.exceptions.TooManyRedirects:
if show is True:
print('[-] {} probably went into redirects loop :('.format(d))
except UnicodeError:
pass
except subprocess.TimeoutExpired:
pass
else:
pass

def _handle_nmap(nmap_top_ports, d):
nmap_output = ''

if nmap == True:
# perform nmap scan
nmap_output = subprocess.run(
["nmap", "--top-ports", str(nmap_top_ports), "-n", d], capture_output=True)
print('{} nmap: '.format(colors['grey']), [port.decode("utf-8")
for port in nmap_output.stdout.split(b"\n") if
port.find(b"open") > 0], '{}'.format(colors['white']))

return nmap_output


def enumerate_from_crt_sh(domain):
'''
Expand Down Expand Up @@ -506,10 +507,7 @@ def main():
if args.nmap:
nmap = True

if args.dir:
output_directory = args.dir
else:
output_directory = DEFAULT_DIRECTORY
output_directory = _set_output_directory(args)

if args.code:
allowed_http_responses = args.code.split(',')
Expand Down Expand Up @@ -560,6 +558,13 @@ def main():
if args.output:
output_file.close()

def _set_output_directory(args):
if args.dir:
output_directory = args.dir
else:
output_directory = DEFAULT_DIRECTORY
return output_directory


if __name__ == "__main__":
main()
7 changes: 0 additions & 7 deletions diggit/diggit.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@
"endl": '\33[0m'
}


def print_banner():
"""Prints credits :)"""
pass


def print_object_details(objtype, objcontent, objhash, objfilename):
"""Prints and saves object details/content"""

Expand Down Expand Up @@ -132,6 +126,5 @@ def save_git_object(baseurl, objhash, berecursive, objfilename=""):
parser.print_help()

if baseurl and objecthash:
print_banner()
save_git_object(args.u, args.o, berecursive, "")
print("\n" + term["cyan"] + "#" * 78 + term["endl"])
2 changes: 1 addition & 1 deletion hasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def main(s):


if __name__ == "__main__":
if (len(sys.argv) == 2):
if len(sys.argv) == 2:
arguments = sys.argv[1:]
main(arguments[0])
else:
Expand Down
6 changes: 4 additions & 2 deletions hexview/hexview.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,11 @@ def extract_shellcode(start, end, read_binary):
print(file_type(open(arguments.file, "rb").read(8)))

with open(arguments.file, "rb") as infile:
valid_start = arguments.start is not None and int(arguments.start) > -1
valid_end = arguments.end is not None and (int(arguments.end) > 1)
if (
arguments.start is not None and int(arguments.start) > -1
and arguments.end is not None and (int(arguments.end) > 1)
valid_start
and valid_end
and (
int(arguments.start, 16) > -
1 and int(arguments.end, 16) > int(arguments.start, 16)
Expand Down
3 changes: 2 additions & 1 deletion ip_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def generate(start, stop, logfile):

start = sys.argv[1].split(".")
stop = sys.argv[2].split(".")
print("\n[+] generating IP addresses in range from {} to {}...".format(sys.argv[1], sys.argv[2]))
print("\n[+] generating IP addresses in range from {} to {}...".format(sys.argv[1],
sys.argv[2]))
generate(start, stop, f)
print("[+] addresses generated...\n")
4 changes: 3 additions & 1 deletion redir_gen/redirgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ def save_output(output: str) -> None:
parser = argparse.ArgumentParser()
parser.add_argument("--target", "-t", action="store",
help="Enter the target address", required=True)
parser.add_argument("--dest", "-d", action="store", help="Enter the address where you want to redirect to",
parser.add_argument("--dest", "-d",
action="store",
help="Enter the address where you want to redirect to",
required=True)
parser.add_argument("--output", "-o", action="store",
help="Enter output file name")
Expand Down
2 changes: 1 addition & 1 deletion virustotal.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def process(cidr, logfile):
if resp.status_code == 200:
domains = json.loads(resp.text)

if (domains['response_code'] == 0):
if domains['response_code'] == 0:
print("[-] Empty response for {}".format(str(ip)))
time.sleep(15)
continue
Expand Down
8 changes: 6 additions & 2 deletions xmlrpc_amplif_bruteforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,18 @@ def send_request_with_username(username, passwords):

# print(payload)

print("[+] sending POST request with payload... ({} credentials in total checked)".format(total))
print(
"[+] sending POST request with payload... ({} credentials in total checked)".format(total))
resp = requests.post(url, headers=h, data=payload)

if resp.status_code == 200:
print("[+] response HTTP 200 OK received, analysing results...")
# p0wned. This is the end :P
if b"isAdmin" in resp.content:
print("[+] SUCCESS !!! Matching username/password for {} found!, please review response content for details...").format(username)
print(
"[+] SUCCESS !!! Matching username/password for {} found!,"
+ "please review response content for details..."
).format(username)
output.write(resp.content)
exit(0)

Expand Down