Skip to content

Commit

Permalink
Version 0.7
Browse files Browse the repository at this point in the history
New:
* Loadbar
* More user agents for chains
  *  With `899` differents
* Interaction with user
  • Loading branch information
Julio Lira authored Jun 19, 2019
2 parents 77b4e06 + 2c76044 commit 72b6389
Show file tree
Hide file tree
Showing 10 changed files with 1,070 additions and 144 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# D4N155
# D4N155
[![Documentation Status](https://readthedocs.org/projects/d4n155/badge/?version=documentation)](https://d4n155.readthedocs.io/en/documentation/?badge=documentation) [![made-with-bash](https://img.shields.io/badge/Made%20with-Bash-1f425f.svg)](https://github.com/OWASP/D4N155/search?l=shell) [![GPLv3 license](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://github.com/OWASP/D4N155/blob/master/LICENSE)

It's an information security audit tool that creates intelligent wordlists based on the content of the target page and Google hacking attack

[Help us](CONTRIBUTING.md)
Expand Down
23 changes: 14 additions & 9 deletions main
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ here=`dirname "$0"`
cd "$here"

# colors art
green='\e[32m'
bgred='\e[41m'
red='\e[31m'
. ./modules/colors.sh
# Banner
echo -e """
$red /\ o
Expand All @@ -25,14 +23,18 @@ $red /\ o
{{{{{{{;.___.;}}&&&&
'{{{{{{) (}}|//&
´''''': :''''´
[ \e[5m$bgred\033[38;5;232mAt Segmentation Fault\e[m $red]
[ \e[5m$bgred\033[38;5;232mAt Segmentation Fault$end $red]
"""

# ignore lower and uppercase
shopt -s nocasematch
# and colors with dont fuck terminal
printf "\033[0m"
printf "$end"
# Vars
bug="""
You can report new bug or open a issue
\t$yellow$orange https://github.com/owasp/D4N155/issues$end
"""
help="""
D4N155: Tool for smart audit security
Expand Down Expand Up @@ -65,7 +67,10 @@ help="""

# All functions
. modules/functions.sh
. modules/load.sh
printf "\033[32m"

trap -- "printf \"\n$bug\";exit 2" "SIGINT"
# menu interative
__interative(){
printf "\033[0m"
Expand Down Expand Up @@ -156,23 +161,23 @@ else
# Exists $narg? Then ok, go go
echo "Find to vulnerabilties"
echo "$narg"
[ "$narg" ] && __vul "$narg" || ( echo -e "\e[33m→ bash main --help\e[m";exit 2 )
[ "$narg" ] && __vul "$narg" || ( echo -e " $orange → bash main --help$end ";exit 2 )

util=$(($util+1))
;;&
--b* | -*b*)
echo "Make custom wordlist"
if [ $save ]
then
[ "$narg" ] && __cus "$narg" "$save" || ( echo -e "\e[33m→ bash main --help\e[m";exit 2)
[ "$narg" ] && __cus "$narg" "$save" || ( echo -e " $orange → bash main --help$end ";exit 2)
else
[ "$narg" ] && __cus "$narg" || ( echo -e "\e[33m→ bash main --help\e[m";exit 2 )
[ "$narg" ] && __cus "$narg" || ( echo -e " $orange → bash main --help$end ";exit 2 )
fi

util=$(($util+1))
;;
--t* | "-t")
echo -e "Targets inputed in \e[33m$narg\e[32m"
echo -e "Targets inputed in $orange $narg $green "
__fwordlist "$narg" "" "$time"


Expand Down
11 changes: 11 additions & 0 deletions modules/colors.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Default
orange='\e[33m'
yellow='\e[93m'
green='\e[32m'
red='\e[31m'
end='\e[0m'
bgred='\e[41m'

# Status
correct="[\e[1m\e[92m ✔ $end$green]"
incorrect="[\e[1m\e[92m ✘ $end$green]"
193 changes: 89 additions & 104 deletions modules/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,9 @@
# _wordlist
# _fwordlist

# Get expression and get all dorks of google hacking
# All vul. pages and routers :]
__vul(){
# Check arguments
if [ "$1" ]
then
echo "Attacking $1"
target="$1"
else
printf "Target is: $1"; read target
fi

# Update db
echo -e "\033[33mYou want update the list Google hacking? (y/n)\033[32m"
# Update db
_updateDB(){
printf "$orange You want update the list Google hacking? (y/n)$green\n → "
read typed
case $typed in
"Yes" | y*)
Expand All @@ -30,29 +19,61 @@ __vul(){
echo "OK ..."
;;
esac
}

# Make the attack
echo -e "\033[33mBenning attack using diferents user agents ;)\033[32m"
cd pagodo/
echo "It will to delay..."
# Check Time format
_checkTime(){
if [ "$1" == "" ] || [[ ! "$1" =~ ^[+-]?([0-9]*[.])?[0-9]+$ ]]
then
export time="0"
elif [[ "$1" =~ ^[+-]?([0-9]*[.])?[0-9]+$ ]] || [[ "$1" =~ ^-?[0-9]+$ ]]
then
export time="$settime"
fi
}

# Run the pagodo
_checkVul(){
cd pagodo/
# It's good? Then go go go go
python3 pagodo.py -d $target -g google_dorks.txt -l 40 -s -e 1
_load "$orange Find vulners urls $green " "python3 pagodo.py -d $target -g google_dorks.txt -l 40 -s -e 1"
if [ "$?" = "0" ]
then
mv $target.txt ../reports/
if [ "$?" == "0" ]
then
echo "Finalized attack to $target, see in reports/$target.txt"
else
echo -e "\033[31mThe file dont has been saved, The result are found?\033[32m"
echo -e "$green The file dont has been saved, The result are found?$green"
exit 2
fi
else
echo -e "Error: in \033[31mpagodo.py\033[33m\nrun: pip3 install -r requirements.txt\033[32m"
echo -e "Error: in $green pagodo.py$orange\nrun: pip3 install -r requirements.txt$green"
fi
cd ../
}

# Get expression and get all dorks of google hacking
# All vul. pages and routers :]
__vul(){
# Check arguments
if [ "$1" ]
then
echo "Attacking $1"
target="$1"
else
printf "Target is: $1"; read target
fi
# Update list of dork
_updateDB

# Make the attack
echo -e "$orange Benning attack using diferents user agents ;)$green"
echo "It will to delay..."
# Attack
_checkVul
}

# Get expression and get all pages indexes of google
# 1# just read page
# 2# get all texts, alts etc.
Expand All @@ -73,73 +94,53 @@ __wordlist(){
target="$(printf $target | awk '{ gsub("['/',':','-']","");print }')";

# Get time rate
printf "Time interval in seconds (Default: 0): ";read settime
if [ "$settime" == "" ] || [[ ! "$settime" =~ ^[+-]?([0-9]*[.])?[0-9]+$ ]]
then
export time="0"
elif [[ "$settime" =~ ^[+-]?([0-9]*[.])?[0-9]+$ ]] || [[ "$settime" =~ ^-?[0-9]+$ ]]
then
export time="$settime"
fi
printf "Time interval in seconds (Default: -1): ";read settime
_checkTime
fi

# Define destination to save
[ "$#" == "2" ] && \
export dest="$2" || \
export dest="reports/wordlist/$target.wordlist.txt"

# Make the attack
echo -e "\033[33mBeginning attack, with Google indexations\033[32m"
cd pagodo/
# It's good? Then go go go go
echo -e "$orange Beginning attack, with Google indexations$end"

# Run pagodo for get all urls
cd pagodo/
python3 pagodo.py -d $target -g blank.txt -l 300 -s -e 1
cd ../

# If get all ok then:
if [ "$?" = "0" ]
then
# Check if be ok
mv "$target.txt" "../reports/db/"
mv "pagodo/$target.txt" "reports/db/"
if [ "$?" == "0" ]
then
echo -e "Finalized search to $target, database\nhas been saved in reports/db/$target.txt"
echo -e "Finalized search to $target, database\nhas been saved in$orange reports/db/$target.txt$green"
else
echo -e "\033[31mThe file dont has been saved, the result are found?\033[32m"
echo -e "$red The file dont has been saved, the result are found?$green"
exit 2
fi
# Generate the wordlist
# get all urls and read all text
# Check for equals worlds and remove
# remove characters like: , or ?

echo "Make the wordlist *-*"
cat ../reports/db/$target.txt | \
while read url
do
echo "$url";
python3 "../objetive/objetive.py" "$url" \
>> ../reports/db/$target.blob.txt && \
echo -e ":.........................................[\e[92m✔\e[32m]" || \
echo -e ":.........................................[\e[31m✘\e[32m]"
sleep $time
done && \
\
python3 "../modules/generator.py" "$(cat ../reports/db/$target.blob.txt)" \
> ../$dest
if [ "$?" != "0" ]
then
echo -e "\033[031mError fatal\033[32m"
exit 2
fi

test "$?" == 0 && \
echo -e "\033[032mWordlist has been saved in\n\033[033m$dest\033[0m" || \
exit 1

. modules/operations/calc.sh "reports/db/$target.txt" "$target" "$dest"

test "$?" == 0 && \
echo -e "$green Wordlist has been saved in\n$orange$dest$end" || \
exit 1

# clear trash files
# Call report pdf
. ../modules/report/main.sh "../reports/db/$target.txt" "../reports/db/$target.blob.txt" \
"../$dest" "$target"
rm -rf ../reports/db/$target.*
exit 0
. modules/report/main.sh "reports/db/$target.txt" "reports/db/$target.blob.txt" \
"$dest" "$target"
rm -rf reports/db/$target.*
exit 0
else
echo -e "Error: in \033[31mpagodo.py\033[33m\nrun: pip3 install -r requirements.txt\033[32m"
echo -e "Error: in$red pagodo.py$orange \nrun: pip3 install -r requirements.txt$green"
fi
cd ../
}

# _fwordlist
Expand All @@ -150,40 +151,24 @@ __fwordlist (){

[ "$3" != "" ] && export time="$3" || export time="0"

cat $1 |\
while read url || exit 2
do
echo "$url";
python3 "objetive/objetive.py" "$url" \
>> reports/db/wordlist.blob.txt && \
echo -e ":.........................................[\e[92m✔\e[32m]" || \
echo -e ":.........................................[\e[31m✘\e[32m]"
sleep $time
done && \
python3 "modules/generator.py" "$(cat reports/db/wordlist.blob.txt)" \
> "reports/wordlist/wordlist.txt"
if [ "$?" != "0" ]
then
echo -e "\033[031mError fatal\033[32m"
exit 2
fi
. modules/operations/calc.sh "$1" "wordlist" "reports/wordlist/wordlist.txt"

if [ "$?" == "0" ]
then
echo -e "\033[032mWordlist has been saved in\n\033[033m./reports/wordlist/wordlist.txt\033[0m"
# clear trash files
# Report in pdf
# pagodo, default of script
cd pagodo/
. ../modules/report/main.sh "../$1" "../reports/db/wordlist.blob.txt" \
"../reports/wordlist/wordlist.txt" "custom"
cd ..
rm -rf reports/db/wordlist.blob.txt
exit 0
else
echo -e "\033[31mError in save the wordlist\033[32m"
exit 1
fi
if [ "$?" == "0" ]
then
echo -e "$green Wordlist has been saved in\n$orange./reports/wordlist/wordlist.txt$end"
# clear trash files
# Report in pdf
# pagodo, default of script
cd pagodo/
. ../modules/report/main.sh "../$1" "../reports/db/wordlist.blob.txt" \
"../reports/wordlist/wordlist.txt" "custom"
cd ..
rm -rf reports/db/wordlist.blob.txt
exit 0
else
echo -e "$red Error in save the wordlist $green"
exit 1
fi
}
# Cus of custom :] | Staps
# 1 - Get text
Expand All @@ -196,8 +181,8 @@ __cus() {
[ $2 ] && export save="$2" || export save="_wordlist.txt"
echo "$save"
echo "Processing all data..."
python3 "modules/generator.py" "$(cat $1 | awk '{ gsub("['',',']","");print }')" >> "$save" && \
( echo -e "[\e[92m✔\e[m] Wordlist been created in $save"; exit 0 ) || \
echo -e "[\e[31m✘\e[m] Error fatal, don't create file"; exit 2
python3 "modules/generator.py" "$1" >> "$save" && \
( echo -e "$correct Wordlist been created in $save"; exit 0 ) || \
echo -e "$incorrect Error fatal, don't create file"; exit 2

}
5 changes: 3 additions & 2 deletions modules/generator.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# It module make the word list
import sys
import sys
from multiprocessing.dummy import Pool as ThreadPool
from permutations.main import * # All modules for permutations
details = False


# Root text
texts = sys.argv[1].split()
texts = open(sys.argv[1], 'r').read().split()
new = []
# Alternations
texts = texts+list(map(inverter, texts))
Expand Down
15 changes: 15 additions & 0 deletions modules/load.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

sp="⡿⣟⣯⣷⣾⣽⣻⢿"
sc=0
spin() {
printf "\r${sp:sc++:1} $1 "
((sc==${#sp})) && sc=0
}

_load(){
while :;do
spin "$1"
done & trap "kill $!" kill -9 $! &> /dev/null
eval "$2"
}
Loading

0 comments on commit 72b6389

Please sign in to comment.