Skip to content

Commit 2a1beb6

Browse files
committed
PEP8 refactoring
1 parent b134b08 commit 2a1beb6

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

reconnoitre/directory_helper.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ def check_directory(output_directory):
88
os.mkdir(output_directory)
99
print("[!] %s didn't exist and has been created." % output_directory)
1010

11+
1112
def load_targets(target_hosts, output_directory, quiet):
1213
if(os.path.isdir(target_hosts) or os.path.isfile(target_hosts)):
1314
return target_hosts
1415
else:
1516
return output_directory + "/targets.txt"
1617

18+
1719
def create_dir_structure(ip_address, output_directory):
1820
print("[+] Creating directory structure for " + ip_address)
1921

@@ -43,7 +45,7 @@ def create_dir_structure(ip_address, output_directory):
4345
os.stat(lootdir)
4446
except:
4547
os.mkdir(lootdir)
46-
#todo: check if proof file already exists and don't overwrite if it does
48+
4749
prooffile = hostdir + "/proof.txt"
4850
print(" [>] Creating proof file at: %s" % prooffile)
4951
open(prooffile, 'a').close()

reconnoitre/find_dns.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ def find_dns(target_hosts, output_directory, quiet):
99
check_directory(output_directory)
1010
results = 0
1111
hostcount = 0
12-
12+
1313
output_file = open(output_directory + "/DNS-Detailed.txt", 'w')
1414
output_targets = open(output_directory + "/DNS-targets.txt", 'w')
1515

1616
targets = load_targets(target_hosts, output_directory, quiet)
1717
target_file = open(targets, 'r')
18-
18+
1919
print("[*] Loaded targets from: %s" % targets)
2020
print("[+] Enumerating TCP port 53 over targets to find dns servers")
2121

reconnoitre/ping_sweeper.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ def ping_sweeper(target_hosts, output_directory, quiet):
3030
live_hosts += 1
3131
print("[*] Found %s live hosts" % (live_hosts))
3232
print("[*] Created target list %s" % (output_file))
33-
f.close()
34-
33+
f.close()

reconnoitre/reconnoitre.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ def print_banner():
1111
print("|\"\"\"\-= RECONNOITRE")
1212
print("(____) An OSCP scanner\n")
1313

14+
1415
def main():
1516
parser = ArgumentParser()
1617
parser.add_argument("-t", dest="target_hosts", required=True, help="Set a target range of addresses to target. Ex 10.11.1.1-255" )
@@ -45,5 +46,7 @@ def main():
4546
service_scan(arguments.target_hosts, arguments.output_directory, arguments.dns, arguments.quiet)
4647
else:
4748
service_scan(arguments.target_hosts, arguments.output_directory, '', arguments.quiet)
49+
50+
4851
if __name__ == "__main__":
4952
main()

reconnoitre/service_scan.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,15 @@ def nmapScan(ip_address, outputdir, dns_server):
128128
print("[*] TCP/UDP Nmap scans completed for %s" % ip_address)
129129
return
130130

131+
131132
def valid_ip(address):
132133
try:
133134
socket.inet_aton(address)
134135
return True
135136
except socket.error:
136137
return False
137138

139+
138140
def target_file(target_hosts, output_directory, dns_server, quiet):
139141
targets = load_targets(target_hosts, output_directory, quiet)
140142
target_file = open(targets, 'r')
@@ -159,6 +161,7 @@ def target_file(target_hosts, output_directory, dns_server, quiet):
159161
p.start()
160162
target_file.close()
161163

164+
162165
def target_ip(target_hosts, output_directory, dns_server, quiet):
163166
print("[*] Loaded single target: %s" % target_hosts)
164167
target_hosts = target_hosts.strip()
@@ -172,6 +175,7 @@ def target_ip(target_hosts, output_directory, dns_server, quiet):
172175
jobs.append(p)
173176
p.start()
174177

178+
175179
def service_scan(target_hosts, output_directory, dns_server, quiet):
176180
check_directory(output_directory)
177181

0 commit comments

Comments
 (0)