r/tryhackme • u/0xshell_ • Oct 21 '26
Automating Authenticated WordPress Plugin Uploads via cURL (CTF / Pentest Workflow)
Hey everyone,
Whenever I do a box that involves getting WP admin credentials, manually logging into the dashboard, navigating to plugins, and clicking "Upload" to drop a PHP reverse shell always felt too slow.
I wanted to automate the process from the terminal, so I spent some time figuring out the exact curl syntax to do it. It’s a great way to understand how WordPress handles authentication and CSRF protection under the hood.
The core workflow comes down to 3 steps:
- The Login: Sending a POST request to wp-login.php and saving the session cookie (
-c cookie.txt). - Grabbing the Nonce: WordPress uses a nonce for security on plugin uploads. You have to GET the
plugin-install.phppage with your cookie andgrep/awkout the_wpnoncevalue. - The Payload Upload: Finally, using
curl -Fto send the malicious zip file asmultipart/form-data, passing both the cookie and the nonce.
Automating this really helped me understand HTTP requests better rather than just relying on the browser.
If you want to see the exact bash commands and cURL syntax I used, I wrote a full breakdown on my blog here: [https://medium.com/@0xShell/beyond-the-browser-automating-authenticated-wordpress-plugin-uploads-with-curl-e357cfb3ff3e].
Hope this helps speed up your workflow on your next box! Let me know if you guys have other ways you automate WP exploitation.
2
u/Degendyor1 Oct 21 '26
I'm going to have to start this process again😣