Jason Haddix Profile picture
Apr 4 16 tweets 4 min read
(a LONG thread) 🧵

Inspired by @infosec_au & @hacker_ here's one of my fun hacker stories:

= The complete compromise of a password manager company =

Here's how I did it (so you can learn):

I was given the project to pentest a password manager company: *.redacted.com

(1/16)
No physical or phishing. The site was certified McAffee Secure! 😉

The 1st two days were spent doing recon, walking the application, and doing content discovery.

I used the

github.com/danielmiessler…

github.com/danielmiessler…

bruteforce lists for content discovery.

(2/16)
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:

github.com/danielmiessler…

(7/16)
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.

(15/15)
Ok @lixmk , I'll make it (16/16)

Please like & retweet if you want more jhaddix hacker stories 🤓

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Jason Haddix

Jason Haddix Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @Jhaddix

Apr 3
SO you're a bounty hunter with a gaming rig? 🧵

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
Read 12 tweets
Mar 21
#bugbountytips

🧵 1/x

Starting from almost scratch. Testing Environment:

DO Ubuntu VPS, 2 vCPUs. 4GB mem / 60GB Disk, ($20/mo)

This works for most general tasks. In most VPS intensive tasks (content discovery, fuzzing, etc) memory is your bottleneck.
🧵 2/x

Laptop: (Ubuntu VMs & Windows)
Laptop with 16GB of RAM and a hardcore proc and my 800Mb/s home internet with VPN setup.

Desktop:
Threadripper gaming desktop
128GBRam
5 Monitors

#bugbountytips
🧵 3/x

You don't need 3 machines FYI. My desktop is a beast because it's my gaming machine. (128GB RAM is epic tho for work in Burp Pro)

The VPS handles general tasks
If the VPS is maxed out or I'm doing a long session fuzz (content discovery, fuzzing large lists) I use laptop
Read 6 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(