Giter Site home page Giter Site logo

ehole's Introduction

EHole(棱洞)3.0 红队重点攻击系统指纹探测工具

Author language version

[# 00x01] 简介:

     ______    __         ______
    / ____/___/ /___ ____/_  __/__  ____ _____ ___
   / __/ / __  / __ `/ _ \/ / / _ \/ __ `/ __ `__ \
  / /___/ /_/ / /_/ /  __/ / /  __/ /_/ / / / / / /
 /_____/\__,_/\__, /\___/_/  \___/\__,_/_/ /_/ /_/
			 /____/ https://forum.ywhack.com  By:shihuang         

EHole是一款对资产中重点系统指纹识别的工具,在红队作战中,信息收集是必不可少的环节,如何才能从大量的资产中提取有用的系统(如OA、VPN、Weblogic...)。EHole旨在帮助红队人员在信息收集期间能够快速从C段、大量杂乱的资产中精准定位到易被攻击的系统,从而实施进一步攻击。

20210823 Ehole 开源版,本次优化内容如下:

  • 1.支持xlsx导出结果
  • 2.支持自定义语法导出fofa结果
  • 2.支持自适应favicon的路径

感谢 Ehole 开源作者 @shihuang

20210623 EHole(棱洞)3.0版本,更新内容如下:

  • 1.多个CMS指纹识别(如一个URL同时匹配多个CMS指纹则会同时显示);
  • 2.颜色高亮(新增颜色高亮,识别到的系统会以红色进行显示,更易于区分);
  • 3.新增FOFA批量端口提取(如拿到一万甚至十万IP的情况,则可以使用-fall批量从FOFA中提取端口信息);
  • 4.优化多个识别规则,更易于识别重点系统;
  • 5.新增多条指纹,目前能识别大部分常见的系统;
  • 6.优化文件读取,更快速准确的识别内容;
  • 7.FOFA语法搜索优化,使用-fofa参数快速从fofa提取资产进行识别。

[# 00x02] 使用:

配合[红队中易被攻击的一些重点系统漏洞整理]食用效果更佳:https://forum.ywhack.com/bountytips.php?Vulnerability

EHole version: 2.0
Usage: Ehole [-f|-l] [parameter]

Options:
  -f string
        Fofa searches for assets , supports IP and IP segments。(192.168.1.1 | 192.168.1.0/24)
  -ftime string
        fofa timeout (default "10")
  -h    this help
  -json string
        out json
  -l string
        Probe based on local file
  -log string
        Log file name (default "server.log")
  -t string
        thread (default "100")

EHole(棱洞)2.0提供了两种指纹识别方式,可从本地读取识别,也可以从FOFA进行批量调用API识别(需要FOFA密钥),同时支持结果JSON格式输出。

1.本地识别:

EHole -l url.txt   //URL地址需带上协议,每行一个

2.FOFA识别:

注意:从FOFA识别需要配置FOFA 密钥以及邮箱,在config.ini内配置好密钥以及邮箱即可使用。

EHole -f 192.168.1.1/24  //支持单IP或IP段

3.结果输出:

EHole -l url.txt -json export.json  //结果输出至export.json文件

[# 00x03] 指纹编写:

EHole(棱洞)2.0改变了原有的指纹识别规则,2.0版指纹从外部文件读入,识别方式:

指纹格式:

关键字匹配:
{
		"cms": "seeyon",
		"method": "keyword",
		"location": "body",
		"keyword": ["/seeyon/USER-DATA/IMAGES/LOGIN/login.gif"]
}
faviconhash匹配:
{
		"cms": "CapRover",
		"method": "faviconhash",
		"location": "body",
		"keyword": ["988422585"]
}
  1. cms:系统名称
  2. method:识别方式 (支持三种识别方式,分别为:keyword、faviconhash、regula)
  3. location:位置(指纹识别位置,提供两个位置,一个为body,一个为header)
  4. keyword:关键字(favicon图标hash、正则表达式、关键字)

⚠️注意:keyword支持多关键字匹配,需要所有关键字匹配上才能识别。如:

"keyword": ["sys/ui/extend/theme/default/style/icon.css", "sys/ui/extend/theme/default/style/profile.css"]

[# 00x04] 使用效果:

fofa识别:

-w912

输出效果:

-w1325

ehole's People

Contributors

r0exper avatar shihuang-esec avatar sybak 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  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

ehole's Issues

建议增加fofa的语法搜索

例如--fofa domain="baidu.com",然后直接开始跑,
--fofa app="JBoss",类似这种的
--fofa app="JBoss" && country="BR"
支持大佬

无法保存

./main fofaext -l ip.txt
Enter the command line to prompt this

context deadline exceeded (Client.Timeout exceeded while awaiting headers)

由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败

师傅们,这是这种情况怎么办?
image
D:\zk\bin\EHole-main>go build main.go
go: github.com/360EntSecGroup-Skylar/[email protected]: Get "https://proxy.golang.org/github.com/360%21ent%21sec%21group-%21skylar/excelize/@v/v1.4.1.mod": dial tcp 172.217.163.49:443: connectex: 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。
go: downloading github.com/gookit/color v1.4.2
go: downloading github.com/spf13/viper v1.8.1
go: downloading github.com/spf13/cobra v1.2.1
go: downloading github.com/360EntSecGroup-Skylar/excelize v1.4.1
go: downloading github.com/PuerkitoBio/goquery v1.7.1
go: downloading github.com/twmb/murmur3 v1.1.6
go: downloading github.com/yinheli/mahonia v0.0.0-20131226213531-0eef680515cc
go: downloading golang.org/x/net v0.0.0-20210614182718-04defd469f4e
go: github.com/360EntSecGroup-Skylar/[email protected]: Get "https://proxy.golang.org/github.com/360%21ent%21sec%21group-%21skylar/excelize/@v/v1.4.1.mod": dial tcp 172.217.163.49:443: connectex: 由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。

已找到解决办法
go 在编译的时候需要指定代理
go env -w GOPROXY=https://goproxy.cn && go build main.go
image

关于只能识别一个cms的问题

我在自己添加指纹特征的时候发现一个问题,目标只能匹配一个cms规则,当出现多个规则命中,只能显示一个,导致了我自己写的规则无效。但是当原先的cms规则为None时。添加的规则就能正常显示。
希望能修复一下,出现多个规则时候能同时展示。
gi

若干建议

finger.json搜索逻辑建议

1、ehole程序目录
2、$HOME目录
3、程序运行到当前目录

结果输出

支持设置一个url,间结果以json格式发送到url
场景:结果直接写入Elasticsearch

输入

主动模式:运行设置url,定时从url获取目标
被动模式:允许post输入目标

fofa用不了

咋回事,没配错api,网页搜是有数据的
%)5 %CDXLQ%VL(TO$41T`5H

源码没有更新到最新版

师傅你好,由于自己的机器是mac 不支持你编译的程序(不支持-l参数),请问是否可以更新下最新的源码

fofa扫描无法扫描

各位大佬,为什么我用fofa扫描不行啊,我是直接下载win版来用的,是要修改那个配置吗
1657004744(1)

默认线程太快,建议增加指定线程功能

感谢分享优秀的工具

指定url时默认线程很快,线程很快这很好

但是我注意到在执行大批量url时甚至能占满家里整个宽带(100M),导致电视放不了,还有电脑上其他网络程序全部陷入停滞

点网站也失去反应,ctrl +c 终止程序后一切恢复正常

所以建议增加个能指定线程的参数,或者限制默认线程数不要太高,感谢!

提几个建议

首先非常感谢大佬开发的优秀程序,这里提几个建议,都是我使用过程中发现的问题

  • 1.输出保存支持实在太少了,只支持json输出。希望能够提供html或者csv的保存方式。
  • 2.输出保存里面竟然没有把重点资产给分开来??
  • 3.有意向开源吗,想要学习一下,或根据个人使用修改一下源码。
    希望大佬能够采纳~~

需要Fofa高级会员才能使用

代码中传入的api查询的size默认是500,而Fofa普通会员api仅允许查询前100条,因此普通会员账号不会得到任何结果
url := fofa_api(keyword1, fofa.Email, fofa.Fofa_token, i, 500)
查询返回内容如下:
{"errmsg":"401 Unauthorized, make sure 1.email and apikey is correct 2.FOFA coin is enough.","error":true}

config email参数错误

./ehole finger -f "http://xx"

 ______    __         ______
/ ____/___/ /___ ____/_  __/__  ____ _____ ___

/ / / __ / __ / _ \/ / / _ \/ __ / __ `
/ // // / // / __/ / / __/ // / / / / / /
/_/_,/__, /_/_/ _/_,// // //
/
___/ https://forum.ywhack.com By:shihuang

请耐心等待fofa搜索......
panic: reflect: call of reflect.Value.Set on zero Value

goroutine 1 [running]:
reflect.flag.mustBeAssignableSlow(0x0?)
/usr/local/go/src/reflect/value.go:255 +0x104
reflect.flag.mustBeAssignable(...)
/usr/local/go/src/reflect/value.go:249
reflect.Value.Set({0x0?, 0x0?, 0x1027c0232?}, {0x1028df320?, 0x1400026a660?, 0x1?})
/usr/local/go/src/reflect/value.go:2082 +0x58
ehole/module/finger/source.GetConfig()
/Users/user/Documents/go-project/src/EHole/module/finger/source/fofa.go:74 +0x230
ehole/module/finger/source.Fofaip({0x16d9e3742, 0x16})
/Users/user/Documents/go-project/src/EHole/module/finger/source/fofa.go:121 +0x78
ehole/cmd.glob..func1(0x102d39bc0?, {0x1027c107b?, 0x2?, 0x2?})
/Users/user/Documents/go-project/src/EHole/cmd/finger.go:46 +0x1fc
github.com/spf13/cobra.(*Command).execute(0x102d39bc0, {0x140002045e0, 0x2, 0x2})
/Users/user/Documents/go-project/pkg/mod/github.com/spf13/[email protected]/command.go:860 +0x4ac
github.com/spf13/cobra.(*Command).ExecuteC(0x102d3a0c0)
/Users/user/Documents/go-project/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x354
github.com/spf13/cobra.(*Command).Execute(...)
/Users/user/Documents/go-project/pkg/mod/github.com/spf13/[email protected]/command.go:902
ehole/cmd.Execute()
/Users/user/Documents/go-project/src/EHole/cmd/root.go:48 +0x2c
main.main()
/Users/user/Documents/go-project/src/EHole/main.go:21 +0x20

方便加个功能不,指定指纹配置路径

[error] fingerprint file error!!!

getlocalfile.go:88: fingerprint file read error: open ./finger.json: The system cannot find the file specified.

默认./finger.json,用其他方式调用会存在路径问题

批量IP段

可以添加文件的方式,对批量的IP段的支持嘛

很好用

大佬牛逼,希望继续更新

M2下运行报错

M2下运行报错:
zsh: segmentation fault ./Ehole-darwin -l url.txt

考虑加入多端口探测吗?

【1】我瞎改的,仅仅满足我临时的用法,希望官方能加上多端口

finger.go:

fingerCmd.Flags().StringVarP(&ports, "ports", "P", "", "多端口")

localfile.go:
func LocalFile(filename string, ports string) (urls []string) {
	file, err := os.Open(filename)
	if err != nil {
		log.Println("Local file read error:", err)
		color.RGBStyleFromString("237,64,35").Println("[error] the input file is wrong!!!")
		os.Exit(1)
	}
	scanner := bufio.NewScanner(file)
	for scanner.Scan() {
		test := scanner.Text()
		test = strings.Trim(test, " ")
		if test == "" {
			continue
		}
		if strings.HasPrefix(test, "http") {
			urls = append(urls, scanner.Text())
		} else {
			if ports == "" {
				urls = append(urls, "https://"+scanner.Text())
			} else {
				for _, port := range strings.Split(ports, ",") {
					urls = append(urls, "http://"+scanner.Text()+":"+port)
				}
			}
		}
	}
	return
}

【2】希望能优化下菜单,其实fofaext搜索,和正常的参数finger参数完全可以合并,更简洁的命令操作,如果后续还要加其他功能的话可以看看情况(另外fofa进入了乌云模式,是否考虑换或者卡掉。。)

【3】输入内容处理,可否通过正则筛选出ip和域名,然后通过增加端口和增加协议的方式进行探测?这样就不用每次输入文件,还需要手动对文件内容进行处理了

EHole输出的json转csv的脚本

import json
import csv
import sys
import os

print("usage:python Ehole_json2csv.py <json file path>")
csv_headers = ['url', 'cms', 'server', 'statuscode', 'length', 'title']
json_path = sys.argv[1]
# debug use 如果在终端使用,应该注释掉下面的内容,使用上面的
# json_path = "./sub_outcome.json"
if os.path.exists(json_path):
    with open(json_path, encoding="utf-8") as json_file:
        json_datas = json_file.readlines()
else:
    print(json_path, " did not exist,please check")
    exit(0)
print("read json file ", json_path, " ok")
home_path = json_path.split(".json")[0]  # 从json文件路径提取出.json前面的路径
csv_path = home_path + ".csv"  # csv的路径与json前面的路径一致
if os.path.exists(csv_path):
    print(csv_path, " has been generated,try to change your json file name or check this csv file")
    exit(0)
csv_file = open(csv_path, 'w', encoding="utf-8-sig", newline="")
csv_write = csv.writer(csv_file)
csv_write.writerow(csv_headers)
print("start write csv file...")
for json_data in json_datas:
    json_data = json_data.replace("\n", "")
    dict_data = json.loads(json_data)
    url = dict_data['url']
    cms = dict_data['cms']
    server = dict_data['server']
    statuscode = dict_data['statuscode']
    length = dict_data['length']
    title = dict_data['title']
    row_data = [url, cms, server, statuscode, length, title]
    csv_write.writerow(row_data)
print("write csv file ", csv_path, " ok")

报错

\module\finger\source\fofa.go 里头的api的url从fofa.so改成fofa.info , 重新编译后运行报错如下

image

===
解决办法config.conf:
Fofa_timeout=10

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.