onionscan analys

This commit is contained in:
anon 2023-01-14 18:05:17 +01:00
parent 320bd71a3e
commit de261542f6
2 changed files with 11 additions and 9 deletions

3
.gitignore vendored
View File

@ -1,2 +1,3 @@
onionscandb* onionscandb
*.swp *.swp
__pycache__

View File

@ -1,10 +1,10 @@
#!/bin/bash #!/bin/bash
set -e set -xe
# Setting env # Setting env
SCAN_DATE=`date "+%F-%H-%M"` SCAN_DATE=`date "+%F-%H-%M"`
SHALLOT_DIR="/tmp/shallot-$SCAN_DATE" export SHALLOT_DIR="/tmp/shallot-$SCAN_DATE"
mkdir -p $SHALLOT_DIR mkdir -p $SHALLOT_DIR
echo "Shallot scritp v0.0.2" echo "Shallot scritp v0.0.2"
@ -18,13 +18,14 @@ if [[ $# -ge 2 ]] ; then
echo "[WARRNING] Too much argument was passed, this script uses only first one." echo "[WARRNING] Too much argument was passed, this script uses only first one."
fi fi
ONIONSITE=$1 export ONIONSITE=$1
echo "[INFO] Checking if Tor Browser proxy is running..." echo "[INFO] Checking if Tor Browser proxy is running..."
NETSTAT_OUTPUT=`netstat -tlnp 2> /dev/null` NETSTAT_OUTPUT=`netstat -tlnp 2> /dev/null`
IF_TOR_RUNNING=`echo $NETSTAT_OUTPUT | grep -Ezqv "/tor" && echo 0 || echo 1` #IF_TOR_RUNNING=`echo $NETSTAT_OUTPUT | grep -Ezqv "/tor" && echo 0 || echo 1`
if [[ "$IF_TOR_RUNNING" = 1 ]] ; then IF_TOR_RUNNING=`ps -eaf | grep -i tor |sed '/^$/d' | wc -l`
if [[ "$IF_TOR_RUNNING" > 1 ]] ; then
echo "[INFO] Tor is running!" echo "[INFO] Tor is running!"
else else
echo "[ERROR] Tor is not running, start Tor Browser and connect to Tor, then restart this scritp" echo "[ERROR] Tor is not running, start Tor Browser and connect to Tor, then restart this scritp"
@ -37,7 +38,7 @@ echo ""
# OnionScan # OnionScan
echo "Runnning OnionScan aginst address, this will take a while..." echo "Runnning OnionScan aginst address, this will take a while..."
ONIONSCAN_REPORT=$(onionscan --jsonReport --torProxyAddress "127.0.0.1:9150" $1 2>$SHALLOT_DIR/onionscan_error.log | jq) export ONIONSCAN_REPORT=$(onionscan --jsonReport --torProxyAddress "127.0.0.1:9150" $1 2>$SHALLOT_DIR/onionscan_error.log | jq)
echo $ONIONSCAN_REPORT > $SHALLOT_DIR/onionscan_result.txt echo $ONIONSCAN_REPORT > $SHALLOT_DIR/onionscan_result.txt
if [ $? ] ; then if [ $? ] ; then
echo "OnionScan done! Saved in $SHALLOT_DIR/onionscan_result.txt" echo "OnionScan done! Saved in $SHALLOT_DIR/onionscan_result.txt"
@ -50,7 +51,7 @@ fi
echo "Scanning HTTP headers, wait..." echo "Scanning HTTP headers, wait..."
HTTP_HEADERS=$(proxychains -q -f /etc/proxychains4.conf /usr/bin/curl -I -s $1 | tail -n +3 | sed 's/\r//g' | head -n -1 | jq -R 'split(":")|{(.[0]) : .[1]}' 2>$SHALLOT_DIR/http_headers_error.log) export HTTP_HEADERS=$(proxychains -q -f /etc/proxychains4.conf /usr/bin/curl -I -s $1 | tail -n +3 | sed 's/\r//g' | head -n -1 | jq -R 'split(":")|{(.[0]) : .[1]}' 2>$SHALLOT_DIR/http_headers_error.log)
echo $HTTP_HEADERS > $SHALLOT_DIR/http_headers.txt echo $HTTP_HEADERS > $SHALLOT_DIR/http_headers.txt
if [ $? ] ; then if [ $? ] ; then
@ -62,4 +63,4 @@ fi
# Report analysis # Report analysis
python3 main.py