-
Notifications
You must be signed in to change notification settings - Fork 0
/
photon2.sh
72 lines (60 loc) · 2.19 KB
/
photon2.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
#!/bin/bash
# Check if git is installed
if ! command -v git &> /dev/null
then
echo "git could not be found. Please install git to continue."
exit 1
fi
# Directory to store OSINT Tools
tools_dir="$HOME/OSINTTools"
# Photon repository and local path
photon_repo="https://github.com/s0md3v/Photon.git"
photon_dir="$tools_dir/Photon"
# Check if Photon is installed, if not, clone it from GitHub
if [ ! -d "$photon_dir" ]; then
echo "Photon not found, downloading..."
mkdir -p "$tools_dir"
git clone "$photon_repo" "$photon_dir"
echo "Photon downloaded."
fi
# Store the command in a variable using dynamic path
python3=$(which python3)
photon="$photon_dir/photon.py"
# Directory to store the results
results="$tools_dir/results"
# Check if the results directory exists, if not, create it
if [ ! -d "$results" ]; then
mkdir -p "$results"
fi
while true; do
clear
echo "=============================================================================="
echo "Photon Scanner:"
echo "=============================================================================="
echo "1. Scan website"
echo "2. Clone website"
echo "3. Return to main menu"
read -p "Select an option (1-3): " option
if [ "$option" == "1" ]; then
read -p "Enter the website URL to scan: " url
website=$(basename "$url")
destination_directory="$results/$website"
echo "Creating directory $destination_directory and scanning $url ..."
mkdir -p "$destination_directory"
"$python3" "$photon" -u "$url" -o "$destination_directory"
read -p "Press Enter to continue..."
elif [ "$option" == "2" ]; then
read -p "Enter the website URL to clone: " url
website=$(basename "$url")
destination_directory="$results/$website"
echo "Creating directory $destination_directory and cloning $url ..."
mkdir -p "$destination_directory"
"$python3" "$photon" -u "$url" --clone -o "$destination_directory"
read -p "Press Enter to continue..."
elif [ "$option" == "3" ]; then
break
else
echo "Invalid option. Please select a valid option."
read -p "Press Enter to continue..."
fi
done