Skip to content

Commit 221a049

Browse files
committed
format options
1 parent 695b29b commit 221a049

File tree

1 file changed

+51
-53
lines changed

1 file changed

+51
-53
lines changed

reconftw.sh

Lines changed: 51 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,7 +1906,7 @@ function sub_recursive_passive() {
19061906
fi
19071907

19081908
if [[ -s ".tmp/passive_recursive_tmp.txt" ]]; then
1909-
cat .tmp/passive_recursive_tmp.txt| anew -q .tmp/passive_recursive.txt
1909+
cat .tmp/passive_recursive_tmp.txt | anew -q .tmp/passive_recursive.txt
19101910
fi
19111911

19121912
if [[ -s ".tmp/passive_recursive.txt" ]]; then
@@ -2742,7 +2742,7 @@ function screenshot() {
27422742

27432743
# Combine webs.txt and webs_uncommon_ports.txt into webs_all.txt if it doesn't exist
27442744
if [[ ! -s "webs/webs_all.txt" ]]; then
2745-
cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q webs/webs_all.txt
2745+
cat webs/webs.txt webs/webs_uncommon_ports.txt 2>/dev/null | anew -q webs/webs_all.txt
27462746
fi
27472747

27482748
# Run nuclei or axiom-scan based on AXIOM flag
@@ -2990,9 +2990,9 @@ function portscan() {
29902990

29912991
if [[ -s "hosts/ips.txt" ]]; then
29922992
# Remove CDN IPs
2993-
comm -23 <(sort -u hosts/ips.txt) <(cut -d'[' -f1 hosts/cdn_providers.txt | sed 's/[[:space:]]*$//' | sort -u) \
2994-
| grep -aEiv "^(127|10|169\.254|172\.1[6-9]|172\.2[0-9]|172\.3[0-1]|192\.168)\." | grep -oE '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b' \
2995-
| sort -u | anew -q .tmp/ips_nocdn.txt
2993+
comm -23 <(sort -u hosts/ips.txt) <(cut -d'[' -f1 hosts/cdn_providers.txt | sed 's/[[:space:]]*$//' | sort -u) |
2994+
grep -aEiv "^(127|10|169\.254|172\.1[6-9]|172\.2[0-9]|172\.3[0-1]|192\.168)\." | grep -oE '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b' |
2995+
sort -u | anew -q .tmp/ips_nocdn.txt
29962996
fi
29972997

29982998
# Display resolved IPs without CDN
@@ -3043,7 +3043,7 @@ function portscan() {
30433043
else
30443044
if [[ -s ".tmp/ips_nocdn.txt" ]]; then
30453045
axiom-scan .tmp/ips_nocdn.txt -m nmapx $PORTSCAN_ACTIVE_OPTIONS \
3046-
-oA hosts/portscan_active $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
3046+
-oA hosts/portscan_active $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
30473047
fi
30483048
fi
30493049
fi
@@ -3327,9 +3327,9 @@ function fuzz() {
33273327
axiom-exec "wget -q -O - ${fuzzing_remote_list} > /home/op/lists/seclists/Discovery/Web-Content/big.txt" &>/dev/null
33283328
axiom-scan webs/webs_all.txt -m ffuf_base -H "${HEADER}" $FFUF_FLAGS -s -maxtime $FFUF_MAXTIME -o $dir/.tmp/ffuf-content.json $AXIOM_EXTRA_ARGS 2>>"$LOGFILE" >/dev/null
33293329
pushd "${tools}/ffufPostprocessing" >/dev/null || {
3330-
echo "Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO}"
3331-
}
3332-
[ -s "$dir/.tmp/ffuf-content.json" ] && ./ffufPostprocessing -result-file $dir/.tmp/ffuf-content.json -overwrite-result-file 2>>"$LOGFILE" >/dev/null
3330+
echo "Failed to cd directory in ${FUNCNAME[0]} @ line ${LINENO}"
3331+
}
3332+
[ -s "$dir/.tmp/ffuf-content.json" ] && ./ffufPostprocessing -result-file $dir/.tmp/ffuf-content.json -overwrite-result-file 2>>"$LOGFILE" >/dev/null
33333333
popd >/dev/null || {
33343334
echo "Failed to popd in ${FUNCNAME[0]} @ line ${LINENO}"
33353335
}
@@ -4105,8 +4105,8 @@ function xss() {
41054105
# Run Dalfox with Katana output
41064106
if [[ -s ".tmp/xss_reflected.txt" ]]; then
41074107
printf "${yellow}\n[$(date +'%Y-%m-%d %H:%M:%S')] Running: Dalfox with Katana${reset}\n\n"
4108-
dalfox pipe --silence --no-color --no-spinner --only-poc r --ignore-return 302,404,403 --skip-bav $OPTIONS -d "$DEPTH" <".tmp/xss_reflected.txt" 2>>"$LOGFILE" \
4109-
| anew -q "vulns/xss.txt"
4108+
dalfox pipe --silence --no-color --no-spinner --only-poc r --ignore-return 302,404,403 --skip-bav $OPTIONS -d "$DEPTH" <".tmp/xss_reflected.txt" 2>>"$LOGFILE" |
4109+
anew -q "vulns/xss.txt"
41104110
fi
41114111
else
41124112
# Using Axiom
@@ -4253,7 +4253,6 @@ function ssrf_checks() {
42534253
# Handle COLLAB_SERVER configuration
42544254
if [[ -z $COLLAB_SERVER ]]; then
42554255
interactsh-client &>.tmp/ssrf_callback.txt &
4256-
INTERACTSH_PID=$!
42574256
sleep 2
42584257

42594258
# Extract FFUFHASH from interactsh_callback.txt
@@ -4502,7 +4501,7 @@ function sqli() {
45024501
if [[ $SQLMAP == true ]]; then
45034502
printf "${yellow}\n[$(date +'%Y-%m-%d %H:%M:%S')] Running: SQLMap for SQLi Checks${reset}\n\n"
45044503
python3 "${tools}/sqlmap/sqlmap.py" -m ".tmp/tmp_sqli.txt" -b -o --smart \
4505-
--batch --disable-coloring --random-agent --output-dir="vulns/sqlmap" 2>>"$LOGFILE" >/dev/null
4504+
--batch --disable-coloring --random-agent --output-dir="vulns/sqlmap" 2>>"$LOGFILE" >/dev/null
45064505
fi
45074506

45084507
# Check if GHAURI is enabled and run Ghauri
@@ -5061,45 +5060,44 @@ function remove_big_files() {
50615060
}
50625061

50635062
function notification() {
5064-
if [[ -n $1 ]] && [[ -n $2 ]]; then
5065-
if [[ $NOTIFICATION == true ]]; then
5066-
NOTIFY="notify -silent"
5067-
else
5068-
NOTIFY=""
5069-
fi
5070-
if [[ -z $3 ]]; then
5071-
current_date=$(date +'%Y-%m-%d %H:%M:%S')
5072-
else
5073-
current_date="$3"
5074-
fi
5075-
5076-
case $2 in
5077-
info)
5078-
text="\n${bblue}[$current_date] ${1} ${reset}"
5079-
;;
5080-
warn)
5081-
text="\n${yellow}[$current_date] ${1} ${reset}"
5082-
;;
5083-
error)
5084-
text="\n${bred}[$current_date] ${1} ${reset}"
5085-
;;
5086-
good)
5087-
text="\n${bgreen}[$current_date] ${1} ${reset}"
5088-
;;
5089-
esac
5090-
5091-
# Print to terminal
5092-
printf "${text}\n"
5093-
5094-
# Send to notify if notifications are enabled
5095-
if [[ -n $NOTIFY ]]; then
5096-
# Remove color codes for the notification
5097-
clean_text=$(echo -e "${text} - ${domain}" | sed 's/\x1B\[[0-9;]*[JKmsu]//g')
5098-
echo -e "${clean_text}" | $NOTIFY >/dev/null 2>&1
5099-
fi
5100-
fi
5101-
}
5063+
if [[ -n $1 ]] && [[ -n $2 ]]; then
5064+
if [[ $NOTIFICATION == true ]]; then
5065+
NOTIFY="notify -silent"
5066+
else
5067+
NOTIFY=""
5068+
fi
5069+
if [[ -z $3 ]]; then
5070+
current_date=$(date +'%Y-%m-%d %H:%M:%S')
5071+
else
5072+
current_date="$3"
5073+
fi
51025074

5075+
case $2 in
5076+
info)
5077+
text="\n${bblue}[$current_date] ${1} ${reset}"
5078+
;;
5079+
warn)
5080+
text="\n${yellow}[$current_date] ${1} ${reset}"
5081+
;;
5082+
error)
5083+
text="\n${bred}[$current_date] ${1} ${reset}"
5084+
;;
5085+
good)
5086+
text="\n${bgreen}[$current_date] ${1} ${reset}"
5087+
;;
5088+
esac
5089+
5090+
# Print to terminal
5091+
printf "${text}\n"
5092+
5093+
# Send to notify if notifications are enabled
5094+
if [[ -n $NOTIFY ]]; then
5095+
# Remove color codes for the notification
5096+
clean_text=$(echo -e "${text} - ${domain}" | sed 's/\x1B\[[0-9;]*[JKmsu]//g')
5097+
echo -e "${clean_text}" | $NOTIFY >/dev/null 2>&1
5098+
fi
5099+
fi
5100+
}
51035101

