Skip to content

Commit

Permalink
Updated conditionals and target generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
leebaird committed Mar 2, 2022
1 parent 599ea20 commit 7be9cbf
Show file tree
Hide file tree
Showing 18 changed files with 323 additions and 391 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,9 @@ Last name:
```
SCANNING
1. Local area network
2. NetBIOS
3. netdiscover
4. Ping sweep
5. Previous menu
1. ARP scan
2. Ping sweep
3. Previous menu
```

* Use different tools to create a target list including Angry IP Scanner, arp-scan, netdiscover, and nmap pingsweep.
Expand Down
14 changes: 7 additions & 7 deletions active.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ echo -n "Domain: "
read domain

# Check for no answer
if [[ -z $domain ]]; then
if [ -z $domain ]; then
f_error
fi

Expand Down Expand Up @@ -55,7 +55,7 @@ grep $domain tmp | grep -v "$domain\." | egrep -v '(Performing|Records Found|xxx

egrep -v '(\[|.nat.|1.1.1.1|6.9.6.9|127.0.0.1)' sub-dnsrecon | tr '[A-Z]' '[a-z]' | column -t | sort -u | awk '$2 !~ /[a-z]/' > subdomains

if [ -e $home/data/$domain/data/subdomains.htm ]; then
if [ -f $home/data/$domain/data/subdomains.htm ]; then
cat $home/data/$domain/data/subdomains.htm subdomains | grep -v "<" | grep -v "$domain\." | column -t | sort -u > subdomains-combined

cp $discover/report/data/subdomains.htm $home/data/$domain/data/subdomains.htm
Expand Down Expand Up @@ -135,7 +135,7 @@ echo $short >> zreport

echo > tmp

if [ -e emails ]; then
if [ -f emails ]; then
emailcount=$(wc -l emails | cut -d ' ' -f1)
echo "Emails $emailcount" >> zreport
echo "Emails ($emailcount)" >> tmp
Expand All @@ -144,7 +144,7 @@ if [ -e emails ]; then
echo >> tmp
fi

if [ -e hosts ]; then
if [ -f hosts ]; then
hostcount=$(wc -l hosts | cut -d ' ' -f1)
echo "Hosts $hostcount" >> zreport
echo "Hosts ($hostcount)" >> tmp
Expand All @@ -153,7 +153,7 @@ if [ -e hosts ]; then
echo >> tmp
fi

if [ -e subdomains ]; then
if [ -f subdomains ]; then
subdomaincount=$(wc -l subdomains | cut -d ' ' -f1)
echo "Subdomains $subdomaincount" >> zreport
echo "Subdomains ($subdomaincount)" >> tmp
Expand Down Expand Up @@ -194,15 +194,15 @@ echo "</pre>" >> $home/data/$domain/data/whatweb.htm
cat zonetransfer >> $home/data/$domain/data/zonetransfer.htm
echo "</pre>" >> $home/data/$domain/data/zonetransfer.htm

if [[ -e $home/data/$domain/data/emails.htm && -e emails ]]; then
if [[ -f $home/data/$domain/data/emails.htm && -f emails ]]; then
cat $home/data/$domain/data/emails.htm emails | grep -v '<' | sort -u > tmp-new-emails
cat $home/data/$domain/data/emails.htm | grep '<' > tmp-new-page
mv tmp-new-page $home/data/$domain/data/emails.htm
cat tmp-new-emails >> $home/data/$domain/data/emails.htm
echo "</pre>" >> $home/data/$domain/data/emails.htm
fi

if [[ -e $home/data/$domain/data/hosts.htm && -e hosts ]]; then
if [[ -f $home/data/$domain/data/hosts.htm && -f hosts ]]; then
cat $home/data/$domain/data/hosts.htm hosts | grep -v '<' | $sip > tmp-new-hosts
cat $home/data/$domain/data/hosts.htm | grep '<' > tmp-new-page
mv tmp-new-page $home/data/$domain/data/hosts.htm
Expand Down
30 changes: 15 additions & 15 deletions discover.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CWD=$(pwd)
discover=$(updatedb; locate discover.sh | sed 's:/[^/]*$::')
home=$HOME
interface=$(ip addr | grep 'global' | grep -v 'secondary' | awk '{print $9}')
ip=$(ip addr | grep 'global' | grep -v 'docker' | cut -d '/' -f1 | awk '{print $2}')
ip=$(ip addr | grep 'global' | egrep -v '(:|docker)' | cut -d '/' -f1 | awk '{print $2}')
port=443
range=$(ip addr | grep 'global' | grep -v 'secondary' | cut -d '/' -f1 | awk '{print $2}' | cut -d '.' -f1-3)'.1'
rundate=$(date +%B' '%d,' '%Y)
Expand Down Expand Up @@ -103,7 +103,7 @@ echo
echo -e "${RED}$medium${NC}"
echo
echo
exit 1
exit
}

