-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
executable file
·77 lines (67 loc) · 2.41 KB
/
setup.sh
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
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root."
exit 1
fi
if [[ $1 == "-h" ]]; then
echo "Description:"
echo " This script sets up the AR4WE tool, ensuring all necessary dependencies"
echo " and configurations are properly established for operation."
echo
echo "Usage: $0 [options]"
echo "Options:"
echo " -h Show help message and exit"
exit 0
fi
if [ "$(id -u)" -eq 0 ]; then
SUDO=""
else
SUDO="sudo"
fi
# call checking script
# dont write sudo if the user is already root
if [[ $EUID -ne 0 ]]; then
$SUDO bash ./checkForTools/checking
else
bash ./checkForTools/checking
fi
# # Check if the script already exists in /usr/bin
# if [ -f "/usr/bin/AR4WE" ]; then
# echo "The script AR4WE is already installed in /usr/bin/AR4WE."
# else
# Check if the AR4WE file exists in the current directory before attempting to copy
if [ -f "./AR4WE" ]; then
echo "Attempting to install AR4WE to /usr/bin..."
# Copy the script to /usr/bin and change its permissions to executable
if [[ $EUID -ne 0 ]]; then
$SUDO cp "./AR4WE" "/usr/bin/AR4WE" && $SUDO chmod +x "/usr/bin/AR4WE"
else
cp "./AR4WE" "/usr/bin/AR4WE" && chmod +x "/usr/bin/AR4WE"
fi
if [ -f "/usr/bin/AR4WE" ]; then
echo "AR4WE script successfully installed in /usr/bin/AR4WE."
else
echo "Failed to install AR4WE script in /usr/bin/AR4WE."
exit 1
fi
else
echo "AR4WE script not found in the current directory."
exit 1
fi
# fi
# # and put it in the wordlists directory
mkdir -p /opt/wordlists
mkdir -p /opt/wordlists/dirb
# Check and download the first file if it does not exist
if [ ! -f /opt/wordlists/dirb/common.txt ]; then
$SUDO wget https://raw.githubusercontent.com/cujanovic/dirsearch-wordlist/master/serbian-english-wordlist-final-dirsearch-format-with-ext.txt -O /opt/wordlists/dirb/common.txt
else
echo "File /opt/wordlists/dirb/common.txt already exists, not downloading to avoid overwriting."
fi
# Check and download the second file if it does not exist
if [ ! -f /opt/wordlists/subSub.txt ]; then
$SUDO wget https://wordlists-cdn.assetnote.io/data/automated/httparchive_subdomains_2024_04_28.txt -O /opt/wordlists/subSub.txt
else
echo "File /opt/wordlists/subSub.txt already exists, not downloading to avoid overwriting."
fi
# download this wordlist : https://raw.githubusercontent.com/cujanovic/dirsearch-wordlist/master/serbian-english-wordlist-final-dirsearch-format-with-ext.txt