-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmasapt
More file actions
executable file
·83 lines (56 loc) · 1.84 KB
/
masapt
File metadata and controls
executable file
·83 lines (56 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
# Help function that prints help details to console.
showHelp(){
echo ""
echo "Usage: $0 -t target/url"
echo -e "\t-t Pass URL of the target that you want to perform the Pentest on."
exit 1
}
# Loop through passed parameters.
while getopts "t:" opt
do
case "$opt" in
t ) target_url="$OPTARG" ;;
? ) showHelp ;;
esac
done
# Print showHelp in case parameters are empty.
if [ -z "$target_url" ]
then
echo "Some or all parameters are empty.";
showHelp
fi
# Function that runs on Keyboard Interrupt event (Ctrl + C)
control_c() {
# Kill all MASAPT proccesses that are already running.
for pid in $(ps -ef | grep -E 'Explorer|Coordinator|SQLinjector|Reporter' | awk '{print $2}'); do kill -9 $pid; done
exit
}
# Call interrupt event function
trap control_c SIGINT
# -------- Setting global agent paths ------------
# Places current directory into a variable.
# current_dir=$(pwd)
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
explorer_path="${current_dir}/Explorer/explorer.py"
coordinator_path="${current_dir}/Coordinator/coordinator.py"
sqlinjector_path="${current_dir}/SQLinjector/sqlinjector.py"
reporter_path="${current_dir}/Reporter/reporter.py"
# --------------- Run agents --------------------
printf "\nStarting MASAPT...\n\n"
printf "You can exit the program by hitting Crtl + C\n\n\n"
printf "Welcome to...\n\n"
printf "+---------------------------------+\n"
printf "| Multi-Agent System |\n"
printf "| for |\n"
printf "| Automated Penetration Testing |\n"
printf "+---------------------------------+\n"
printf "\n\n"
python $explorer_path -t $target_url &
sleep 3
python $coordinator_path &
sleep 3
python $sqlinjector_path &
sleep 3
python $reporter_path &
wait