Skip to content

Commit ce3a33d

Browse files
committed
Updated Security Tools
1 parent 7d6a930 commit ce3a33d

11 files changed

Lines changed: 67 additions & 18 deletions

File tree

enginescript-variables.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-
88

99
# EngineScript Version
10-
VARIABLES_DATE="SEPTEMBER 20 2023"
10+
VARIABLES_DATE="SEPTEMBER 28 2023"
1111

1212
# Software Versions
1313
MARIADB_VER="10.11"
@@ -19,7 +19,7 @@ PCRE2_VER="10.42"
1919
PHP_VER="8.1"
2020
PHPMYADMIN_VER="5.2.1"
2121
PNGOUT_VER="20200115"
22-
WORDFENCE_CLI_VER="1.0.1"
22+
WORDFENCE_CLI_VER="1.1.0"
2323
ZLIB_VER="1.3"
2424

2525
# Old Software Versions

scripts/functions/security/10up-vuln-scanner.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ fi
2626

2727
cd /var/www/sites
2828
printf "Please select the site you want to scan for vulnerabilities:\n"
29-
select d in */; do test -n "$d" && break; echo ">>> Invalid Selection"; done
30-
cd "$d"html && echo "10up Vulnerability Scanner is running. Scan may take a bit, standby for results."
29+
select d in *; do test -n "$d" && break; echo ">>> Invalid Selection"; done
30+
cd "$d"/html && echo "10up Vulnerability Scanner is running. Scan may take a bit, standby for results."
3131
wp vuln status --allow-root
3232

3333
# Ask user to acknowledge that the scan has completed before moving on

scripts/functions/security/php-malware-finder.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ fi
2626

2727
cd /var/www/sites
2828
printf "Please select the site you want to scan for vulnerabilities:\n"
29-
select d in */; do test -n "$d" && break; echo ">>> Invalid Selection"; done
30-
cd "$d"html && echo "PHP Malware Finder is running. Scan may take a bit, standby for results."
29+
select d in *; do test -n "$d" && break; echo ">>> Invalid Selection"; done
30+
cd "$d"/html && echo "PHP Malware Finder is running. Scan may take a bit, standby for results."
3131
yara -r /usr/local/bin/php-malware-finder/php-malware-finder/php.yar ./wp-content
3232

3333
# Ask user to acknowledge that the scan has completed before moving on

scripts/functions/security/wordfence-cli.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,19 @@ fi
2525
# Start Main Script
2626

2727
cd /var/www/sites
28-
/usr/local/src/wordfence scan --output-path /home/EngineScript/wordfence-scan-results/wordfence-cli-scan-results.csv /usr/src
28+
printf "Please select the site you want to scan for vulnerabilities:\n"
29+
select d in *; do test -n "$d" && break; echo ">>> Invalid Selection"; done
30+
cd "$d"/html && echo "WordPress CLI is running. This scan may take a bit, standby for results."
31+
echo "When completed, the scan results will be located at:"
32+
echo "/home/EngineScript/wordfence-scan-results/wordfence-cli-scan-results.csv"
33+
34+
# Scan
35+
/usr/local/src/Wordfence-CLI/wordfence scan --progress --images --output-path /home/EngineScript/wordfence-scan-results/wordfence-cli-scan-results.csv /var/www/sites
2936

3037
# Ask user to acknowledge that the scan has completed before moving on
3138
echo ""
3239
echo ""
33-
echo "scan results will be located at:"
40+
echo "The scan results will be located at:"
3441
echo "/home/EngineScript/wordfence-scan-results/wordfence-cli-scan-results.csv"
3542
echo ""
3643
read -n 1 -s -r -p "Press any key to continue"

scripts/functions/server-tools/wp-cli-doctor.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ fi
2626

2727
cd /var/www/sites
2828
printf "Please select the site you want to scan for issues\n"
29-
select d in */; do test -n "$d" && break; echo ">>> Invalid Selection"; done
30-
cd "$d"html && echo "WP-CLI Doctor is running. Scan may take a bit, standby for results."
29+
select d in *; do test -n "$d" && break; echo ">>> Invalid Selection"; done
30+
cd "$d"/html && echo "WP-CLI Doctor is running. Scan may take a bit, standby for results."
3131
wp doctor check --allow-root
3232

3333
# Ask user to acknowledge that the scan has completed before moving on

scripts/install/cron/cron-install.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ fi
7575
(crontab -l 2>/dev/null; echo "51 5 1 * * cd /usr/local/bin/enginescript/scripts/functions/cron; bash ufw-cloudflare-cron.sh >/dev/null 2>&1") | crontab -
7676

7777
# Update WP-CLI & Packages (daily)
78-
(crontab -l 2>/dev/null; echo "52 5 * * * cd /usr/local/bin/enginescript/scripts/functions/cron; bash wp-cli-update.sh >/dev/null 2>&1") | crontab -
78+
(crontab -l 2>/dev/null; echo "52 5 * * * cd /usr/local/bin/enginescript/scripts/update; bash wp-cli-update.sh >/dev/null 2>&1") | crontab -
79+
80+
# Update Wordfence CLI (daily)
81+
(crontab -l 2>/dev/null; echo "53 5 * * * cd /usr/local/bin/enginescript/scripts/update; bash wordfence-cli-update.sh >/dev/null 2>&1") | crontab -
7982

