Skip to content

Commit 61ef927

Browse files
authored
Merge pull request #920 from pgrenaud/check-tools-option-and-github-workflow
Add --check-tools option and GitHub workflow
2 parents 4c58504 + d382760 commit 61ef927

File tree

3 files changed

+65
-8
lines changed

3 files changed

+65
-8
lines changed

.github/workflows/tests.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
tests:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
os:
11+
- macos-14
12+
- macos-15
13+
- ubuntu-20.04
14+
- ubuntu-22.04
15+
- ubuntu-24.04
16+
17+
name: ${{ matrix.os }}
18+
runs-on: ${{ matrix.os }}
19+
20+
steps:
21+
- name: Install bash from homebrew
22+
if: ${{ startsWith(matrix.os, 'macos-') }}
23+
run: brew install bash
24+
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Install reconFTW
29+
shell: bash
30+
continue-on-error: true
31+
run: ./install.sh
32+
33+
- name: Check if all tools are installed
34+
shell: bash
35+
run: ./reconftw.sh --check-tools
36+
37+
- name: Check if chromium dependencies are installed
38+
shell: bash
39+
run: nuclei -headless -id screenshot

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ reset='\033[0m'
408408
| -o | Output directory |
409409
| -v | Axiom distributed VPS |
410410
| -q | Rate limit in requests per second |
411+
| --check-tools | Exit if one of the tools is missing |
411412

412413
## Example Usage
413414

reconftw.sh

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,10 @@ function tools_installed() {
256256

257257
printf "%b[%s] Tools check finished%b\n" "$bblue" "$(date +'%Y-%m-%d %H:%M:%S')" "$reset"
258258
printf "%b#######################################################################\n%b" "$bgreen" "$reset"
259+
260+
if [[ $CHECK_TOOLS_OR_EXIT == true && $all_installed != true ]]; then
261+
exit 2
262+
fi
259263
}
260264

261265
#####################################################################cc##########################################
@@ -6007,6 +6011,7 @@ function help() {
60076011
printf " -o output/path Define output folder\n"
60086012
printf " -v, --vps Axiom distributed VPS \n"
60096013
printf " -q Rate limit in requests per second \n"
6014+
printf " --check-tools Exit if one of the tools is missing\n"
60106015
printf " \n"
60116016
printf " ${bblue}USAGE EXAMPLES${reset}\n"
60126017
printf " ${byellow}Perform full recon (without attacks):${reset}\n"
@@ -6041,7 +6046,12 @@ if [[ $OSTYPE == "darwin"* ]]; then
60416046
PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
60426047
fi
60436048

6044-
PROGARGS=$(getopt -o 'd:m:l:x:i:o:f:q:c:z:rspanwvh::' --long 'domain:,list:,recon,subdomains,passive,all,web,osint,zen,deep,help,vps' -n 'reconFTW' -- "$@")
6049+
PROGARGS=$(getopt -o 'd:m:l:x:i:o:f:q:c:z:rspanwvh::' --long 'domain:,list:,recon,subdomains,passive,all,web,osint,zen,deep,help,vps,check-tools' -n 'reconFTW' -- "$@")
6050+
6051+
exit_status=$?
6052+
if [[ $exit_status -ne 0 ]]; then
6053+
UNKNOWN_ARGUMENT=true
6054+
fi
60456055

60466056
# Note the quotes around "$PROGARGS": they are essential!
60476057
eval set -- "$PROGARGS"
@@ -6158,13 +6168,18 @@ while true; do
61586168
shift
61596169
break
61606170
;;
6161-
'--help' | '-h' | *)
6171+
'--check-tools')
6172+
CHECK_TOOLS_OR_EXIT=true
6173+
shift
6174+
continue
6175+
;;
6176+
'--help' | '-h')
6177+
break
6178+
;;
6179+
*)
61626180
# echo "Unknown argument: $1"
6163-
. ./reconftw.cfg
6164-
banner
6165-
help
6166-
tools_installed
6167-
exit 1
6181+
UNKNOWN_ARGUMENT=true
6182+
break
61686183
;;
61696184
esac
61706185
done
@@ -6396,6 +6411,8 @@ case $opt_mode in
63966411
*)
63976412
help
63986413
tools_installed
6399-
exit 1
6414+
if [[ $UNKNOWN_ARGUMENT == true ]]; then
6415+
exit 1
6416+
fi
64006417
;;
64016418
esac

0 commit comments

Comments
 (0)