r/netsecstudents • u/0xshell_ • 3h ago
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.php page with your cookie and grep/awk out the _wpnonce value.
The Payload Upload: Finally, using curl -F to send the malicious zip file as multipart/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.