At this time, I was using dirsearch. (I would use ffuf or feroxbuster these days)
(something like the image)
I discovered, (by proxying the site through Burp Suite and looking at responses and errors), that the application was written in CodeIgniter. Noted this down.
(3/16)
The content discovery yielded several paths, a few of note:
(4/16)
Visiting these gave nothing (to be expected) but I noted them all down.
During spidering an additional path was found on the above:
/123/minify/minfycss/
(5/16)
When doing content discovery, special characters in the lists were giving errors that were interesting. PHP errors having to do with wrong pathing.
I began to expect there might be a path-based Local File Inclusion...
(6/16)
Fuzzing the path with things like:
/123/minify/minfycss/../../../../../etc/passwd
gave different errors on the incorrect pathing format.
I fuzz things like this with the LFI list in Seclists:
after MUCH trial and error (and bringing in some fellow testers) we found the correct pathing for /etc/passwd (helped by phpinfo)
The big once was that that the minify function was stripping periods in our ../
but also using underscores (instead) for pathing in nix.
(8/16)
We ended up doing something like this:
/123/minify/minfycss/__/__/__/__/__/etc/passwd
BAM. It Worked! "root dance" #1
(9/16)
We weren't sure if the underscore behavior was because of a CodeIgniter feature or the way the minify function was written.
So now we could read any file on the webserver.
Pentesting is a circular methodology.
(10/16)
So we used that vulnerability to pull down all the configuration files for CodeIgniter.
This included multiple API keys.
Remember the database.php file from earlier?
yep... it had database credentials in it!
Remember phpmyadmin? We used those creds there.
(11/16)
Boom we had access to the complete database of users.
Enter "root dance" #2
Remember gmail.php?
It contained developer Gmail creds for some sort of integration. We could log into Gmail of the administrator of the company.
Full permissions on Gsuite.
(12/16)
We used Phpmyadmin to add ourselves as users to the
/adminpanel
and got access to the backend super user part of the site.
It had the control to do everything. It had all the log access, configs, etc, etc.
(13/16)
We also bypassed their image upload. We were able to upload a PHP shell.
One function checked for images by checking the binary header, but not the file extension (on the server-side). We uploaded a shell with a gif binary header through Burp Suite as a .PHP file
(14/16)
In the end, the methodology and documentation of your hacking are important. Persistence is key.
We had full access to every portion of the company.
If you don't want to use a VPS or run native (dual-boot Linux) you can install Ubuntu and WSL 2.
(+) You'll (probably) benefit from more memory, cores, and a fast broadband connection.
(+) You can eliminate or supplement your VPS costs
(+) Usability is nice (file management, copy-paste)
(-) WSL2 does not yet support raw sockets, so no nmap or masscan
(-) Mass DNS requests (resolver tools like massdns/puredn) will crash WSL DNS for some reason
2/3
(-) on wsl 1.0 (if you decide to use that) git is painfully slow, including setting up dependencies in large frameworks like reconFTW
(+) ... Your gains in speed per dollar are good. Most gaming rigs equivalent VPS (proc/mem/storage) costs will run you $80-$120 on Digital Ocean