8083
# Reset Ownership & Permissions for WordPress and EngineScript (daily)
8184
(crontab -l 2>/dev/null; echo "54 5 * * * cd /usr/local/bin/enginescript/scripts/functions/cron; bash permissions.sh >/dev/null 2>&1") | crontab -

scripts/install/tools/security/wordfence-cli.sh

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,23 @@ fi
2727
# Wordfence CLI Malware scanner
2828

2929
# Install
30-
cd /usr/local/src
31-
wget https://github.com/wordfence/wordfence-cli/releases/download/v${WORDFENCE_CLI_VER}/wordfence_${WORDFENCE_CLI_VER}_amd64_linux_exec.tar.gz --no-check-certificate
32-
tar xvzf wordfence_${WORDFENCE_CLI_VER}_amd64_linux_exec.tar.gz
30+
mkdir -p /usr/local/src/Wordfence-CLI/
31+
rm -rf /usr/local/src/Wordfence-CLI/wordfence
32+
wget -O /usr/src/wordfence_${WORDFENCE_CLI_VER}_amd64_linux_exec.tar.gz https://github.com/wordfence/wordfence-cli/releases/download/v${WORDFENCE_CLI_VER}/wordfence_${WORDFENCE_CLI_VER}_amd64_linux_exec.tar.gz --no-check-certificate
33+
tar -xvf /usr/src/wordfence_${WORDFENCE_CLI_VER}_amd64_linux_exec.tar.gz
34+
mv /usr/src/wordfence /usr/local/src/Wordfence-CLI/wordfence
35+
36+
# Make Results Directory
3337
mkdir -p /home/EngineScript/wordfence-scan-results
38+
39+
# Make Cache Directory
3440
mkdir -p ~/.cache/wordfence
35-
mkdir -p ~/.config/wordfence
3641
chmod 775 ~/.cache/wordfence
37-
touch ~/.config/wordfence/wordfence-cli.ini
3842

3943
# Configuration
4044
# Create your token at https://www.wordfence.com/products/wordfence-cli/
45+
mkdir -p ~/.config/wordfence
46+
touch ~/.config/wordfence/wordfence-cli.ini
4147
cat >>~/.config/wordfence/wordfence-cli.ini <<EOL
4248
[SCAN]
4349
license = ${WORDFENCE_CLI_TOKEN}

scripts/menu/security-tools-menu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ while true
3232
echo ""
3333
echo ""
3434
PS3='Please enter your choice: '
35-
secoptions=("10up WP-CLI Vulnerability Scanner" "PHP Malware Finder" "Wordfence CLI Malware Scan" "WPScan Vulnerability Scan" "Exit Security Tools")
35+
secoptions=("10up WP-CLI Vulnerability Scan" "PHP Malware Finder" "Wordfence CLI Malware Scan" "WPScan Vulnerability Scan" "Exit Security Tools")
3636
select secopt in "${secoptions[@]}"
3737
do
3838
case $secopt in
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
#----------------------------------------------------------------------------
3+
# EngineScript - A High-Performance WordPress Server Built on Ubuntu and Cloudflare
4+
#----------------------------------------------------------------------------
5+
# Website: https://EngineScript.com
6+
# GitHub: https://github.com/Enginescript/EngineScript
7+
# Company: VisiStruct / EngineScript
8+
# License: GPL v3.0
9+
# OS: Ubuntu 22.04 (jammy)
10+
#----------------------------------------------------------------------------
11+
12+
# EngineScript Variables
13+
source /usr/local/bin/enginescript/enginescript-variables.txt
14+
source /home/EngineScript/enginescript-install-options.txt
15+
16+
# Check current user's ID. If user is not 0 (root), exit.
17+
if [ "${EUID}" != 0 ];
18+
then
19+
echo "${BOLD}ALERT:${NORMAL}"
20+
echo "EngineScript should be executed as the root user."
21+
exit
22+
fi
23+
24+
#----------------------------------------------------------------------------
25+
# Start Main Script
26+
27+
#----------------------------------------------------------------------------
28+
29+
# Update Wordfence CLI
30+
rm -rf /usr/local/src/Wordfence-CLI/wordfence
31+
wget -O /usr/src/wordfence_${WORDFENCE_CLI_VER}_amd64_linux_exec.tar.gz https://github.com/wordfence/wordfence-cli/releases/download/v${WORDFENCE_CLI_VER}/wordfence_${WORDFENCE_CLI_VER}_amd64_linux_exec.tar.gz --no-check-certificate
32+
tar -xvf /usr/src/wordfence_${WORDFENCE_CLI_VER}_amd64_linux_exec.tar.gz
33+
mv /usr/src/wordfence /usr/local/src/Wordfence-CLI/wordfence

0 commit comments

Comments
 (0)