iis服务器助手广告广告
返回顶部
首页 > 资讯 > 后端开发 > Python >基于Python3的漏洞检测工具 ( P
  • 793
分享到

基于Python3的漏洞检测工具 ( P

漏洞检测工具 2023-01-31 08:01:21 793人浏览 泡泡鱼

Python 官方文档:入门教程 => 点击学习

摘要

[TOC] lance, a simple version of the vulnerability detection framework based on python3. 基于python3的简单版漏洞检测框架 -- lance 可

[TOC]

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

基于python3的简单版漏洞检测框架 -- lance

可以自定义poc或exp插件,可以指定要加载的poc或exp。

代码已经上传到GitHub : https://github.com/b4zinga/lance

screenshot

screenshot of lance

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

说明文档 : 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

代码已经上传到github : https://github.com/b4zinga/lance

--结束END--

本文标题: 基于Python3的漏洞检测工具 ( P

本文链接: https://www.lsjlt.com/news/192571.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作