• Stars
    star
    539
  • Rank 82,402 (Top 2 %)
  • Language
    Go
  • Created about 3 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

自动化Host碰撞工具,帮助红队快速扩展网络边界,获取更多目标点

hostscan

中文Readme

What is hostscan

Auto Host Collsion Tool, In order to help RedTeam quickly expand the network boundary and access more target points

Why hostscan ??

In many cases, when accessing the target website, it cannot be accessed using its real IP, and only the domain name can access the back-end business services. This is because the Reverse proxy server (such as nginx) is configured to prohibit direct IP access.

The business behind nginx is sometimes hidden:

  1. Services that are not open to external networks, such as test services
  2. The original DNS was resolved to the external network, but the A record was later deleted (the business after nginx was not deleted and transferred to the internal network access)

How to access these hidden businesses? This requires the appearance of today's protagonist-Host collision technology

Example

./hostscan -d test.com -i 127.0.0.1:3333
./hostscan -D input/hosts.txt -I input/ips.txt -O out/output.txt -T 5 -t 10 -U

Usage

Please download the version of the corresponding platform in the release

Notice:

  • Default thread only set to 3, if the network is ok, thread can be set up to rlimit.
  • Default UserAgent use golang-hostscan/xxxx, if you want to use random UA, please add param '-U'.
  • Support the large input file, Now there is no worry about OOM.
hostscan --help
  
