python代码检查工具_基于Python3的漏洞检测工具 ( Python3 插件式框架 )
[TOC]
Python3 漏洞檢測工具 -- lance
lance, a simple version of the vulnerability detection framework based on Python3.
基于Python3的簡單版漏洞檢測框架 -- lance
可以自定義poc或exp插件,可以指定要加載的poc或exp。
screenshot
requirements
python3
關鍵代碼
def loadPlugin(url, poc=None):
"""load all plugins.
"""
if "://" not in url:
url = "http://" + url
url = url.strip("/")
print("[*] Target url: %s" % url)
plugin_path = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))),"plugins")
if not os.path.isdir(plugin_path):
print("[!] %s is not a directory! " % plugin_path)
raise EnvironmentError
print("[*] Plugin path: %s " % plugin_path)
items = os.listdir(plugin_path)
if poc:
print("[*] Loading %s plugins." % poc)
for item in items:
if item.endswith(".py") and not item.startswith('__'):
plugin_name = item[:-3]
if poc in plugin_name:
print("[*] Loading plugin: %s" % plugin_name)
module = importlib.import_module("plugins." + plugin_name)
try:
result = module.run(url)
if result:
print("[+] " + result)
else:
print("[-] Not Vulnerable %s " % plugin_name)
except:
print("[!] ConnectionError ")
else:
continue
else:
for item in items:
if item.endswith(".py") and not item.startswith('__'):
plugin_name = item[:-3]
print("[*] Loading plugin: %s" % plugin_name)
module = importlib.import_module("plugins." + plugin_name)
try:
result = module.run(url)
if result:
print("[+] " + result)
else:
print("[-] Not Vulnerable %s " % plugin_name)
except:
print("[!] ConnectionError ")
print("[*] Finished")
usage
please run python3 lance.py -h for help.
root@kali:~/lance# python3 lance.py
usage: python lance.py
lance. By b4zinga@outlook.com
optional arguments:
-h, --help show this help message and exit
Target:
-u URL target url.
Module:
-m module poc or exp to be loaded. defaul is all.
documents
Any advice or sugggestions
Please mail to b4zinga@outlook.com
超強干貨來襲 云風專訪:近40年碼齡,通宵達旦的技術人生總結
以上是生活随笔為你收集整理的python代码检查工具_基于Python3的漏洞检测工具 ( Python3 插件式框架 )的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: tomcat闪退没有报错_Appium在
- 下一篇: insert into select 主