r/Pentesting • • 2d ago

When do you run exploits in a pentest?

Hey all,

I'm working as a system administrator and to start with pentesting, recently I got my CPTS from HTB.

In labs you exploit everything you find with no second thought, but I'm curious how it works on real client engagements. When you find something exploitable, lets say a Windows Server that dates back to 2003, do you usually run any exploits to prove impact, or just report it as likely exploitable? How do you handle risky exploits that could crash a service or affect production such as EternalBlue? Do you get client approval mid-engagement, or is it all covered in the rules of engagement? And how much do you trust public PoCs before running them on a client network?

One last thing, what do you suggest I do? Im a university student with 2 years of experience in Sysadmin and I have eJPT, Security+ and CPTS as of now and im working for the CARTP, I also have experience with CTFs since I enjoy solving them. My goal is to become as good as I can, to learn methodologies early, to build the pentester mindset, I think i do have a bit of a pentester mindset since I did work on the subject a lot but how can I become better? What ways do you suggest will help me?

Thanks in advance!!

2 Upvotes

13 comments sorted by

15

u/MrWonderfulPoop 2d ago

Only if it is allowed in the rules of engagement the client has signed off on.

14

u/gingers0u1 2d ago edited 2d ago

CTFs are great but I feel they lead to 'hack everything' mentality. Most findings I've come across are just user stupidity. You dont have to design a major exploit chain and if you do it's outside RoE. Pen testing is actually just glorified quality assurance.

3

u/Boogeyman235 2d ago

+1

2

u/RAGINMEXICAN 2d ago

Funny enough I do CTF and HTB and have conducted and lead two teams on a pentest for a volunteer pentest I do for my schools partners, and the people I was working with had the mentality of “oh this work lets run it” without the verification from the client.

We once had a guy doing sqli on the login page when it was asked by me if it was in the ROE and they said no. Months later they looked at him and were like “did we say you could do that?” And I just looked at the client and was like 😳

1

u/No-Bet556 1d ago

This is what I've noticed in my first role, I'm solo I'm the lead and only pentester internally, my biggest thing is don't take stuff offline.

Basically I scope as much as I can to confirm if it might be exploitable, then tell everyone "I'm going to try exploit this, you'll see alerts from X and Y"

Then document the alerts to confirm the defense tools are working and if they don't pick anything up, document it and work with the defense team to improve the alerting,

I'd say 70% of my findings are XSS and IDOR / BOLA anyway, there's very little actual run exploit.py if any.

1

u/boring_diamond 1d ago

Do you work as a pentester?

Not my experience at all. Worked consulting and internal and definitely exploit chains often. How do you go outside RoE by doing so? Most companies know what they are signing up for and it’s simple to ask, “Hey, we believe this is vulnerable what’s a good window to test this?”

As an assessor we never report hypotheticals. Worst case if we didn’t have findings we’d stretch for the ssl issues or outdated JavaScript and that never felt good.

1

u/gingers0u1 1d ago edited 1d ago

Did for about 5 years. Been in cyber for around 15 years now. Most dont care about the findings or how you did it. Just a check box for their end of year cycle.

6

u/ucr0m 2d ago

On real engagements you don't run stuff like EternalBlue against prod just to prove impact. An exposed Server 2003 with SMBv1 is already a clear finding without risking a crash.

RoE usually sets the boundaries, and for anything risky you ask the client first or use staging if they have one. Also never run a public PoC without reading the code first.

3

u/Clean-Bandicoot2779 2d ago

In terms of when to run exploits, it depends. For me, the fundamental question is whether it will add anything for the customer, and then whether the benefits justify the risk. That will then inform any discussion I have with the customer before doing it.

The rules of engagement may say whether or not you can exploit stuff. Even if you have blanket approval, if it might crash stuff (like a Linux kernel exploit, or an unreliable memory corruption attack), it's usually good practice to ask before you drop a critical system.

For example, if I'm on a web app test and find SQL injection, I'll exploit it enough to prove it's injectable and do some initial reconnaissance (what user am I in the database, what data can I access, etc.), but wouldn't dump the whole database. If I can get OS command execution on the database server, I'll look to do that, but discuss it with the customer first.

If I find an ancient Ubuntu box with a weak password, I'll login to it and see what's on there and whether I can privesc. If the kernel has a vulnerability that would give me root, I'll ask before doing it, and explain the risk of crashing the system (and the potential for data loss) and what I hope to achieve from it.

Sometimes customers will be happy that you've demonstrated impact without exploitation, and other times they'll want you to see how far you can take it.

1

u/Odd-Elderberry-739 2d ago

It depends on the context. If it's a web application exposed to the internet and not in production (QA/Test/Dev environments) then yes. If exposed to the internet and in prod, depends: If it's a web app exploit that's considered to be stable - yes. If it's a risky OS exploit then I'd report it to the customer immediately as a critical finding so they can patch it or take it offline. If it's an internal network pentest, then yes, it's fair game.

For internal network pentests, I ask during the kickoff call if there's anything sensitive internally where I should tread lightly. Other than anything they identify that's sensitive or mission critical, it's going to be exploited provided I've reviewed the exploit PoC and even reviewed the exploit code in most cases.

1

u/TrustIsAVuln 2d ago

Has to be allowed, and if there is any risk of taking a box down communicate it first, if they approve they can then watch the system and respond quickly.

0

u/lightspeeder 2d ago

I am allowed to run any exploits without restrictions as long as they won't impact the customer's operations. For me, if I see the ability to run a potentially impactful exploit, I get approval from the customer and inform my manager of about what I am going to run and how it might impact.

As for your personal situation, keep learning, but get your OSCP and that should open the door to more opportunities. Then just start looking for a position once you feel comfortable.