-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
202 lines (173 loc) · 6.36 KB
/
Copy pathinstall.sh
File metadata and controls
202 lines (173 loc) · 6.36 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
#!/bin/bash
# Resident Orca - Installation Script
# Supports: Ubuntu/Debian, RHEL/CentOS, Fedora, Arch, macOS
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
echo -e "${BLUE}"
echo "╔══════════════════════════════════════════════════════════════╗"
echo "║ 🐋 RESIDENT ORCA - INSTALLATION SCRIPT v1.0 ║"
echo "╚══════════════════════════════════════════════════════════════╝"
echo -e "${NC}"
# Detect OS
detect_os() {
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if [ -f /etc/os-release ]; then
. /etc/os-release
OS=$ID
VER=$VERSION_ID
else
OS="linux"
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
OS="macos"
else
OS="unknown"
fi
echo -e "${GREEN}✓ Detected OS: $OS${NC}"
}
# Install system dependencies
install_deps() {
echo -e "\n${YELLOW}Installing system dependencies...${NC}"
case $OS in
ubuntu|debian)
sudo apt-get update
sudo apt-get install -y python3 python3-pip python3-venv \
nmap whois dnsutils net-tools iputils-ping traceroute \
curl wget git build-essential libpcap-dev iptables \
tcpdump nikto
;;
rhel|centos|fedora)
sudo yum install -y python3 python3-pip nmap whois \
bind-utils net-tools iputils traceroute curl wget \
git gcc libpcap-devel iptables tcpdump
;;
arch)
sudo pacman -S --noconfirm python python-pip nmap \
bind-tools net-tools iputils traceroute curl wget \
git base-devel libpcap iptables tcpdump
;;
macos)
brew install python3 nmap whois bind net-tools \
traceroute curl wget git libpcap iptables tcpdump
;;
*)
echo -e "${RED}Unsupported OS. Please install dependencies manually.${NC}"
;;
esac
echo -e "${GREEN}✓ System dependencies installed${NC}"
}
# Setup Python virtual environment
setup_venv() {
echo -e "\n${YELLOW}Setting up Python virtual environment...${NC}"
python3 -m venv orca_env
source orca_env/bin/activate
echo -e "${GREEN}✓ Virtual environment created${NC}"
}
# Install Python packages
install_python_packages() {
echo -e "\n${YELLOW}Installing Python packages...${NC}"
pip install --upgrade pip
# Install with optimizations
pip install --no-cache-dir \
requests>=2.31.0 \
paramiko>=3.3.0 \
psutil>=5.9.0 \
Flask>=2.3.0 \
matplotlib>=3.7.0 \
seaborn>=0.12.0 \
numpy>=1.24.0 \
reportlab>=4.0.0 \
scapy>=2.5.0 \
whois>=0.9.0 \
qrcode>=7.4.0 \
pyshorteners>=1.0.1 \
discord.py>=2.3.0 \
telethon>=1.34.0 \
slack-sdk>=3.23.0 \
colorama>=0.4.6
echo -e "${GREEN}✓ Python packages installed${NC}"
}
# Create configuration directories
create_dirs() {
echo -e "\n${YELLOW}Creating configuration directories...${NC}"
mkdir -p .resident_orca/ssh_keys
mkdir -p .resident_orca/phishing_pages
mkdir -p orca_reports/graphics
mkdir -p temp
echo -e "${GREEN}✓ Directories created${NC}"
}
# Create config file
create_config() {
echo -e "\n${YELLOW}Creating default configuration...${NC}"
cat > .resident_orca/config.json << EOF
{
"version": "1.0.0",
"database": ".resident_orca/orca_data.db",
"log_file": ".resident_orca/orca.log",
"web_port": 5000,
"phishing_port": 8080,
"auto_start_web": true,
"max_command_history": 1000,
"threat_detection": true,
"auto_block_threats": false
}
EOF
echo -e "${GREEN}✓ Configuration created${NC}"
}
# Create launcher script
create_launcher() {
echo -e "\n${YELLOW}Creating launcher script...${NC}"
cat > run_orca.sh << 'EOF'
#!/bin/bash
source orca_env/bin/activate
python3 resident_orca.py "$@"
EOF
chmod +x run_orca.sh
echo -e "${GREEN}✓ Launcher created: ./run_orca.sh${NC}"
}
# Create desktop entry (Linux)
create_desktop_entry() {
if [[ "$OS" != "macos" ]]; then
cat > ~/.local/share/applications/resident-orca.desktop << EOF
[Desktop Entry]
Name=Resident Orca
Comment=Cybersecurity Command & Control Server
Exec=$(pwd)/run_orca.sh
Icon=$(pwd)/.resident_orca/orca_icon.png
Terminal=true
Type=Application
Categories=Network;Security;
EOF
echo -e "${GREEN}✓ Desktop entry created${NC}"
fi
}
# Main installation
main() {
detect_os
install_deps
setup_venv
install_python_packages
create_dirs
create_config
create_launcher
echo -e "\n${GREEN}════════════════════════════════════════════════════════════════${NC}"
echo -e "${GREEN}✅ RESIDENT ORCA INSTALLATION COMPLETE!${NC}"
echo -e "${GREEN}════════════════════════════════════════════════════════════════${NC}"
echo -e "\n${YELLOW}To start Resident Orca:${NC}"
echo -e " ${BLUE}./run_orca.sh${NC}"
echo -e "\n${YELLOW}To run in background:${NC}"
echo -e " ${BLUE}./run_orca.sh &${NC}"
echo -e "\n${YELLOW}To run tests:${NC}"
echo -e " ${BLUE}source orca_env/bin/activate && python3 test_commands.py${NC}"
echo -e "\n${YELLOW}Web Dashboard:${NC}"
echo -e " ${BLUE}http://localhost:5000${NC}"
echo -e "\n${YELLOW}For help:${NC}"
echo -e " ${BLUE}type 'help' at the Orca prompt${NC}"
echo -e "\n${GREEN}════════════════════════════════════════════════════════════════${NC}"
}
main "$@"