-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathadenum.sh
executable file
·33 lines (28 loc) · 1.01 KB
/
adenum.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
#!/bin/bash
# Function to display the usage of the script
usage() {
printf "%s\n" "Syntax: $0 'IP address' 'username' 'password' 'domain'"
printf "%s\n" "Example: $0 10.10.10.10 'admin' 'Password123!' 'mydomain.local'"
printf "%s\n" "Note: If the password contains special characters, remember to escape them or enclose them in single quotes."
printf "\n"
exit 1
}
# Ensure the script is run as root
if [ "$(id -u)" -ne 0 ]; then
printf "%s\n" "Please run as root"
exit
fi
# Check if four arguments are supplied
if [ $# -ne 4 ]; then
printf "%s\n" "Error: Incorrect number of arguments supplied."
usage
fi
# Assign variables to arguments for better readability
ipaddress=$1
username=$2
password=$3
domain=$4
output_file="ADenum_output_${ipaddress//./_}.txt"
# Run ADenum.py with the provided arguments and save output to file
printf "Running ADenum.py with the supplied arguments...\n"
python ./ADenum/ADenum.py -ip "$ipaddress" -u "$username" -p "$password" -d "$domain" -c | tee "$output_file"