Skip to content

Commit

Permalink
Merge pull request #29 from 0xPugal/test
Browse files Browse the repository at this point in the history
Update 3.0
  • Loading branch information
0xPugal authored Jun 11, 2024
2 parents 55bb068 + 5353aab commit 7c4c9e6
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 174 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<h1 align="center">
<b>SubDomz</b>
<b>Subdomz</b>
<br>
</h1>
<h3 align="center">
All-in-One (Passive) Subdomain Enumeration Tool
An Automated Subdomain Enumeration Tool
</p>

![SubDomz](https://github.com/0xPugazh/SubDomz/blob/master/SubDomz.png)
![SubDomz](https://github.com/0xPugal/SubDomz/blob/master/SubDomz.png)

-----------------------------
### What is SubDomz?
Expand All @@ -15,10 +15,9 @@ All-in-One (Passive) Subdomain Enumeration Tool

### Installation
```
git clone https://github.com/0xlittleboy/SubDomz.git
git clone https://github.com/0xPugal/Subdomz.git
cd SubDomz
chmod +x install.sh SubDomz.sh
dos2unix install.sh SubDomz.sh config.txt
chmod +x install.sh subdomz.sh check.sh
./install.sh
```

Expand All @@ -33,7 +32,7 @@ dos2unix install.sh SubDomz.sh config.txt
-s, --silent - Show only subdomains in output
-hp, --http-probe - probe for working http/https servers
-k, --keep - keep the temporary files ( output from each tool)
-p, --parallel - Run parallelly for faster results. Doesn't Work With -e/--exclude or -u/--use.
-p, --parallel - Run parallely for faster results. Doesn't Work With -e/--exclude or -u/--use.
-h, --help - Display this help message and exit
-v, --version - Display the version and exit
-ls, --list-sources - Display all available sources/tools
Expand All @@ -57,9 +56,12 @@ dos2unix install.sh SubDomz.sh config.txt
- [Alienvault](https://otx.alienvault.com)
- [Subdomain-center](https://api.subdomain.center)
- [Certspotter](https://api.certspotter.com)
- [Puredns](https://github.com/d3mondev/puredns)
- [Trickest Resolvers](https://github.com/trickest/resolvers)
- [Best-DNS-wordlists](https://wordlists.assetnote.io/)

### API keys
+ Add your API keys in [config.txt](https://github.com/0xPugazh/SubDomz/blob/master/config.txt)
+ Add your API keys in [config.txt](https://github.com/0xPugal/subdomz/blob/master/config.txt)

### Credit
This tool was inspired by [@bing0o](https://github.com/bing0o) [domains.sh](https://github.com/bing0o/bash_scripting/blob/master/domains.sh) script.
Expand Down
29 changes: 22 additions & 7 deletions SubDomz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ GREEN="\e[32m"
BLUE="\e[34"
CYAN="\e[36m"
NC="\e[0m"
VERSION="2.0"
VERSION="3.0"

PRG=${0##*/}

Expand Down Expand Up @@ -55,6 +55,7 @@ ListSources() {
echo "Alienvault"
echo "Subdomain-center"
echo "Certspotter"
echo "Puredns"
exit 1
}

Expand Down Expand Up @@ -260,6 +261,17 @@ Certspotter() {
}
}

Puredns() {
[ "$silent" == True ] && puredns bruteforce $WORDLISTS $DOMAIN --resolvers $RESOLVERS -q | anew subdomz-$domain.txt || {
[[ ${PARALLEL} == True ]] || { spinner "${BOLD}Puredns${NC}" &
PID="$!"
}
puredns bruteforce $WORDLISTS $DOMAIN --resolvers $RESOLVERS -q > tmp-certspotter-$domain
[[ ${PARALLEL} == True ]] || kill ${PID} 2>/dev/null
echo -e "$BOLD[*] Puredns$NC: $( wc -l < tmp-puredns-$domain && echo)"
}
}

Use() {
for i in $lu;
do
Expand All @@ -282,7 +294,7 @@ Exclude() {

Out() {
[ "$silent" == False ] && {
[ -n "$1" ] && output="$1" || output="$domain-$(date +'%Y-%m-%d').txt"
[ -n "$1" ] && output="$1" || output="$domain.txt"
result=$(sort -u tmp-* | wc -l)
sort -u tmp-* >> $output
echo -e $GREEN"[+] The Final subdomains:$NC ${result}"
Expand All @@ -307,9 +319,9 @@ List() {
[[ ${PARALLEL} == True ]] && {
spinner "Enumerating" &
PID="$!"
export -f Subfinder Amass Assetfinder Chaos Findomain Haktrails Gau Github-subdomains Gitlab-subdomains Cero Shosubgo Censys Crtsh JLDC Alienvault Subdomain-center Certspotter spinner
export -f Subfinder Amass Assetfinder Chaos Findomain Haktrails Gau Github-subdomains Gitlab-subdomains Cero Shosubgo Censys Crtsh JLDC Alienvault Subdomain-center Certspotter Puredns spinner
export domain silent BOLD NC
parallel -j18 ::: Subfinder Amass Assetfinder Chaos Findomain Haktrails Gau Github-subdomains Gitlab-subdomains Cero Shosubgo Censys Crtsh JLDC Alienvault Subdomain-center Certspotter
parallel -j18 ::: Subfinder Amass Assetfinder Chaos Findomain Haktrails Gau Github-subdomains Gitlab-subdomains Cero Shosubgo Censys Crtsh JLDC Alienvault Subdomain-center Certspotter Puredns
kill ${PID}
[[ $out != False ]] && Out $out || Out
} || {
Expand All @@ -330,6 +342,7 @@ List() {
Alienvault
Subdomain-center
Certspotter
Puredns
[[ $out != False ]] && Out $out || Out
}
}
Expand All @@ -347,9 +360,9 @@ Main() {
[[ ${PARALLEL} == True ]] && {
spinner "Enumerating" &
PID="$!"
export -f Subfinder Amass Assetfinder Chaos Findomain Haktrails Gau Github-subdomains Gitlab-subdomains Cero Shosubgo Censys Crtsh JLDC Alienvault Subdomain-center Certspotter spinner
export -f Subfinder Amass Assetfinder Chaos Findomain Haktrails Gau Github-subdomains Gitlab-subdomains Cero Shosubgo Censys Crtsh JLDC Alienvault Subdomain-center Certspotter Puredns spinner
export domain silent BOLD NC
parallel -j18 ::: Subfinder Amass Assetfinder Chaos Findomain Haktrails Gau Github-subdomains Gitlab-subdomains Cero Shosubgo Censys Crtsh JLDC Alienvault Subdomain-center Certspotter
parallel -j18 ::: Subfinder Amass Assetfinder Chaos Findomain Haktrails Gau Github-subdomains Gitlab-subdomains Cero Shosubgo Censys Crtsh JLDC Alienvault Subdomain-center Certspotter Puredns
kill ${PID}
} || {
Subfinder
Expand All @@ -369,6 +382,7 @@ Main() {
Alienvault
Subdomain-center
Certspotter
Puredns
}
[ $out == False ] && Out || Out $out
} || {
Expand Down Expand Up @@ -412,6 +426,7 @@ list=(
Alienvault
Subdomain-center
Certspotter
Puredns
)

while [ -n "$1" ]; do
Expand Down Expand Up @@ -475,7 +490,7 @@ done
___/ / /_/ / /_/ / /_/ / /_/ / / / / / / / /_
/____/\__,_/_.___/_____/\____/_/ /_/ /_/ /___/ $VERSION
All in One Passive Subdomain Enumeration tool
An Subdomain Subdomain Enumeration Tool
$GREEN by @0xPugal $NC
"""$NC

Expand Down
25 changes: 25 additions & 0 deletions check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
hash parallel 2>/dev/null && printf "[parallel]$g Installed$e\n" || printf "[parallel]$r Install Manually.$e\n"
hash jq 2>/dev/null && printf "[jq]$g Installed$e\n" || printf "[jq]$r Install Manually.$e\n"
hash python3 2>/dev/null && printf "[python3]$g Installed$e\n" || printf "[python3]$r Install Manually.$e\n"
hash pip 2>/dev/null && printf "[pip]$g Installed$e\n" || printf "[pip]$r Install Manually.$e\n"
hash shodan 2>/dev/null && printf "[shodan]$g Installed$e\n" || printf "[shodan]$r Install Manually.$e\n"
hash censys 2>/dev/null && printf "[censys]$g Installed$e\n" || printf "[censys]$r Install Manually.$e\n"
hash subfinder 2>/dev/null && printf "[subfinder]$g Installed$e\n" || printf "[subfinder]$r Install Manually.$e\n"
hash amass 2>/dev/null && printf "[amass]$g Installed$e\n" || printf "[amass]$r Install Manually.$e\n"
hash assetfinder 2>/dev/null && printf "[assetfinder]$g Installed$e\n" || printf "[assetfinder]$r Install Manually.$e\n"
hash chaos-client 2>/dev/null && printf "[chaos]$g Installed$e\n" || printf "[chaos]$r Install Manually.$e\n"
hash findomain 2>/dev/null && printf "[findomain]$g Installed$e\n" || printf "[findomain]$r Install Manually.$e\n"
hash haktrails 2>/dev/null && printf "[haktrails]$g Installed$e\n" || printf "[haktrails]$r Install Manually.$e\n"
hash gau 2>/dev/null && printf "[gau]$g Installed$e\n" || printf "[gau]$r Install Manually.$e\n"
hash github-subdomains 2>/dev/null && printf "[github-subdomains]$g Installed$e\n" || printf "[github-subdomains]$r Install Manually.$e\n"
hash gitlab-subdomains 2>/dev/null && printf "[gitlab-subdomains]$g Installed$e\n" || printf "[gitlab-subdomains]$r Install Manually.$e\n"
hash cero 2>/dev/null && printf "[cero]$g Installed$e\n" || printf "[cero]$r Install Manually.$e\n"
hash shosubgo 2>/dev/null && printf "[shosubgo]$g Installed$e\n" || printf "[shosubgo]$r Install Manually.$e\n"
hash anew 2>/dev/null && printf "[anew]$g Installed$e\n" || printf "[anew]$r Install Manually.$e\n"
hash unfurl 2>/dev/null && printf "[unfurl]$g Installed$e\n" || printf "[unfurl]$r Install Manually.$e\n"
hash httpx 2>/dev/null && printf "[httpx]$g Installed$e\n" || printf "[httpx]$r Install Manually.$e\n"
hash puredns 2>/dev/null && printf "[puredns]$g Installed$e\n" || printf "[puredns]$r Install Manually.$e\n"
hash dnsx 2>/dev/null && printf "[dnsx]$g Installed$e\n" || printf "[dnsx]$r Install Manually.$e\n"
hash massdns 2>/dev/null && printf "[massdns]$g Installed$e\n" || printf "[massdns]$r Install Manually.$e\n"
[ -f resolvers/resolvers.txt ] && printf "[resolvers.txt]\e[32m Found\e[0m\n" || printf "[resolvers.txt]\e[31m Not Found\e[0m\n"
[ -f best-dns-wordlist.txt ] && printf "[dns.txt]\e[32m Found\e[0m\n" || printf "[dns.txt]\e[31m Not Found\e[0m\n"
4 changes: 3 additions & 1 deletion config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ export HAKTRAILS_CONFIG=~/.config/haktools/haktrails-config.yml
export GITHUB_TOKEN="TOKEN_HERE"
export GITLAB_TOKEN="TOKEN_HERE"
export SHODAN_API_KEY="API_KEY_HERE"
export CHAOS_API_KEY="API_KEY_HERE"
export CHAOS_API_KEY="API_KEY_HERE"
export RESOLVERS="resolvers/resolvers.txt"
export WORDLISTS="best-dbs-wordlist.txt"
184 changes: 26 additions & 158 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,159 +1,27 @@
#!/bin/bash
#
Parallel(){
printf " \r"
sudo apt-get install parallel -y
}

JQ() {
printf " \r"
sudo apt-get install jq -y
}

Python() {
printf " \r"
sudo apt-get install python3 -y
}

Pip() {
printf " \r"
sudo apt-get install python3-pip -y
}

Shodan() {
printf " \r"
pip3 install shodan || pip3 install shodan --break-system-packages
}

Censys() {
printf " \r"
pip3 install censys || pip3 install censys --break-system-packages
}

Subfinder() {
printf " \r"
go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
}

Amass() {
printf " \r"
go install -v github.com/owasp-amass/amass/v3/...@master
}

Assetfinder() {
printf " \r"
go install github.com/tomnomnom/assetfinder@latest
}

Chaos() {
printf " \r"
go install -v github.com/projectdiscovery/chaos-client/cmd/chaos@latest
}

Findomain() {
printf " \r"
wget https://github.com/Findomain/Findomain/releases/download/8.2.1/findomain-linux.zip
unzip findomain-linux.zip
rm findomain-linux.zip
chmod +x findomain
sudo mv findomain /usr/bin/
}

Haktrails() {
printf " \r"
go install -v github.com/hakluke/haktrails@latest
}

Gau() {
printf " \r"
go install github.com/lc/gau/v2/cmd/gau@latest
wget ~/ https://raw.githubusercontent.com/lc/gau/master/.gau.toml
}

Github-subdomains() {
printf " \r"
go install github.com/gwen001/github-subdomains@latest
}

Gitlab-subdomains() {
printf " \r"
go install github.com/gwen001/gitlab-subdomains@latest
}

Cero() {
printf " \r"
go install -v github.com/glebarez/cero@latest
}

Shosubgo() {
printf " \r"
go install github.com/incogbyte/shosubgo@latest
}

Httpx() {
printf " \r"
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
}

Anew() {
printf " \r"
go install -v github.com/tomnomnom/anew@latest
}

Unfurl() {
printf " \r"
go install github.com/tomnomnom/unfurl@latest
}

Parallel
JQ
Python
Pip
Shodan
Censys
Subfinder
Amass
Assetfinder
Chaos
Findomain
Haktrails
Gau
Github-subdomains
Gitlab-subdomains
Cero
Shosubgo
Httpx
Anew
Unfurl

list=(
parallel
jq
python3
pip
shodan
censys
subfinder
amass
assetfinder
chaos
findomain
haktrails
gau
github-subdomains
gitlab-subdomains
cero
shosubgo
httpx
anew
unfurl
)

r="\e[31m"
g="\e[32m"
e="\e[0m"

for prg in ${list[@]}
do
hash $prg 2>/dev/null && printf "[$prg]$g Installed$e\n" || printf "[$prg]$r Install Manually.$e\n"
done
# Installing tools
sudo apt-get install parallel -y
sudo apt-get install jq -y
sudo apt-get install python3 -y
sudo apt-get install python3-pip -y
pip3 install shodan --break-system-packages
pip3 install censys --break-system-packages
go install -v github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest
go install -v github.com/owasp-amass/amass/v3/...@master
go install github.com/tomnomnom/assetfinder@latest
go install -v github.com/projectdiscovery/chaos-client/cmd/chaos@latest
wget https://github.com/Findomain/Findomain/releases/download/8.2.1/findomain-linux.zip && unzip findomain-linux.zip && rm findomain-linux.zip && chmod +x findomain && sudo mv findomain /usr/bin/
go install -v github.com/hakluke/haktrails@latest
go install github.com/lc/gau/v2/cmd/gau@latest && wget ~/ https://raw.githubusercontent.com/lc/gau/master/.gau.toml
go install github.com/gwen001/github-subdomains@latest
go install github.com/gwen001/gitlab-subdomains@latest
go install -v github.com/glebarez/cero@latest
go install github.com/incogbyte/shosubgo@latest
go install -v github.com/projectdiscovery/httpx/cmd/httpx@latest
go install -v github.com/tomnomnom/anew@latest
go install github.com/tomnomnom/unfurl@latest
git clone https://github.com/blechschmidt/massdns.git && cd massdns && make && sudo make install
go install github.com/d3mondev/puredns/v2@latest
go install -v github.com/projectdiscovery/dnsx/cmd/dnsx@latest
git clone https://github.com/trickest/resolvers
wget https://wordlists-cdn.assetnote.io/data/manual/best-dns-wordlist.txt

0 comments on commit 7c4c9e6

Please sign in to comment.