/ )( \ /  \ / ___)(_  _)/ ___) / __) / _\ (  ( \
) __ ((  O )\___ \  )(  \___ \( (__ /    \/    /
\_)(_/ \__/ (____/ (__) (____/ \___)\_/\_/\_)__)        
Usage of hostscan:
  -D string
        Hosts in file to test
  -I string
        Nginx Ip in file to test
  -O string
        Output File (default "result.txt")
  -T int
        Thread for Http connection. (default 3)
  -U    Open to send random UserAgent to avoid bot detection.
  -d string
        Host to test
  -i string
        Nginx IP
  -t int
        Timeout for Http connection. (default 5)
  -v    Show hostscan version

Demo

Test the vultarget below

Host Collsion Success

demo

Get status 400

demo

Test Vultarget

Docker

docker pull vultarget/host_collision
docker run -it -p 3333:8080 --rm vultarget/host_collision

Nginx Configuration

Reverse proxy server (Core)

server {
    listen  8080  default_server;
    server_name _;
    return 400;
}
server {
    listen  8080;
    server_name test.com;


    location / {
        proxy_pass http://127.0.0.1:80;
        proxy_redirect off;
        proxy_set_header Host $host:$server_port;
        proxy_set_header X-Real-IP $remote_addr;
            root    html;
        index   index.html  index.htm;
    }
    access_log logs/test.com.log;
}

The first server indicates that, when the host is empty, it will return 400 status

The second server indicates that nginx will forward the service according to the incoming host, and the business accessed by test.com is the service on 127.0.0.1:80

Example Web

server {
    listen       80;
    server_name  localhost;


    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }


    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }
}

Simple Nginx Web Page.

References

Fofapro's Hosts_scan

More Repositories

1

vulbase

各大漏洞文库合集
HTML
735
star
2

JNDI-Injection-Exploit-Plus

80+ Gadgets(30 More than ysoserial). JNDI-Injection-Exploit-Plus is a tool for generating workable JNDI links and provide background services by starting RMI server,LDAP server and HTTP server.
Java
706
star
3

reapoc

OpenSource Poc && Vulnerable-Target Storage Box.
PHP
677
star
4

awesome-gpt-security

A curated list of awesome security tools, experimental case or other interesting things with LLM or GPT.
514
star
5

py2sec

🐍 py2sec is a Cross-Platform, Fast and Flexible tool to change the .py to .so(Linux and Mac) or .pyd(Win).
Python
488
star
6

HackChrome

⛄ Get the User:Password from Chrome(include version < 80 and version > 80)
Go
333
star
7

SuperAdapters

Finetune ALL LLMs with ALL Adapeters on ALL Platforms!
Python
286
star
8

pocsploit

a lightweight, flexible and novel open source poc verification framework
Python
234
star
9

py2so

🐍 py2so is tool to change the .py to .so, you can use it to hide the source code of py [Deprecated]. Please navigate to Py2sec
Python
140
star
10

spring-cloud-function-SpEL-RCE

spring-cloud-function SpEL RCE, Vultarget & Poc
Java
133
star
11

YarnRpcRCE

79
star
12

colorsys-go

🎃 colorsys-go is a go package(or lib) for everyone to transform one color system to another. The transformation is among RGB, YIQ, HLS and HSV.
Go
78
star
13

InformationGather

SRC Assets Information Gather Website(SRC资产信息聚合网站)
Vue
61
star
14

netuser

Add or Delete User via windows api,it can be used when .net is inaccessible.
C++
38
star
15

MosaicImage

自动获取用户指定类别图片,并制作马赛克图片
Go
31
star
16

CVE-2022-40146_Exploit_Jar

Java
31
star
17

PocCollect

Poc Collected for study and develop
HTML
30
star
18

ICS-Protocal-Detect-Nmap-Script

Some nmap scripts to detetct the infomations of the different ICS Here are 16 main ics protocal scan-scripts include Modbus, S7 and so on.
Lua
29
star
19

Shyvana

A full vul scanner which contains many aspects (adding)
Go
28
star
20

gitAutoStar

配合GitStar编写的自动Star工具,稳定快速,跨平台
Go
21
star
21

log4shell_1.x

log4j 1.x RCE Poc -- CVE-2021-4104
Java
20
star
22

Log4j_CVE-2021-45046

Log4j 2.15.0 Privilege Escalation -- CVE-2021-45046
Java
20
star
23

simHtml

Compare html similarity using structural and style metrics
Go
19
star
24

Log4j_dos_CVE-2021-45105

Log4j_dos_CVE-2021-45105
Java
13
star
25

nginx_vultarget

Python
13
star
26

gitAutoStar-py

最新版gitStar自动点赞,使用selenium
Python
11
star
27

HaveIReg

HaveIReg用于查找出特定用户在哪些网站注册过
Python
8
star
28

Interview

面试题整理分享(持续更新ing)
Batchfile
8
star
29

cckuailong.github.io

Writing 1000 Words a Day Changed My Life
HTML
7
star
30

Small_Functions

Some interesting code fragments to please
HTML
6
star
31

awesome-ml-for-cybersecurity-books

PDF books for awesome-ml-for-cybersecurity-books
6
star
32

CS-Fun-500-Questions

计算机科学中有趣的500问
Batchfile
5
star
33

DgaDetect

Use Keras or TFLearn to detetct DGA via LSTM, AMSGrad and NAdam
Python
5
star
34

log4j_RCE_CVE-2021-44832

Java
4
star
35

BGPStream_Operate_Plugin

I write two shell scripts to help people create or delete the bgpcorsaro's plugin with only one shell command.
C
4
star
36

KerGaNs

Various GANs with Keras (With diginmon generator as example)
Python
4
star
37

WebsiteApp

We provide a tiny Anddroid App which collects many website for whoerver wants to get the main information of news in a short time
Java
4
star
38

CVE-2021-2471

Java
3
star
39

Learning

好文章收集整理
3
star
40

Colorsys.jl

🌈 Colorsys.jl is a Julia package(or lib) for everyone to transform one color system to another. The transformation is among RGB, YIQ, HLS and HSV.
Julia
3
star
41

vultarget_web

Python
3
star
42

pget

pget is a go package for people to add parallel download func into there project. (Adapt from the go download client [https://github.com/Code-Hex/pget])
Go
3
star
43

clonehub

clone all images(with all tags) on dockerhub to your own dockerhub repo
Shell
2
star
44

Test-JNDI-Injection-Exploit-Plus

Examples for JNDI-Injection-Exploit-Plus
Java
2
star
45

DLMovies

提供查询下载电影的网站,爬取各大电影网站
Go
2
star
46

apereo-cas-docker

apereo cas docker-compose (can customize cas version)
Dockerfile
2
star
47

Dga.jl

Dga.jl can make you customize one or many DGAs. The included DGAs are [Banjori,Corebot,Cryptolocker,Dircrypt,Kraken,Lockyv2,Pykspa,Qakbot Ramdo,Ramnit,Simda]
Julia
2
star
48

Spark-Scala-Handle

Scala
1
star
49

Leetcode-go

Leetcode write in Golang.
Go
1
star
50

gunicorn_request_smuggling

gunicorn 20.0.4 request smuggling
Python
1
star
51

Spiders

随便写的爬虫
Python
1
star
52

Paper_torrent

Academic papers to download, the data is more than 10 TB
1
star