首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用Python在Kali中进行主机测试自动化

用Python在Kali中进行主机测试自动化
EN

Security用户
提问于 2017-04-12 14:17:51
回答 1查看 918关注 0票数 1

我在堆栈溢出上发布了以下问题链接,并指出可能将其转发到安全交换。为方便起见,现将问题重覆如下:

我开始创建一个脚本来使用python在Kali中自动化主机设置测试。我想知道是否有任何其他“扫描”,我错过了,或可以做,以检索更多的信息,一个特定的主机?

我也想知道目前的任何扫描是否可以改进?

迄今的守则如下:

代码语言:javascript
复制
   #Automate test startup using IP Addresses
import os

def runTerminal(command,name):
    os.system("gnome-terminal --tab -e 'bash -c \"" + command+" > "+name+"\"'")

testName = raw_input("Enter the name of the current test: ")

URL = raw_input("Enter the URL: ")
print "Current test: " + testName + " using host: "+ URL

initialURL = URL.split("://",1)[1] 
if ':' in initialURL:
    port = initialURL.split(":",1)[1]
else:
    port = 0

shortURL=initialURL.split(":",1)[0]

print "URL : " + str(shortURL) + " Port: " + str(port)

#Scan web server for known vulnerabilities
print "Running Nikto..."
niktoCommand = "nikto -h "+ str(shortURL)
runTerminal(niktoCommand,testName+"Nikto.txt")

#transfer a URL or get basic headers
print "Running cURL..."
cURLCommand = "curl -kv "+ str(initialURL) 
runTerminal(cURLCommand,testName+"Curl.txt")

#Network exploration tool and security / port scanner
print "Running Nmap..."
if port == 0:
    NmapCommand = "nmap -sV -A "+str(shortURL)
else:
    NmapCommand = "nmap -sV -A "+str(shortURL)+ " -p "+ port
runTerminal(NmapCommand,testName+"Nmap.txt")

#Web Content Scanner
print "Running Dirb..."
dirbCommand = " dirb "+str(URL)
runTerminal(dirbCommand,testName+"Dirb.txt")

#Fast SSL/TLS scanner
if port == 443:
    print "Running SSLScan..."
    sslCommand = " sslscan "+str(initialURL)
    runTerminal(sslCommand,testName+"SSLScan.txt")

#Web Application Firewall Detection Tool
print "Running wafw00f..."
wafCommand = " wafw00f -av " +str(URL)
runTerminal(wafCommand,testName+"WafScan.txt")

#Scanner similar to dirb mixed with curl
print "Running UniScan..."
uniCommand = " uniscan -u " +str(URL)+" -qweds"
runTerminal(uniCommand,testName+"UniScan.txt")

到目前为止,为了保存文件,代码接受一个项目名,它还接受一个URL,然后根据特定扫描的要求将URL拆分。从那里,它将扫描特定的命令发送到一个函数,该函数在一个新的终端窗口中运行扫描。

EN

回答 1

Security用户

发布于 2017-04-12 14:57:30

我想在这个脚本中添加以下内容:

  • Nmap NSE脚本(如"--script=http*“和其他相关脚本)
  • UDP扫描(您可以使用"nmap -sU“或任何其他UDP扫描程序)

此外,确保您有良好的文字列表,您的Dirbuster/Nikto扫描,通常最简单的攻击向量是在“隐藏”的URL。

票数 0
EN
页面原文内容由Security提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://security.stackexchange.com/questions/157253

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档