Git Product home page Git Product logo

yhy0 / jie Goto Github PK

View Code? Open in Web Editor NEW
537.0 11.0 116.0 5.9 MB

Jie stands out as a comprehensive security assessment and exploitation tool meticulously crafted for web applications. Its robust suite of features encompasses vulnerability scanning, information gathering, and exploitation, elevating it to an indispensable toolkit for both security professionals and penetration testers. 挖洞辅助工具(漏洞扫描、信息收集)

Home Page: https://jie.fireline.fun/

License: GNU Affero General Public License v3.0

Go 90.33% Makefile 0.03% JavaScript 1.92% HTML 7.72%
jie shiro-exp vulnerability vulnerability-detection vulnerability-scanners apollo-exp vulnerability-exploitation security-copilot crawler scan

jie's Introduction

Jie

What I have accomplished cannot be reversed

Release Release GitHub Repo stars GitHub forks GitHub all release

English中文

The English documentation was generated by GPT3.5

Analyze and scan traffic by using active crawler mode or passive proxy.

Please read the documentation carefully before using

Pre-requisites for use

  • nmap
  • masscan
  • chromium

You should check whether the above programs exist on your machine before using them

If you do not want to install nmap and masscan, you can use-nps to specify that port scanning will not be performed and turn off checking

Active Mode

Three built-in crawler modes are available:

Mode Corresponding Parameter
crawlergo Crawler (Headless browser mode crawler) --craw c
Default katana Crawler (Standard crawling mode using standard go http library to handle HTTP requests/responses) --craw k
katana Crawler (Headless browser mode crawler) --craw kh

When using headless mode, you can specify --show to display the crawling process of the browser.

In active mode, you can enter the Security Copilot mode by specifying --copilot, which will not exit after scanning, making it convenient to view the web results page.

./Jie web -t https://public-firing-range.appspot.com/ -p xss -o vulnerability_report.html --copilot

If the username and password for the web are not specified, a yhy/password will be automatically generated, which can be viewed in the logs. For example, the following is the automatically generated one:

INFO [cmd:webscan.go(glob):55] Security Copilot web report authorized:yhy/3TxSZw8t8w

Passive Mode (Security Copilot)

Passive proxy is implemented through go-mitmproxy.

Security Copilot

Why is it called Security Copilot? According to my idea, this is not just a vulnerability scanner, but also a comprehensive auxiliary tool.

After hanging the scanner, go through the website once. Even if there are no vulnerabilities, it should tell me the approximate information of this website (fingerprint, cdn, port information, sensitive information, API paths, subdomains, etc.), which helps in further exploration manually, assisting in vulnerability discovery, rather than just finishing the scan and considering it done, requiring manual reevaluation.

Certificate Download

HTTPS websites under passive proxy require installing certificates. The HTTPS certificate-related logic is compatible with mitmproxy,

and The certificate is automatically generated after the command is started for the first time, and the path is ~/.mitmproxy/mitmproxy-ca-cert.pem.

Install the root certificate. Installation steps can be found in the Python mitmproxy documentation: About Certificates.

Start

 ./Jie  web --listen :9081 --web 9088 --user yhy --pwd 123 --debug

This will listen on port 9081, and the web interface (SecurityCopilot) will be open on port 9088.

Set the browser's proxy to 9081, or integrate with Burp.

image-20240101121809597

image-20240101121931631

image-20240101121957058

Basic Usage

Configuration

Some configurations can be modified through Jie_config.yaml, or through the configuration interface of http://127.0.0.1:9088/ (changes made in the web interface will be updated in the configuration file in real-time).

./Jie web -h