51045102
function transfer {
51055103
if [[ $# -eq 0 ]]; then
@@ -5322,7 +5320,7 @@ function start() {
53225320
global_start=$(date +%s)
53235321

53245322
printf "\n${bgreen}#######################################################################${reset}"
5325-
notification "Recon succesfully started on ${domain}" good $(date +'%Y-%m-%d %H:%M:%S')
5323+
notification "Recon succesfully started on ${domain}" "good" "$(date +'%Y-%m-%d %H:%M:%S')"
53265324
[ "$SOFT_NOTIFICATION" = true ] && echo "$(date +'%Y-%m-%d %H:%M:%S') Recon succesfully started on ${domain}" | notify -silent
53275325
printf "${bgreen}#######################################################################${reset}\n"
53285326
if [[ $upgrade_before_running == true ]]; then
@@ -5414,7 +5412,7 @@ function end() {
54145412
global_end=$(date +%s)
54155413
getElapsedTime $global_start $global_end
54165414
printf "${bgreen}#######################################################################${reset}\n"
5417-
notification "Finished Recon on: ${domain} under ${finaldir} in: ${runtime}" good $(date +'%Y-%m-%d %H:%M:%S')
5415+
notification "Finished Recon on: ${domain} under ${finaldir} in: ${runtime}" good "$(date +'%Y-%m-%d %H:%M:%S')"
54185416
[ "$SOFT_NOTIFICATION" = true ] && echo "[$(date +'%Y-%m-%d %H:%M:%S')] Finished Recon on: ${domain} under ${finaldir} in: ${runtime}" | notify -silent
54195417
printf "${bgreen}#######################################################################${reset}\n"
54205418
#Separator for more clear messges in telegram_Bot

0 commit comments

Comments
 (0)