溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

基于Python3的漏洞檢測工具 ( Python3 插件式框架 )

發(fā)布時(shí)間:2020-07-04 09:02:19 來源:網(wǎng)絡(luò) 閱讀:826 作者:b4zinga 欄目:安全技術(shù)

[TOC]

Python3 漏洞檢測工具 -- lance

lance, a simple version of the vulnerability detection framework based on Python3.

基于Python3的簡單版漏洞檢測框架 -- lance

可以自定義poc或exp插件,可以指定要加載的poc或exp。

代碼已經(jīng)上傳到Github : https://github.com/b4zinga/lance

screenshot

基于Python3的漏洞檢測工具 ( Python3 插件式框架 )

requirements

python3

關(guān)鍵代碼

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

說明文檔 : https://github.com/b4zinga/lance/blob/master/README.md

Guide : https://github.com/b4zinga/lance/blob/master/docs/Guide.md

ChangeLog : https://github.com/b4zinga/lance/blob/master/docs/ChangeLog.md

TODOList : https://github.com/b4zinga/lance/blob/master/docs/TODOList.md

Any advice or sugggestions

Please mail to b4zinga@outlook.com

代碼已經(jīng)上傳到Github : https://github.com/b4zinga/lance

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI