created and called func

This commit is contained in:
aisthanestha
2016-09-27 09:44:24 -05:00
parent 2f1c4f430d
commit 95e53888c9

26
nmap.py
View File

@@ -56,17 +56,8 @@ def cmd_list(oa_adder):
elif menu_choice == "3": print "nmap -T4 -sX -iL ~/fping.txt %s" % oa_adder;os.system("nmap -T4 -sX -iL ~/fping.txt %s" % oa_adder)
elif menu_choice == "4": print "masscan -p80 -iL ~/fping.txt";os.system("masscan -p80 -iL ~/fping.txt")
else: print ""
###
#
#Main body of script
#
###
print "Start of script..."
#print "Generate a target list with fping? [y/n]"
def choose_fping_func():
valid_choice="0"
while valid_choice=="0":
fping_creator = raw_input("Generate a target list with fping?[y/n]").lower()
@@ -74,6 +65,7 @@ while valid_choice=="0":
elif fping_creator=="n" or fping_creator=="no": print "We will not be generating a target list with fping";valid_choice="1"
else: print "Enter a valid choice ('yes','y', 'n', 'no')"
def choose_edit_txt():
valid_open="0"
while valid_open=="0":
open_fping = raw_input("Would you like to edit ~/fping.txt?[y/n]").lower()
@@ -81,6 +73,7 @@ while valid_open=="0":
elif open_fping == "n" or open_fping=="no": print "We won't edit ~/fping.txt";valid_open="1"
else: print "Enter valid choice ('yes', 'y', 'n', 'no')"
def add_nmap_oa():
valid_oa="0"
while valid_oa=="0":
add_oa = raw_input("Do you want to add NMAP output file?[y/n]").lower()
@@ -88,6 +81,19 @@ while valid_oa=="0":
elif add_oa == "n" or add_oa=="no": print "There will be no output file for NMAP";valid_oa="1"
else: print "Enter a valid choice ('yes', 'y', 'n', 'no')"
###
#
#Main body of script
#
##
print "Start of script..."
choose_fping_func()
choose_edit_txt()
add_nmap_oa()
menu()
cmd_list(oa_adder)