Projects STRLCPY 0rly Commits b455a2bb
🤬
  • increase portability and implement filtering of private IP addresses during discovery

  • Loading...
  • [email protected] committed 3 years ago
    b455a2bb
    1 parent 3841165f
  • ■ ■ ■ ■ ■ ■
    v1-bash/0rly.sh
    skipped 21 lines
    22 22  _0RLYDIR="$HOME/0rly"
    23 23  _RESULTS="$_0RLYDIR/$_DATE/$1"
    24 24  _DNS="$_0RLYDIR/resolvers.txt"
     25 +_RUSTSCAN="$HOME/.cargo/bin/rustscan"
     26 +_FINDOMAIN="$HOME/.cargo/bin/findomain"
    25 27  ########################
    26 28  _BANNER="H4sIAAAAAAACA32STQ6CMBCF916BzVyAFmWnxouwIki0UQKBSQw36LYbD+hJJPxMZwradDFM33y8Tgcgyvan9FABfN6WNtAKv6UsypJqB8QYs27ZvJAl6GAOFpovktQpDQS3wgJBHI+cYIenP//BFZ5CsbwFF1CCbrXF97rAkugPBM1b4u2urHkQ0jhq8rhmwXY3iWdXr/fHG7AhcL5VzltgeTEh5G0kpcNUxpc7YtMdtcaXQSxbVdSVxqK5mrYs8BxzuRffDKpBpCaVfuR93emkffZzwRdOcXbG+AIAAA=="
    27 29  # 0) findomain subdomain enumeration
    skipped 28 lines
    56 58  fi
    57 59  set +e
    58 60  echo $_BANNER | base64 -d | gzip -d
    59  -toilet -f fig.smbraille "$1" | colorize yellow
     61 +echo -n -e "$_YLW"; figlet -f fig.smbraille "$1"; echo -n -e "$_RST";
    60 62  echo -e "Creating directory: $_YLW$_RESULTS$_RST"...
    61 63  mkdir -p $_RESULTS
    62  -if [ ! -f $_DNS ]; then
     64 +if [ ! -f $_DNS ]; then
    63 65   echo -e "Saving a copy of your current nameservers to use as resolvers for $_YLWfindomain$_RST..."
    64 66   grep -v search /etc/resolv.conf | grep -v ":" | awk '{print $2}' | tee "$_DNS"
    65 67  else
    skipped 5 lines
    71 73   echo -e "Using the nameservers from $_YLW$_ORLYDIR/resolvers.txt$_RST..."
    72 74  fi
    73 75  echo -e "running $_YLWfindomain$_RST..."
    74  -findomain -q -i --resolvers "$_DNS" --target "$1" -u "$_RESULTS/findomain.txt";
     76 +$_FINDOMAIN -q -i --resolvers "$_DNS" --target "$1" -u "$_RESULTS/findomain.txt";
    75 77  awk -F ',' '{print $NF}' "$_RESULTS/findomain.txt" | sort -u > "$_RESULTS/findomain.unique.ips.txt";
    76 78   
    77 79  _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 +echo -e "$_RST Found $_YLW $_ucount $_RST unique resolvable subdomains."
     81 +echo -e "analyzing whois information and checking for $_RED cloudflare $_RST...."
    80 82   
    81 83  _cfips=0
    82 84  _realips=0
    83 85   
    84 86  while read line; do
     87 + if echo "$line" | grep -E '^(192\.168|10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.)'; then
     88 + echo -e "private address $_YLW skipped $_RST: $line"
     89 + continue
     90 + fi
    85 91   whois "$line" > $_RESULTS/$line.whois.txt
    86 92   
    87 93   if grep -i -q cloudflare "$_RESULTS/$line.whois.txt"; then
    skipped 8 lines
    96 102   
    97 103  if [ $_realips -eq 0 ]; then
    98 104   echo -e "$_REDno non-cloudflare ips found, gg$_RST"
    99  - exit
     105 + exit 2
    100 106  fi
    101 107   
    102 108  mkdir -p $_RESULTS/XML
    skipped 1 lines
    104 110   
    105 111  while read line; do
    106 112   echo "Scanning $line..."
    107  - $HOME/.cargo/bin/rustscan -a $line -- -Pn -A -T Aggressive -oX "$_RESULTS/XML/$line.xml" >/dev/null
     113 + $_RUSTSCAN -a "$line" -- -Pn -A -T Aggressive -oX "$_RESULTS/XML/$line.xml" >/dev/null
    108 114   echo "done scanning $line"
    109 115  done < $_RESULTS/noncloudflare.ips.txt
    110 116   
    111 117  echo "Generating HTML reports..."
    112 118   
    113 119  cd $_RESULTS
    114  -#find $_RESULTS -type f -iname "*.xml" -print | while read line; do _html "$line"; done
    115  -fdfind --glob "*.xml" --exec scan2html {}
     120 +find . -iname "*.xml" -exec scan2html {} \;
    116 121  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
     122 +echo -e $_GRN
     123 +toilet -f fig.smkeyboard "done." ;
     124 +echo -e $_RST
     125 +exit 0
    120 126   
Please wait...
Page is in error, reload to recover