-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·93 lines (75 loc) · 2.77 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·93 lines (75 loc) · 2.77 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
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
THEHULK_PATH=$(pwd)
# Define green color for echo
GREEN='\033[0;32m'
NC='\033[0m' # No Color
### Install nodejs, npm, http-server
echo -e "${GREEN}Installing nodejs, npm, and http-server...${NC}"
sudo apt update
sudo apt install -y nodejs npm
sudo npm install -g http-server
### Install crawler
echo -e "${GREEN}Installing crawler dependencies...${NC}"
pushd $THEHULK_PATH/crawler
npm install
popd
### Install proxy-server
if ! command -v conda &> /dev/null; then
echo -e "${GREEN}Miniconda is not installed. Installing Miniconda...${NC}"
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda3
rm miniconda.sh
export PATH="$HOME/miniconda3/bin:$PATH"
conda init bash
source ~/.bashrc
fi
# Create the conda environment if it doesn't exist
if ! conda env list | grep -q "mitmproxy_env"; then
echo -e "${GREEN}Creating conda environment 'mitmproxy_env'...${NC}"
conda create -n mitmproxy_env python=3.8 -y
fi
# Activate the conda environment
source ~/miniconda3/etc/profile.d/conda.sh
conda activate mitmproxy_env
## TODO: Install the certificate of proxy server
# Install requirements in the conda environment
echo -e "${GREEN}Installing proxy-server dependencies...${NC}"
pushd $THEHULK_PATH/proxy-server
pip install -r requirements.txt
npm install
popd
### Install taint engine
echo -e "${GREEN}Installing taint engine dependencies...${NC}"
pushd $THEHULK_PATH/gadget-detection
npm install
popd
### Install exploit generation engine
echo -e "${GREEN}Installing exploit generation engine dependencies...${NC}"
pushd $THEHULK_PATH/exploit-gen
npm install
popd
### Install the dependencies: Jalangi2
echo -e "${GREEN}Installing Jalangi2 dependencies...${NC}"
pushd $THEHULK_PATH/libs/jalangi2
npm install
popd
### Install dom-clobbering-collection
echo -e "${GREEN}Installing dom-clobbering-collection dependencies...${NC}"
pushd $THEHULK_PATH/dataset/dom-clobbering-collection/domc-gadgets-assets/attacker.com
npm install
popd
### Setup the network proxy for testing
echo -e "${GREEN}Setting up the network proxy for testing...${NC}"
# Set proxy environment variables
export http_proxy=http://127.0.0.1:8899
export https_proxy=http://127.0.0.1:8899
# Make the proxy settings persistent by adding them to ~/.bashrc
if ! grep -q "http_proxy=http://127.0.0.1:8899" ~/.bashrc; then
echo "export http_proxy=http://127.0.0.1:8899" >> ~/.bashrc
echo "export https_proxy=http://127.0.0.1:8899" >> ~/.bashrc
echo -e "${GREEN}Proxy settings added to ~/.bashrc for persistence.${NC}"
fi
# Apply the proxy settings to the current session
source ~/.bashrc
echo -e "${GREEN}Network proxy set to http://127.0.0.1:8899${NC}"
echo -e "${GREEN}Installation and proxy setup completed successfully.${NC}"