Skip to content

reconFTW is a tool designed to perform automated recon on a target domain by running the best set of tools to perform scanning and finding out vulnerabilities

WIP

Nico Kokonase0f5316eb14b
diff --git a/reconftw.sh b/reconftw.sh
index 79e164d..e93b0f8 100755
--- a/reconftw.sh
+++ b/reconftw.sh
@@ -1925,6 +1925,8 @@ function notification(){
fi
}
+transfer(){ if [ $# -eq 0 ];then echo "No arguments specified.\nUsage:\n transfer <file|directory>\n ... | transfer <file_name>">&2;return 1;fi;if tty -s;then file="$1";file_name=$(basename "$file");if [ ! -e "$file" ];then echo "$file: No such file or directory">&2;return 1;fi;if [ -d "$file" ];then file_name="$file_name.zip" ,;(cd "$file"&&zip -r -q - .)|curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null,;else cat "$file"|curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null;fi;else file_name=$1;curl --progress-bar --upload-file "-" "https://transfer.sh/$file_name"|tee /dev/null;fi;}
+
function sendToNotify {
if [[ -z "$1" ]]; then
printf "\n${yellow} no file provided to send ${reset}\n"
@@ -1932,7 +1934,26 @@ function sendToNotify {
if [[ -z "$NOTIFY_CONFIG" ]]; then
NOTIFY_CONFIG=~/.config/notify/provider-config.yaml
fi
- curl --upload-file "$1" "https://transfer.sh/$1" | notify
+ if [ -n "$(find "${1}" -prune -size +8000000c)" ]; then
+ printf '%s is larger than 8MB, sending over transfer.sh\n' "${1}"
+ transfer "${1}" | notify
+ return 0
+ fi
+ if grep -q '^ telegram\|^telegram\|^ telegram' $NOTIFY_CONFIG ; then
+ notification "Sending ${domain} data over Telegram" info
+ telegram_chat_id=$(cat ${NOTIFY_CONFIG} | grep '^ telegram_chat_id\|^telegram_chat_id\|^ telegram_chat_id' | xargs | cut -d' ' -f2)
+ telegram_key=$(cat ${NOTIFY_CONFIG} | grep '^ telegram_api_key\|^telegram_api_key\|^ telegram_apikey' | xargs | cut -d' ' -f2 )
+ curl -F document=@${1} "https://api.telegram.org/bot${telegram_key}/sendDocument?chat_id=${telegram_chat_id}" &>/dev/null
+ fi
+ if grep -q '^ discord\|^discord\|^ discord' $NOTIFY_CONFIG ; then
+ notification "Sending ${domain} data over Discord" info
+ discord_url=$(cat ${NOTIFY_CONFIG} | grep '^ discord_webhook_url\|^discord_webhook_url\|^ discord_webhook_url' | xargs | cut -d' ' -f2)
+ curl -v -i -H "Accept: application/json" -H "Content-Type: multipart/form-data" -X POST -F file1=@${1} $discord_url &>/dev/null
+ fi
+ if [[ -n "$slack_channel" ]] && [[ -n "$slack_auth" ]]; then
+ notification "Sending ${domain} data over Slack" info
+ curl -F file=@${1} -F "initial_comment=reconftw zip file" -F channels=${slack_channel} -H "Authorization: Bearer ${slack_auth}" https://slack.com/api/files.upload &>/dev/null
+ fi
fi
}
@@ -2960,3 +2981,4 @@ case $opt_mode in
exit 1
;;
esac
+