我对编码有点陌生(知道如何编写基本工具),而且我对os.system("")有问题。我正在使用kali和im创建一个框架,但是它不起作用:(我尝试过使用sys.path.insert,然后我写了一些类似的东西
import sys
sys.path.insert(0, '/root/Desktop/jaws/tools')
import Setoolkit然后它起作用了,但是就像im使用if,elif和其他工具一样快,加上我将使用10种工具,所以它不能只使用一个工具。我知道这可能与init.py有关,但我在互联网上看过,我不明白,我在一个文件夹中有所有的工具,它们看起来都和上面的那个一样,只是其他的名字而已。
这是我迄今所写的代码。
import os
import sys
os.system("clear")
print """
[1] Social Engineering Tool Kit
[2] Searchsploit
[3] Medusa (Brute-Force)
[4] MsfConsole
[5] Nmap
[6] Msfvenom
[7] Aircrack-ng (WiFi hacking)
[8] Wireshark
[9] Sqlmap
[10] pico (Python)
[99] Exit JaWs
"""
tool = int(input("======>"))
if tool == '1':
os.system('clear')
os.system('setoolkit')
elif tool == '2':
os.system('clear')
os.system('searchsploit')
elif tool == '3':
os.system('clear')
os.system('SocialFish')
elif tool == '4':
os.system('clear')
os.system('medusa')
elif tool == '5':
os.system('clear')
os.system('msfconsole')
elif tool == '6':
os.system('clear')
os.system('nmap')
elif tool == '8':
os.system('clear')
os.system('msfvenom')
elif tool == '9':
os.system('clear')
os.system('aircrack-ng')
elif tool == '10':
os.system('clear')
os.system('wireshark')
elif tool == '11':
os.system('clear')
os.system('sqlmap')
elif tool == '12':
os.system('clear')
os.system('pico JaWs1.py')
elif tool == '99':
sys.exit()
os.system('clear')
else:
print("something want wrong!")当我运行它时,我会像1一样进入,唯一的问题是出了什么问题。
我很想得到一些帮助,但如果你花了很多时间,你就不需要帮助了。我正在使用python 2.7 //Anton
发布于 2018-04-25 09:51:10
您已经为tool分配了int类型
tool = int(input("======>"))同时将其与'1'、'2'、'3'...etc等str进行了比较。
https://stackoverflow.com/questions/50019045
复制相似问题