Flags:
      --copilot          Blocking program, go to the default port 9088 to view detailed scan information.
                         In active mode, specify this parameter to block the program. After scanning, the program will not exit, and you can view information on the web port.
  -h, --help             help for web
      --listen string    use proxy resource collector, value is proxy addr, (example: 127.0.0.1:9080).
                         Proxy address listened to in passive mode, default is 127.0.0.1:9080
      --np               not run plugin.
                         Disable all plugins
  -p, --plugin strings   Vulnerable Plugin, (example: --plugin xss,csrf,sql,dir ...)
                         Specify the enabled plugins. Specify 'all' to enable all plugins.
      --poc strings      specify the nuclei poc to run, separated by ','(example: test.yml,./test/*).
                         Custom nuclei vulnerability template address
      --pwd string       Security Copilot web report authorized pwd.
                         Web page login password. If not specified, a random password will be generated.
      --show             specifies whether to show the browser in headless mode.
                         Whether to display the browser in active scanning mode
      --user string      Security Copilot web report authorized user, (example: yhy).]
                         Web page login username, default is yhy (default "yhy")
      --web string       Security Copilot web report port, (example: 9088)].
                         Web page port, default is 9088 (default "9088")

Global Flags:
      --debug           debug
  -f, --file string     target file
  -o, --out string      output report file(eg:vulnerability_report.html)
      --proxy string    proxy, (example: --proxy http://127.0.0.1:8080)
  -t, --target string   target

Download and Compile

Download the corresponding program from https://github.com/yhy0/Jie/releases/latest. The entire process is built automatically by Github Action, so

feel free to use it.

Linux/Mac

Simply execute make to compile.

Windows

export CGO_ENABLED=1;go build -ldflags "-s -w" -o Jie main.go

Integration with Burp

Passive-scan-client Plugin (Strongly Recommended)

passive-scan-client

passive-scan-client

Freely select which scanner to use via three monitoring switches. Note: JavaScript and CSS should also go through the scanner to collect information.

Setting Upstream Proxy in Burp (Not Recommended)

image-20231011213912055

The traffic of the Upstream Proxy Intruder and Repeater modules will also go through the scanner.

This will cause all traffic from manual testing to go through the scanner, which may not be ideal. This should be done as needed.

Features

The plugins internally judge whether they have been scanned based on the traffic collected passively or actively (TODO Should the scanning plugin be executed in a certain order?).

Information Gathering

  • Website fingerprint information
  • Aggregated display of URLs requested by each website
  • Website domain information: cdn/waf/cloud, resolution records
  • Jwt automatic blasting (todo generate dictionary automatically based on domain name)
  • Sensitive information
  • Active path scanning (bbscan rules, added a fingerprint field, when there is a fingerprint, only the corresponding rule will be scanned, for example, php websites will not scan springboot rules)
  • Port information
  • Collect domain names, IPs, APIs

Plugins

Some scans will recognize the language environment based on the collected fingerprint information to prevent invoking Java scanning plugins for PHP websites.

Directory Structure Scan

The scan directory is the scan plugin library, and each directory's plugin handles different situations.

  • PerFile: For each URL, including parameters, etc.
  • PerFolder: For the directory of the URL, the directory will be accessed separately
  • PerServer: For each domain, meaning a target is only scanned once
Plugin Description Default On Scope
xss Semantic analysis, prototype pollution, DOM pollution point propagation analysis true PerFile
sql Currently only implements some simple SQL injection detection true PerFile
sqlmap Forward traffic to sqlmap via specified sqlmap API for injection detection false PerFile
ssrf true PerFile
jsonp true PerFile
cmd Command execution true PerFile
xxe true PerFile
fastjson When a request is detected as json, it is patched with @a1phaboy's FastjsonScan scanner to detect fastjson; jackson is not implemented yet true PerFile
bypass403 dontgo403 403 bypass detection true PerFile
crlf crlf injection true PerFolder
iis iis high version short filename guessing [iis7.5-10.x-ShortNameFuzz]( false PerFolder
nginx-alias-traversal Directory traversal due to Nginx misconfiguration nginx true PerFolder
log4j log4j vulnerability detection, currently only tests request headers true PerFolder
bbscan bbscan rule directory scan true PerFolder
PerServer (for rules that specify the root directory)
portScan Use naabu to scan Top 1000 ports, then use fingerprintx to identify services false PerServer
brute If service blasting is enabled, service blasting will be performed after scanning the port service is detected PerServer
nuclei Integrated nuclei false PerServer
archive Utilize https://web.archive.org/ to obtain historical url links (parameters) and then scan true PerServer
poc poc module written in Go for detection. The poc module relies on fingerprint recognition, and scanning will only occur when the corresponding fingerprint is recognized. No pluginization anymore false PerServer

Logical Vulnerabilities TODO

Add multiple user cookies for authorization detection (it seems better to write tests with Burp plugins themselves, so there seems to be no need to write them here).

Third-party Libraries

package main

import (
    "github.com/logrusorgru/aurora"
    "github.com/yhy0/Jie/SCopilot"
    "github.com/yhy0/Jie/conf"
    "github.com/yhy0/Jie/crawler"
    "github.com/yhy0/Jie/pkg/mode"
    "github.com/yhy0/Jie/pkg/output"
    "github.com/yhy0/logging"
    "net/url"
)

/**
  @author: yhy
  @since: 2023/12/28
  @desc: //TODO
**/

func lib() {
    logging.Logger = logging.New(conf.GlobalConfig.Debug, "", "Jie", true)
    conf.Init()
    conf.GlobalConfig.Http.Proxy = ""
    conf.Global

Config.WebScan.Craw = "k"
    conf.GlobalConfig.WebScan.Poc = nil
    conf.GlobalConfig.Reverse.Host = "https://dig.pm/"
    conf.GlobalConfig.Passive.WebPort = "9088"
    conf.GlobalConfig.Passive.WebUser = "yhy"
    conf.GlobalConfig.Passive.WebPass = "123456" // Remember to change to a strong password

    // Enable all plugins
    for k := range conf.Plugin {
        // if k == "nuclei" || k == "poc" {
        //     continue
        // }
        conf.Plugin[k] = true
    }

    if conf.GlobalConfig.Passive.WebPort != "" {
        go SCopilot.Init()
    }

    // Initialize crawler
    crawler.NewCrawlergo(false)

    go func() {
        for v := range output.OutChannel {
            // Show in SCopilot
            if conf.GlobalConfig.Passive.WebPort != "" {
                parse, err := url.Parse(v.VulnData.Target)
                if err != nil {
                    logging.Logger.Errorln(err)
                    continue
                }
                msg := output.SCopilotData{
                    Target: v.VulnData.Target,
                }

                if v.Level == "Low" {
                    msg.InfoMsg = []output.PluginMsg{
                        {
                            Url:      v.VulnData.Target,
                            Plugin:   v.Plugin,
                            Result:   []string{v.VulnData.Payload},
                            Request:  v.VulnData.Request,
                            Response: v.VulnData.Response,
                        },
                    }
                } else {
                    msg.VulMessage = append(msg.VulMessage, v)
                }
                output.SCopilot(parse.Host, msg)
                logging.Logger.Infoln(aurora.Red(v.PrintScreen()).String())
            }
            logging.Logger.Infoln(aurora.Red(v.PrintScreen()).String())
        }
    }()
    mode.Active("http://testphp.vulnweb.com/", nil)
}

Vulnerability Exploitation (Still in Development, Low Priority)

Currently under development, even I need to look at the code for help information, detailed documentation will be written once it's done.

Due to most of the vulnerability exploitation tools being written in Java and supporting different Java versions, setting up the environment is too cumbersome and frustrating, so Jie has been redefined.

Jie: A comprehensive and powerful vulnerability scanning and exploitation tool.

The current version (1.0.0) supports exploitation of the following vulnerabilities

A Powerful security assessment and utilization tools

Usage:
  Jie [command]

Available Commands:
  apollo      apollo scan && exp
  fastjson    fastjson scan && exp
  help        Help about any command
  log4j       log4j scan && exp
  other       other scan && exp bb:BasicBrute、swagger:Swagger、nat:NginxAliasTraversal、dir:dir)
  s2          Struts2 scan && exp
  shiro       Shiro scan && exp
  web         Run a web scan task
  weblogic    WebLogic scan && exp

