Skip to content

Commit eb59bca

Browse files
committed
More Wordfence CLI updates
Added vuln-scan option and changed update option.
1 parent 9153c4f commit eb59bca

4 files changed

Lines changed: 57 additions & 10 deletions

File tree

scripts/functions/security/wordfence-cli.sh renamed to scripts/functions/security/wordfence-cli-malware-scan.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ fi
2525
# Start Main Script
2626

2727
cd /var/www/sites
28-
printf "Please select the site you want to scan for vulnerabilities:\n"
28+
printf "Please select the site you want to scan for malware:\n"
2929
select d in *; do test -n "$d" && break; echo ">>> Invalid Selection"; done
30-
cd "$d" && echo "WordPress CLI is running. This scan may take a bit, standby for results."
30+
cd "$d" && echo "WordPress CLI malware scan is running. This scan may take a bit, standby for results."
3131
echo "When completed, the scan results will be located at:"
3232
echo "/home/EngineScript/wordfence-scan-results/wordfence-cli-scan-results.csv"
3333

3434
# Scan
35-
wordfence malware-scan --images --output-path /home/EngineScript/wordfence-scan-results/wordfence-cli-scan-results.csv /var/www/sites/${d}/html
35+
wordfence malware-scan --images --output-path /home/EngineScript/wordfence-malware-scan-results/wordfence-cli-malware-scan-results.csv /var/www/sites/${d}/html
3636

3737
# Ask user to acknowledge that the scan has completed before moving on
3838
echo ""
3939
echo ""
4040
echo "The scan results will be located at:"
41-
echo "/home/EngineScript/wordfence-scan-results/wordfence-cli-scan-results.csv"
41+
echo "/home/EngineScript/wordfence-scan-results/wordfence-cli-malware-scan-results.csv"
4242
echo ""
4343
read -n 1 -s -r -p "Press any key to continue"
4444
echo ""
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
cd /var/www/sites
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" && echo "WordPress CLI vulnerability scan 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-vulnerability-scan-results.csv"
33+
34+
# Scan
35+
wordfence vuln-scan --images --output-path /home/EngineScript/wordfence-scan-results/wordfence-cli-vulnerability-scan-results.csv /var/www/sites/${d}/html
36+
37+
# Ask user to acknowledge that the scan has completed before moving on
38+
echo ""
39+
echo ""
40+
echo "The scan results will be located at:"
41+
echo "/home/EngineScript/wordfence-scan-results/wordfence-cli-vulnerability-scan-results.csv"
42+
echo ""
43+
read -n 1 -s -r -p "Press any key to continue"
44+
echo ""
45+
echo ""

scripts/menu/security-tools-menu.sh

Lines changed: 6 additions & 2 deletions
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 Scan" "Find PHP Files in Uploads Directory" "PHP Malware Finder" "Wordfence CLI Malware Scan" "WP-CLI Doctor" "WPScan Vulnerability Scan" "Exit Security Tools")
35+
secoptions=("10up WP-CLI Vulnerability Scan" "Find PHP Files in Uploads Directory" "PHP Malware Finder" "Wordfence CLI Malware Scan" "Wordfence CLI Vulnerability Scan" "WP-CLI Doctor" "WPScan Vulnerability Scan" "Exit Security Tools")
3636
select secopt in "${secoptions[@]}"
3737
do
3838
case $secopt in
@@ -49,7 +49,11 @@ while true
4949
break
5050
;;
5151
"Wordfence CLI Malware Scan")
52-
/usr/local/bin/enginescript/scripts/functions/security/wordfence-cli.sh
52+
/usr/local/bin/enginescript/scripts/functions/security/wordfence-cli-malware-scan.sh
53+
break
54+
;;
55+
"Wordfence CLI Vulnerability Scan")
56+
/usr/local/bin/enginescript/scripts/functions/security/wordfence-cli-vuln-scan.sh
5357
break
5458
;;
5559
"WP-CLI Doctor")

scripts/update/wordfence-cli-update.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ fi
2828

2929
# Update Wordfence CLI
3030

31-
rm -rf /usr/local/src/Wordfence-CLI/wordfence
3231
cd /usr/src
33-
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
34-
tar -xvf wordfence_${WORDFENCE_CLI_VER}_amd64_linux_exec.tar.gz
35-
mv /usr/src/wordfence /usr/local/src/Wordfence-CLI/wordfence
32+
wget -O /usr/src https://github.com/wordfence/wordfence-cli/releases/latest/download/wordfence.deb --no-check-certificate
33+
sudo apt install /usr/src/wordfence.deb -y

0 commit comments

Comments
 (0)