Projects STRLCPY 0rly Commits 2ee44880
🤬
  • ■ ■ ■ ■ ■ ■
    v1-bash/0rly-quiet.sh
    1  -#!/usr/bin/env bash
    2  -_BNR="ICAbWzE7MzJtICDilojilojilojiloggICAgICAgICAg4paI4paIICAgICAgICAgICDilojilojilojiloggG1swbQogIBtbMTszMm0g4paI4paR4paR4paR4paI4paIICAgICAgICDilpHilojiloggIOKWiOKWiCAgIOKWiOKWiCDilojilojilpHilpHilojilogbWzBtCiAgG1sxOzMybeKWkeKWiCAg4paI4paR4paIIOKWiOKWiOKWiOKWiOKWiOKWiCDilpHilojilogg4paR4paR4paI4paIIOKWiOKWiCDilpHilojilogg4paR4paI4paIG1swbQogIBtbMTszMm3ilpHilogg4paIIOKWkeKWiOKWkeKWkeKWiOKWiOKWkeKWkeKWiCDilpHilojiloggIOKWkeKWkeKWiOKWiOKWiCAg4paR4paRICDilojiloggG1swbQogIBtbMTszMm3ilpHilojiloggIOKWkeKWiCDilpHilojilogg4paRICDilpHilojiloggICDilpHilojiloggICAgICDilojiloggIBtbMG0KICAbWzE7MzJt4paR4paIICAg4paR4paIIOKWkeKWiOKWiCAgICDilpHilojiloggICDilojiloggICAgICDilpHilpEgICAbWzBtCiAgG1sxOzMybeKWkSDilojilojilojilogg4paR4paI4paI4paIICAgIOKWiOKWiOKWiCAg4paI4paIICAgICAgICDilojiloggIBtbMG0KICAbWzE7MzJtIOKWkeKWkeKWkeKWkSAg4paR4paR4paRICAgIOKWkeKWkeKWkSAg4paR4paRICAgICAgICDilpHilpEgICAbWzBtChtbMTszM20gIC0+aHR0cHM6Ly90d2l0dGVyLmNvbS90Y3BkaXJlY3Q8LRtbMG0KG1sxOzMzbS0+aHR0cHM6Ly9naXQudGNwLmRpcmVjdC9rYXlvcy8wcmx5PC0bWzBtCg=="
    3  -############################
    4  -# -------> kayos <-------- #
    5  -# git.tcp.direct/kayos #
    6  -# twitter.com/yunginnanet #
    7  -# github.com/yunginnanet #
    8  -############################
    9  - 
    10  -# ________
    11  -#/ \
    12  -#| 0rly? |
    13  -#\__ __'\
    14  -# |/ \\
    15  -# \ \\ .
    16  -# |\\/|
    17  -# / " '\
    18  -# . . .
    19  -# / ) |
    20  -# ' _.' |
    21  -# '-'/ \
    22  - 
    23  -# usage: ./0rly.sh website.com
    24  - 
    25  -# uses findomain, runs whois on all the resolvable subs found
    26  -# sorts out cloudflare IPs, run rustscan on all non-cloudflare IPs
    27  -# generate HTML reports
    28  - 
    29  -###### known dependencies ######
    30  - 
    31  -#### most package managers:
    32  -# - nmap
    33  -# - xsltproc
    34  -# - whois
    35  - 
    36  -#### fancy shit:
    37  -# - rustscan
    38  -# --- with rust: https://crates.io/crates/rustscan (cargo install rustscan)
    39  -# --- without: https://github.com/RustScan/RustScan/releases/tag/2.0.1
    40  -# - findomain
    41  -# --- with rust: https://crates.io/crates/findomain (cargo install findomain)
    42  -# --- without: https://github.com/Findomain/Findomain/releases/tag/3.1.0
    43  - 
    44  -################################################
    45  - 
    46  -_target="$1"
    47  - 
    48  -_RESULTS="$HOME/0rly/$_target"
    49  - 
    50  -function _html {
    51  - xsltproc $1 -o "$_RESULTS/HTML/$1.html"
    52  -}
    53  -export _html
    54  - 
    55  -#######
    56  -echo $_BNR | base64 -d
    57  -echo -e "\e[0m"
    58  - 
    59  -set -e
    60  -echo -e "Creating directory: \e[93m$_RESULTS\e[0m"
    61  -mkdir -p $_RESULTS
    62  -echo ""
    63  -if [ ! -f $HOME/0rly/resolvers.txt ]; then
    64  - echo "using nameservers:"
    65  - cat /etc/resolv.conf | grep 'nameserver' | grep '\.' | sed 's/nameserver //g' | tee $HOME/0rly/resolvers.txt
    66  -fi
    67  -echo -e "\e[93mrunning findomain...\e[0m"
    68  -findomain -q -i --resolvers "$HOME/0rly/resolvers.txt" --target "$_target" -u "$_RESULTS/findomain.txt" >/dev/null;
    69  -awk -F ',' '{print $NF}' "$_RESULTS/findomain.txt" | sort -u > "$_RESULTS/findomain.unique.ips.txt";
    70  - 
    71  -_ucount=$(wc -l $_RESULTS/findomain.unique.ips.txt)
    72  -echo -e "\e[0mFound \e[93m$_ucount\e[0m unique resolvable subdomains."
    73  -echo -e "analyzing whois information and checking for \e[1;31mcloudflare\e[0m...."
    74  - 
    75  -_cfips=0
    76  -_realips=0
    77  - 
    78  -while read line; do
    79  - whois "$line" > $_RESULTS/$line.whois.txt
    80  - 
    81  - if grep -i -q cloudflare "$_RESULTS/$line.whois.txt"; then
    82  - echo "$line" >> $_RESULTS/cloudflare.ips.txt;
    83  - ((_cfips=_cfips+1))
    84  - else
    85  - echo "$line" >> $_RESULTS/noncloudflare.ips.txt;
    86  - echo -e "no cloudflare here \e[1;32m$line\e[0m :^)"
    87  - ((_realips=_realips+1))
    88  - fi
    89  -done < $_RESULTS/findomain.unique.ips.txt
    90  - 
    91  -if [ $_realips -eq 0 ]; then
    92  - echo -e "\e[1;31mno non-cloudflare ips found, gg\e[0m"
    93  - exit
    94  -fi
    95  - 
    96  -mkdir -p $_RESULTS/XML
    97  -mkdir -p $_RESULTS/HTML
    98  - 
    99  -set +e
    100  - 
    101  -while read line; do
    102  - echo "Scanning $line..."
    103  - $HOME/.cargo/bin/rustscan -a $line -- -Pn -A -T Aggressive -oX "$_RESULTS/XML/$line.xml" >/dev/null
    104  - echo "done scanning $line"
    105  -done < $_RESULTS/noncloudflare.ips.txt
    106  - 
    107  -start "Generating HTML reports..."
    108  - 
    109  -cd $_RESULTS
    110  -find . -iname "*.xml" -print | while read line; do _html "$line"; done
    111  -echo "done. results in $_RESULTS"
    112  - 
    113  - 
    114  - 
    115  - 
    116  - 
  • ■ ■ ■ ■ ■ ■
    v1-bash/0rly.sh
     1 +#!/usr/bin/env bash
     2 +#-------------------\
     3 +# - - - | 0 | - - - -\
     4 +# - - | r | - - OO
     5 +# . | l | . ||----------------> 0rly? <--------------.
     6 +# ? | y | ? || * git.tcp.direct/kayos ``
     7 +# .------------. || * github.com/yunginnanet ``
     8 +# / 0rly? \ ||-----------------------------------------.``
     9 +# |? ? ? ? ? ? ? | ?||
     10 +# \__ __'\______/ || 👻 SPOOKY BASE64 IN MY COMPUTER? 👻
     11 +# |/ \\ || 👻 ITS MORE LIKELY THAN YOU THINK! 👻
     12 +# \ \\ . ? ||
     13 +# |\\/| ||-----------------------------------------------.~
     14 +# ? / " '\ || if the base64 blobs in this script spook you, .`
     15 +# . . . || i encourage you to double check their contents ~`
     16 +# / ) | || they are implemented for maximum portability .`
     17 +# ? ' _.' | ||-----------------------------------------------.~`
     18 +# '-'/ \ ||
     19 +#--------------------||
     20 +### Script dirs #######
     21 +_DATE=$(date +%b-%d-%Y)
     22 +_0RLYDIR="$HOME/0rly"
     23 +_RESULTS="$_0RLYDIR/$_DATE/$1"
     24 +_DNS="$_0RLYDIR/resolvers.txt"
     25 +########################
     26 +_BANNER="H4sIAAAAAAACA32STQ6CMBCF916BzVyAFmWnxouwIki0UQKBSQw36LYbD+hJJPxMZwradDFM33y8Tgcgyvan9FABfN6WNtAKv6UsypJqB8QYs27ZvJAl6GAOFpovktQpDQS3wgJBHI+cYIenP//BFZ5CsbwFF1CCbrXF97rAkugPBM1b4u2urHkQ0jhq8rhmwXY3iWdXr/fHG7AhcL5VzltgeTEh5G0kpcNUxpc7YtMdtcaXQSxbVdSVxqK5mrYs8BxzuRffDKpBpCaVfuR93emkffZzwRdOcXbG+AIAAA=="
     27 +# 0) findomain subdomain enumeration
     28 +# r) queries whois service for every resolvable sub found
     29 +# l) greps out cloudflare results
     30 +# y) runs rustscan on the remaining results
     31 +# ?) generates HTML reports
     32 +# -------------------------\
     33 +# ----- dependencies -------\
     34 +#----------------------------\
     35 +# - nmap
     36 +# - xsltproc
     37 +# - whois
     38 +#
     39 +# - rustscan
     40 +# -- https://crates.io/crates/rustscan (cargo install rustscan) #
     41 +# or: https://github.com/RustScan/RustScan/releases/tag/2.0.1 #
     42 +# #
     43 +# - findomain #
     44 +# -- https://crates.io/crates/findomain (cargo install findomain) #
     45 +# or: https://github.com/Findomain/Findomain/releases/tag/3.1.0 #
     46 +#-------------------------------------------------------------------
     47 +_YLW="\e[93m"
     48 +_RST="\e[0m"
     49 +_RED="\e[1;31m"
     50 +_GRN="\e[1;32m"
     51 +_ARGS="$@"
     52 +#######
     53 +if [ -z $1 ]; then
     54 + echo "yarly."
     55 + exit 1
     56 +fi
     57 +set +e
     58 +echo $_BANNER | base64 -d | gzip -d
     59 +toilet -f fig.smbraille "$1" | colorize yellow
     60 +echo -e "Creating directory: $_YLW$_RESULTS$_RST"...
     61 +mkdir -p $_RESULTS
     62 +if [ ! -f $_DNS ]; then
     63 + echo -e "Saving a copy of your current nameservers to use as resolvers for $_YLWfindomain$_RST..."
     64 + grep -v search /etc/resolv.conf | grep -v ":" | awk '{print $2}' | tee "$_DNS"
     65 +else
     66 + _SIZE=$(wc -c "$_DNS" | awk '{print $1}')
     67 + if [ $_SIZE -eq 0 ]; then
     68 + echo -e "$_YLW $_DNS $_RST is $_RED empty $_RST..."
     69 + echo $_RSLV | tee "$_DNS"
     70 + fi
     71 + echo -e "Using the nameservers from $_YLW$_ORLYDIR/resolvers.txt$_RST..."
     72 +fi
     73 +echo -e "running $_YLWfindomain$_RST..."
     74 +findomain -q -i --resolvers "$_DNS" --target "$1" -u "$_RESULTS/findomain.txt";
     75 +awk -F ',' '{print $NF}' "$_RESULTS/findomain.txt" | sort -u > "$_RESULTS/findomain.unique.ips.txt";
     76 + 
     77 +_ucount=$(wc -l $_RESULTS/findomain.unique.ips.txt)
     78 +echo -e "$_RSTFound $_YLW$_ucount$_RST unique resolvable subdomains."
     79 +echo -e "analyzing whois information and checking for $_REDcloudflare$_RST...."
     80 + 
     81 +_cfips=0
     82 +_realips=0
     83 + 
     84 +while read line; do
     85 + whois "$line" > $_RESULTS/$line.whois.txt
     86 + 
     87 + if grep -i -q cloudflare "$_RESULTS/$line.whois.txt"; then
     88 + echo "$line" >> $_RESULTS/cloudflare.ips.txt;
     89 + ((_cfips=_cfips+1))
     90 + else
     91 + echo "$line" >> $_RESULTS/noncloudflare.ips.txt;
     92 + echo -e "no cloudflare here $_GRN$line$_RST :^)"
     93 + ((_realips=_realips+1))
     94 + fi
     95 +done < $_RESULTS/findomain.unique.ips.txt
     96 + 
     97 +if [ $_realips -eq 0 ]; then
     98 + echo -e "$_REDno non-cloudflare ips found, gg$_RST"
     99 + exit
     100 +fi
     101 + 
     102 +mkdir -p $_RESULTS/XML
     103 +mkdir -p $_RESULTS/HTML
     104 + 
     105 +while read line; do
     106 + echo "Scanning $line..."
     107 + $HOME/.cargo/bin/rustscan -a $line -- -Pn -A -T Aggressive -oX "$_RESULTS/XML/$line.xml" >/dev/null
     108 + echo "done scanning $line"
     109 +done < $_RESULTS/noncloudflare.ips.txt
     110 + 
     111 +echo "Generating HTML reports..."
     112 + 
     113 +cd $_RESULTS
     114 +#find $_RESULTS -type f -iname "*.xml" -print | while read line; do _html "$line"; done
     115 +fdfind --glob "*.xml" --exec scan2html {}
     116 +mv *.html $_RESULTS/HTML/
     117 +#scp -r $_RESULTS 0rly:/var/www/tcp.direct/0rly;
     118 +toilet -f fig.smkeyboard "done." | colorize green
     119 +#echo "results: -----> https://tcp.direct/0rly/$1 <-----" | colorize magenta
     120 + 
Please wait...
Page is in error, reload to recover