export -f f_error
Expand All @@ -116,7 +116,7 @@ echo -n "Enter the location of your file: "
read -e location

# Check for no answer
if [[ -z $location ]]; then
if [ -z $location ]; then
f_error
fi

Expand All @@ -131,7 +131,7 @@ export -f f_location
###############################################################################################################################

f_runlocally(){
if [[ -z $DISPLAY ]]; then
if [ -z $DISPLAY ]; then
echo
echo -e "${RED}$medium${NC}"
echo
Expand Down Expand Up @@ -188,13 +188,13 @@ export -f f_terminate
f_scanname(){
f_typeofscan

echo -e "${YELLOW}[*] Warning - spaces in the name will cause errors${NC}"
echo -e "${YELLOW}[*] Warning: no spaces allowed${NC}"
echo
echo -n "Name of scan: "
read name

# Check for no answer
if [[ -z $name ]]; then
if [ -z $name ]; then
f_error
fi

Expand Down Expand Up @@ -259,7 +259,7 @@ echo -n "CIDR: "
read cidr

# Check for no answer
if [[ -z $cidr ]]; then
if [ -z $cidr ]; then
rm -rf $name
f_error
fi
Expand Down Expand Up @@ -290,7 +290,7 @@ if [ "$exclude" == "y" ]; then
echo -n "Enter the path to the file: "
read excludefile

if [[ -z $excludefile ]]; then
if [ -z $excludefile ]; then
f_error
fi

Expand Down Expand Up @@ -345,7 +345,7 @@ echo -n "IP, range or URL: "
read target

# Check for no answer
if [[ -z $target ]]; then
if [ -z $target ]; then
rm -rf $name
f_error
fi
Expand Down Expand Up @@ -400,7 +400,7 @@ echo -n "Set scan delay. (0-5, enter for normal) "
read delay

# Check for no answer
if [[ -z $delay ]]; then
if [ -z $delay ]; then
delay='0'
fi

Expand Down Expand Up @@ -473,11 +473,11 @@ for i in $TCP_PORTS; do
cat $name/nmap.gnmap | grep "\<$i/open/tcp\>" | cut -d ' ' -f2 > $name/$i.txt
done

if [[ -e $name/523.txt ]]; then
if [ -f $name/523.txt ]; then
mv $name/523.txt $name/523-tcp.txt
fi

if [[ -e $name/5060.txt ]]; then
if [ -f $name/5060.txt ]; then
mv $name/5060.txt $name/5060-tcp.txt
fi

Expand All @@ -488,7 +488,7 @@ for i in $UDP_PORTS; do
cat $name/nmap.gnmap | grep "\<$i/open/udp\>" | cut -d ' ' -f2 > $name/$i.txt
done

if [[ -e $name/523.txt ]]; then
if [ -f $name/523.txt ]; then
mv $name/523.txt $name/523-udp.txt
fi

Expand Down Expand Up @@ -559,7 +559,7 @@ echo -n "Enter the location of your previous scan: "
read -e location

# Check for no answer
if [[ -z $location ]]; then
if [ -z $location ]; then
f_error
fi

Expand All @@ -575,7 +575,7 @@ echo -n "Set scan delay. (0-5, enter for normal) "
read delay

# Check for no answer
if [[ -z $delay ]]; then
if [ -z $delay ]; then
delay='0'
fi

Expand Down
2 changes: 1 addition & 1 deletion domain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ case $recon in
read -e workspace

# Check for no answer
if [[ -z $workspace ]]; then
if [ -z $workspace ]; then
f_error
fi

Expand Down
Loading

0 comments on commit 7be9cbf

Please sign in to comment.