Flags:
      --debug           debug
  -f, --file string     target file
  -h, --help            help for Jie
  -o, --out string      output report file(eg:vulnerability_report.html)
      --proxy string    proxy, (example: --proxy http://127.0.0.1:8080)
  -t, --target string   target

Use "Jie [command] --help" for more information about a command.

For example, Shiro key vulnerability exploitation:

# Without specifying -m, it defaults to blasting the key and exploitation chain
Jie shiro -t http://127.0.0.1

# Exploitation
Jie Shiro -t http://127.0.0.1 -m exp -k 213123 -g CCK2 -e spring -km CBC --cmd whoami

Where various tools by other researchers have been stitched together, some of which are included in the description of scanning and exploiting vulnerabilities. If anything is missing, you can contact me to add it. More vulnerability exploitation will be supported later.

https://jie.fireline.fun/

References

Crawlers

crawlergo

katana

Passive Scan Proxy

https://github.com/lqqyt2423/go-mitmproxy

Xss

Semantic analysis, prototype pollution, DOM pollution point propagation analysis

https://github.com/w-digital-scanner/w13scan

https://github.com/ac0d3r/xssfinder

https://github.com/kleiton0x00/ppmap

SQL Injection

Extracted code related to detection from sqlmap

POC

Detection through fingerprint recognition

todo Not embedding the nuclei's yml files, changing to download and update online from the official website

https://github.com/projectdiscovery/nuclei

Some of the POCs in xray are written improperly, causing parsing problems, which need to be corrected. For example: response.status == 200 && response.headers["content-type"] == "text/css" && response.body.bcontains(b"$_GET['css']")

content-type should be Content-Type

But it seems there is a parsing problem.

Do not use xray's POC, only use nuclei's yml files Together with the need for organization to prevent duplicate scanning, nuclei-template's POCs are enough.

Vulnerability Scanners

https://github.com/wrenchonline/glint

https://github.com/veo/vscan

Some Other Vulnerabilities

Sensitive Information

https://github.com/mazen160/secrets-patterns-db https://github.com/pingc0y/URLFinder

Fastjson

https://github.com/a1phaboy/FastjsonScan

Fingerprinting

https://github.com/w-digital-scanner/w13scan

https://github.com/SleepingBag945/dddd

License

This code is distributed under the AGPL-3.0 license. See LICENSE in this directory.

Acknowledgments

Thanks to the open source works and blogs of various masters, as well as JetBrains' support for a series of easy-to-use IDEs for this project.

JetBrains Logo (Main) logo

Star History

Star History Chart

jie's People

Contributors

yhy0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jie's Issues

nuceli指定poc不管用

image
一直有这个提示是怎么回事呢
指定poc位置也会去下载nuclei的poc,然后每次都提示outdata,肿么搞哇

win11 编译出错,请老师指教

Win11
go 1.21.3 windows/amd64

go build

github.com/smacker/go-tree-sitter/javascript: build constraints exclude all Go files in C:\Users\yagam\go\pkg\mod\github.com\smacker\[email protected]\javascript

github.com/smacker/go-tree-sitter

C:\Users\yagam\go\pkg\mod\github.com\smacker\[email protected]\iter.go:17:18: undefined: Node
C:\Users\yagam\go\pkg\mod\github.com\smacker\[email protected]\iter.go:21:21: undefined: Node
C:\Users\yagam\go\pkg\mod\github.com\smacker\[email protected]\iter.go:25:20: undefined: Node
C:\Users\yagam\go\pkg\mod\github.com\smacker\[email protected]\iter.go:30:26: undefined: Node
C:\Users\yagam\go\pkg\mod\github.com\smacker\[email protected]\iter.go:34:20: undefined: Node
C:\Users\yagam\go\pkg\mod\github.com\smacker\[email protected]\iter.go:38:32: undefined: Node
C:\Users\yagam\go\pkg\mod\github.com\smacker\[email protected]\iter.go:43:9: undefined: Node
C:\Users\yagam\go\pkg\mod\github.com\smacker\[email protected]\iter.go:46:18: undefined: Node
C:\Users\yagam\go\pkg\mod\github.com\smacker\[email protected]\iter.go:68:40: undefined: Node

老哥,你xss的js语义分析的地方有点问题

image
这点你是不是还没写完😂,glint项目中的html语法树有点问题(我已经给提issues了),多层的节点,它解析不出来,其次glint中的语法树部分不会生成BlockComment这些,w13scan和glint结合的话需要对这一部分改改

被动扫描模式下:有时候浏览很多页面后,不就不会进行任务探测了。会卡住

hi~亲爱的大大,
被动扫描模式下:有时候浏览很多页面后,不就不会进行任务探测了。代码一直循环在Progress()函数内。
在命令行一直显示:
A total of 85 tasks have been received, 0 have been processed, and the processing rate is 0.00%

稍微调试f8跟了一下,在task\task.go下,
func (t *Task) Distribution(in *input.CrawlResult) {
if !conf.NoProgressBar {
atomic.AddInt64(&output.TaskCounter, 1)
}

t.Wg.Add()  //  运行到这里,后面的代码都运行不到了。。。

也不知道为什么;

Error executing template: template: vuln_report:54:80: executing "vuln_report" at <.VulnData.Plugin>: can't evaluate field Plugin in type output.VulnData

你好;这个软件看着就很棒~~但是目前在测试的时候,报错了。

报错内容:
ERROR [output:report.go(GenerateVulnReport):48] Error executing template: template: vuln_report:54:80: executing "vuln_report" at <.VulnData.Plugin>: can't evaluate field Plugin in type output.VulnData

测试命令如下:
./Jie web -t http://testphp.vulnweb.com/ -p all -o 1.html --copilot

系统win11;
软件版本:最新版1.0.6

mac编译问题

(base) lemonlove7@xiaobaideAir Jie-main % CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build
package github.com/yhy0/Jie
imports github.com/yhy0/Jie/cmd
imports github.com/yhy0/Jie/pkg/task
imports github.com/yhy0/Jie/scan/bbscan
imports github.com/yhy0/Jie/scan/brute
imports github.com/yhy0/Jie/scan/brute/hydra
imports github.com/tomatome/grdp/protocol/pdu
imports github.com/tomatome/grdp/protocol/t125/gcc
imports github.com/tomatome/grdp/plugin: build constraints exclude all Go files in /Users/lemonlove7/go/pkg/mod/github.com/tomatome/[email protected]/plugin
报错这个

執行go build

yhy0 你好
感謝你分享一個這麼棒的開源
但我在執行時有運到以下的錯誤
因本身對go的開發並不熟悉,我嘗試執行了go build
跑一段編譯后遇到以下錯誤:

avascript: build constraints exclude all Go files in C:\Users\XXXX\go\pkg\mod\github.com\smacker\[email protected]\javascript

\iter.go:17:18: undefined: Node
\iter.go:21:21: undefined: Node
\iter.go:25:20: undefined: Node
\iter.go:30:26: undefined: Node
\iter.go:34:20: undefined: Node
\iter.go:38:32: undefined: Node
\iter.go:43:9: undefined: Node
\iter.go:46:18: undefined: Node
\iter.go:68:40: undefined: Node

期待你的回覆及幫忙!謝謝

XSS参数生成以及条件判断可以优化

1.所有参数的值都定义为了随机数,但是有一些固定参数是要过滤的,比如submit=submit/submit=login 转换成submit=FD23V1无法复现正常发包,可以改成只单个参数进行测试或者过滤关键字

image

2.SearchInputInResponse中的if input== tagname,改为if strings.ToLower(input) == tagname
因为回显中的tagname会自动转为小写。因此syntaxAnalysis.go中多处涉及tagname的地方也要使用ToLower转化,例如:
微信图片_20230609145819
改为if _item.Details.Value.TagName ==strings.ToLower(flag)

我的影子,就足够击败你了!

Does it support fofa api

Does it support fofa api? Whether it is fofa or active/dictionary scan, there may be omissions, and the combined list is more advantageous

Ubuntu 运行报错问题

/Jie
./Jie: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.34' not found (required by ./Jie) ./Jie: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.32' not found (required by ./Jie)

运行报错

大佬有兴趣一起研究吗?

我也在写一个类似的扫描器,目前完成了sql和xss(sql的报错参考的W13scan的启发式扫描,bool和时间是参考的sqlmap),xss(参考的glint的基于语义的xss检测)

剑仙,为什么我跑每一个站点,都会有这个报错。 ERROR [waybackarchive:waybackarchive.go(Run):24] WayBackArchive err: Get "http://web.archive.org/cdx/search/cdx?url=http://39.xxx.xxx.xxx:1901/*&output=txt&fl=original&collapse=urlkey&fastLatest=true": context deadline exceeded

ERROR [waybackarchive:waybackarchive.go(Run):24] WayBackArchive err: Get "http://web.archive.org/cdx/search/cdx?url=http://39.xxx.xxx.xxx:1901/*&output=txt&fl=original&collapse=urlkey&fastLatest=true": context deadline exceeded

Nuclei

The Nuclei plugin PerServer is not called and applied.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.