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

Send output over Telegram, Discord or Slack

six2dezef4a291e6e7e
diff --git a/reconftw.cfg b/reconftw.cfg
index bb4dc2c..05fd5b5 100644
--- a/reconftw.cfg
+++ b/reconftw.cfg
@@ -40,6 +40,8 @@ GITHUB_TOKENS=${tools}/.github_tokens
#findomain_spyse_token="XXXXXXXXXXXXXXXXX"
#findomain_securitytrails_token="XXXXXXXXXXXXXXXXX"
#findomain_fb_token="XXXXXXXXXXXXXXXXX"
+slack_channel="XXXXXXXX"
+slack_auth="xoXX-XXX-XXX-XXX"
# File descriptors
DEBUG_STD="&>/dev/null"
@@ -108,6 +110,7 @@ DEEP=false
DIFF=false
REMOVETMP=false
PROXY=false
+SENDZIPNOTIFY=false
# HTTP options
HEADER="User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:72.0) Gecko/20100101 Firefox/72.0"
@@ -130,7 +133,7 @@ PUREDNS_TRUSTED_LIMIT=400
CMSSCAN_TIMEOUT=3600
FFUF_MAXTIME=900 # Seconds
HTTPX_TIMEOUT=15 # Seconds
-HTTPX_UNCOMMONPORTS_TIMEOUT=10 # Seconds
+HTTPX_UNCOMMONPORTS_TIMEOUT=10 # Seconds
# lists
fuzz_wordlist=${tools}/fuzz_wordlist.txt
diff --git a/reconftw.sh b/reconftw.sh
index 3628b50..efcbb33 100755
--- a/reconftw.sh
+++ b/reconftw.sh
@@ -1295,11 +1295,12 @@ function getElapsedTime {
function zipSnedOutputFolder {
zip_name=`date +"%Y_%m_%d-%H.%M.%S"`
zip_name="$zip_name"_"$domain.zip"
- cd $SCRIPTPATH && zip -r $zip_name $dir 1>>"$LOGFILE"
+ cd $SCRIPTPATH && zip -r $zip_name $dir &>/dev/null
if [ -f "$SCRIPTPATH/$zip_name" ]; then
- printf "\n${yellow} @TODO send it ${reset}\n"
+ sendToNotify "$SCRIPTPATH/$zip_name"
+ rm -f "$SCRIPTPATH/$zip_name"
else
- printf "\n${yellow} no Zip file to send ${reset}\n"
+ notification "No Zip file to send" warn
fi
}
@@ -1340,6 +1341,32 @@ function notification(){
fi
}
+function sendToNotify {
+
+ if [[ -z "$1" ]]; then
+ printf "\n${yellow} no file provided to send ${reset}\n"
+ else
+ if [[ -z "$NOTIFY_CONFIG" ]]; then
+ NOTIFY_CONFIG=~/.config/notify/notify.conf
+ fi
+ if grep -q '^ 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' | xargs | cut -d' ' -f2)
+ telegram_key=$(cat ${NOTIFY_CONFIG} | grep '^ telegram_apikey\|^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' $NOTIFY_CONFIG ; then
+ notification "Sending ${domain} data over Discord" info
+ discord_url=$(cat ${NOTIFY_CONFIG} | grep '^ 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
+}
+
function start_func(){
printf "${bgreen}#######################################################################"
notification "${1}" info
@@ -1449,7 +1476,9 @@ function end(){
finaldir=$dir
fi
#Zip the output folder and send it via tg/discord/slack
- zipSnedOutputFolder
+ if [ "$SENDZIPNOTIFY" = true ]; then
+ zipSnedOutputFolder
+ fi
global_end=$(date +%s)
getElapsedTime $global_start $global_end
printf "${bgreen}#######################################################################${reset}\n"
diff --git a/reconftw_axiom.sh b/reconftw_axiom.sh
index b32ff7f..6bdca18 100755
--- a/reconftw_axiom.sh
+++ b/reconftw_axiom.sh
@@ -1299,11 +1299,12 @@ function getElapsedTime {
function zipSnedOutputFolder {
zip_name=`date +"%Y_%m_%d-%H.%M.%S"`
zip_name="$zip_name"_"$domain.zip"
- cd $SCRIPTPATH && zip -r $zip_name $dir 1>>"$LOGFILE"
+ cd $SCRIPTPATH && zip -r $zip_name $dir &>/dev/null
if [ -f "$SCRIPTPATH/$zip_name" ]; then
- printf "\n${yellow} @TODO send it ${reset}\n"
+ sendToNotify "$SCRIPTPATH/$zip_name"
+ rm -f "$SCRIPTPATH/$zip_name"
else
- printf "\n${yellow} no Zip file to send ${reset}\n"
+ notification "No Zip file to send" warn
fi
}
@@ -1344,6 +1345,32 @@ function notification(){
fi
}
+function sendToNotify {
+
+ if [[ -z "$1" ]]; then
+ printf "\n${yellow} no file provided to send ${reset}\n"
+ else
+ if [[ -z "$NOTIFY_CONFIG" ]]; then
+ NOTIFY_CONFIG=~/.config/notify/notify.conf
+ fi
+ if grep -q '^ 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' | xargs | cut -d' ' -f2)
+ telegram_key=$(cat ${NOTIFY_CONFIG} | grep '^ telegram_apikey\|^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' $NOTIFY_CONFIG ; then
+ notification "Sending ${domain} data over Discord" info
+ discord_url=$(cat ${NOTIFY_CONFIG} | grep '^ 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
+}
+
function start_func(){
printf "${bgreen}#######################################################################"
notification "${1}" info