-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.sh
More file actions
75 lines (62 loc) · 1.94 KB
/
setup.sh
File metadata and controls
75 lines (62 loc) · 1.94 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
#!/bin/bash
# Cobalt Strike Web Client Setup Script
echo "=== Cobalt Strike Web Client Setup ==="
# Check Python version
python_version=$(python3 --version 2>&1)
if [[ $? -ne 0 ]]; then
echo "Error: Python 3 is not installed or not in PATH"
exit 1
fi
echo "Using $python_version"
# Create virtual environment
echo "Creating virtual environment..."
python3 -m venv venv
# Activate virtual environment
echo "Activating virtual environment..."
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
source venv/Scripts/activate
else
source venv/bin/activate
fi
# Upgrade pip
echo "Upgrading pip..."
pip install --upgrade pip
# Install dependencies
echo "Installing dependencies..."
pip install -r requirements.txt
# Create necessary directories
echo "Creating directories..."
mkdir -p logs
mkdir -p certs
# Copy environment file
if [[ ! -f .env ]]; then
echo "Creating .env file from template..."
cp .env.example .env
echo "Please edit .env file with your configuration"
fi
# Generate self-signed certificate for development
if [[ ! -f certs/cert.pem ]]; then
echo "Generating self-signed certificate for development..."
openssl req -x509 -newkey rsa:4096 -keyout certs/key.pem -out certs/cert.pem -days 365 -nodes \
-subj "/C=US/ST=State/L=City/O=Organization/CN=localhost"
fi
# Set file permissions
chmod 600 certs/key.pem
chmod 644 certs/cert.pem
echo ""
echo "=== Setup Complete ==="
echo ""
echo "Next steps:"
echo "1. Edit the .env file with your Cobalt Strike server details"
echo "2. Ensure your Cobalt Strike team server has REST API enabled"
echo "3. Run the application:"
echo " python run.py"
echo ""
echo "The application will be available at: https://127.0.0.1:5000"
echo ""
echo "Security Notes:"
echo "- Change the SECRET_KEY in .env before production use"
echo "- Use proper SSL certificates in production"
echo "- Ensure firewall rules are properly configured"
echo "- Monitor logs for security events"
echo ""