强化任何 WordPress 安装的安全性。
❮ 注意 ❯ 此工具会定期发布新版本。请确保经常更新依赖关系以获取最新版本。查看更新日志或 CHANGELOG.md 了解新功能。
安装 WPHardening 需要执行一条控制台命令:
$ pip install -r requirements.txt
$ python wphardening.py -h
__ _______ _ _ _ _
\ \ / / __ \| | | | | | (_)
\ \ /\ / /| |__) | |__| | __ _ _ __ __| | ___ _ __ _ _ __ __ _
\ \/ \/ / | ___/| __ |/ _` | '__/ _` |/ _ \ '_ \| | '_ \ / _` |
\ /\ / | | | | | | (_| | | | (_| | __/ | | | | | | | (_| |
\/ \/ |_| |_| |_|\__,_|_| \__,_|\___|_| |_|_|_| |_|\__, |
__/ |
Fortify the security of any WordPress installation. |___/
Caceria de Spammers - http://www.caceriadespammers.com.ar
Usage: python wphardening.py [options]
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-v, --verbose Active verbose mode output results
--update Check for WPHardening latest stable version
Target:
This option must be specified to modify the package WordPress.
-d DIRECTORY, --dir=DIRECTORY
**REQUIRED** - Working Directory.
--load-conf=FILE Load file configuration.
Hardening:
Different tools to hardening WordPress.
-c, --chmod Chmod 755 in directory and 644 in files.
-r, --remove Remove files and directory.
-b, --robots Create file robots.txt
-f, --fingerprinting
Deleted fingerprinting WordPress.
-t, --timthumb Find the library TimThumb.
--chown=user:group Changing file and directory owner.
--wp-config Wizard generated wp-config.php
--plugins Download Plugins Security.
--proxy=PROXY Use a HTTP proxy to connect to the target url for
--plugins and --wp-config.
--indexes It deny you to display the contents of directories.
--minify Compressing static file .css and .js
--malware-scan Malware Scan in WordPress project.
--6g-firewall 6G Firewall.
--rest-api Disable REST API.
Miscellaneous:
-o FILE, --output=FILE
Write log report to FILE.log
使用工具前,我们必须确保工作目录是 WordPress。
$ python wphardening.py -d /home/path/to/wordpress -v
此选项用于为文件和目录设置正确的权限。
$ python wphardening.py -d /home/path/to/wordpress --chmod -v
加固任何系统的一部分是移除不需要的文件、目录或组件。
$ python wphardening.py -d /home/path/to/wordpress --remove -v
WordPress 默认不包含 robots.txt 文件,通过此选项我们可以自定义我们的 robots.txt。
$ python wphardening.py -d /home/path/to/wordpress --robots -v
更多信息请参考 robots.txt
$ python wphardening.py -d /home/path/to/wordpress --fingerprinting -v
$ python wphardening.py -d /home/path/to/wordpress --timthumb -v
创建此文件是为了避免在目录中浏览。
$ python wphardening.py -d /home/path/to/wordpress --indexes -v
以下是常用安全插件的列表,可以自动下载:
$ python wphardening.py -d /home/path/to/wordpress --plugins
此命令会自动创建一个名为 wp-config-wphardening.php 的文件,之后可以重命名。
$ python wphardening.py -d /home/path/to/wordpress --wp-config
$ python wphardening.py -d /home/path/to/wordpress --6g-firewall
$ python wphardening.py -d /home/path/to/wordpress --rest-api
通过此选项,您可以随时拥有 WPHardening 的最新版本。
$ python wphardening.py --update
$ python wphardening.py -d /home/path/to/wordpress -c -r -f -t --wp-config --indexes --plugins --6g-firewall --rest-api -o /home/user/wphardening.log
https://github.com/elcodigok/wphardening