From 3e590324e67d6a028a0efc1663ea0ac29489319f Mon Sep 17 00:00:00 2001 From: nanshihui Date: Mon, 10 Oct 2016 17:31:11 +0800 Subject: [PATCH] change the path in zmaptool --- .idea/workspace.xml | 264 +++++++++++++++++---------- setup/environment.sh | 9 +- spidermanage/spidertool/redistool.py | 2 +- spidermanage/spidertool/zmaptool.py | 3 +- 4 files changed, 181 insertions(+), 97 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 24cb746..2d70100 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,8 +4,8 @@ - - + + @@ -72,48 +72,114 @@ - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + + + + + + + + + + + + + @@ -132,7 +198,6 @@ @@ -193,8 +259,8 @@ DEFINITION_ORDER - @@ -223,6 +289,8 @@ + + @@ -269,7 +337,7 @@ @@ -287,18 +355,16 @@ - - @@ -658,12 +724,12 @@ - - + + - + - + @@ -741,55 +807,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1036,13 +1053,6 @@ - - - - - - - @@ -1082,7 +1092,7 @@ - + @@ -1092,8 +1102,78 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/setup/environment.sh b/setup/environment.sh index acd227a..84bc7da 100644 --- a/setup/environment.sh +++ b/setup/environment.sh @@ -68,7 +68,8 @@ initpluginsql='Install plugin mysqlcft soname "mysqlcft.so"' - +help="input your mysql password" +echo $help ####init SO file @@ -77,13 +78,15 @@ result=$(mysql -uroot -s -e "${initpluginsql}") create_sql="create database datap;" result=$(mysql -uroot -s -e "${create_sql}") - +help="input your mysql password" +echo $help ####init database init_sql="source $(pwd)/../spidermanage/sqldata/Dump20160803.sql" result=$(mysql -uroot -p datap -s -e "${init_sql}") - +help="input your mysql password" +echo $help ####add user to database adduser='insert into user_table values("admin",3,3,"admin")' diff --git a/spidermanage/spidertool/redistool.py b/spidermanage/spidertool/redistool.py index b295a96..d535bd5 100644 --- a/spidermanage/spidertool/redistool.py +++ b/spidermanage/spidertool/redistool.py @@ -33,7 +33,7 @@ def expire(key,expiration): def get(key): if redisinstance is None: return None - + prev_topicList=None try: prev_topicList_redis = redisinstance.get(key) prev_topicList = prev_topicList_redis diff --git a/spidermanage/spidertool/zmaptool.py b/spidermanage/spidertool/zmaptool.py index d5c0e5c..72eb5ad 100644 --- a/spidermanage/spidertool/zmaptool.py +++ b/spidermanage/spidertool/zmaptool.py @@ -30,8 +30,9 @@ def __init__(self): # returnmsg =subprocess.call(["ls", "-l"],shell=True) def do_scan(self,port='80',num='10',needdetail='0'): path=os.getcwd() + locate=os.path.split(os.path.realpath(__file__))[0] # p= Popen(" ./zmap -B 4M -p "+port+" -N "+num+" -q -O json", stdout=PIPE, shell=True,cwd=path+'/zmap-2.1.0/src') - cmd=" zmap -w /root/github/Scan-T/spidermanage/spidertool/iparea.json -B 1M -p "+port+" -N "+num+" -q -O json" + cmd=" zmap -w "+locate+"/iparea.json -B 1M -p "+port+" -N "+num+" -q -O json" # p= Popen(" zmap -w /root/github/Scan-T/spidermanage/spidertool/iparea.json -B 1M -p "+port+" -N "+num+" -q -O json", stdout=PIPE, shell=True) import commandtool