Penetration testing interview questions: technical answers by level

Penetration testing interview questions check whether you can explain how a vulnerability works, how you would confirm it safely, and how it gets fixed. Expect fundamentals (ports, protocols, the OWASP categories), technique questions on injection, access control, privilege escalation and Active Directory, and scenarios where you must choose the next step from partial evidence. Strong answers name the root cause and the remediation, not just the tool.

By Published 8 min read

How technical pentest questions are asked

This page is the technical question bank. The hiring steps, scoping talk, ethics questions and the report round are covered in penetration tester interview questions. In the technical part, interviewers rarely want a tool name on its own. They ask what a scan result means, what a payload does to the query or the browser, why a misconfiguration is exploitable, and what the client should change. A junior candidate is expected to explain one vulnerability class end to end. A senior candidate is expected to reason about chains, side effects and severity.

  1. Concept checksShort questions on protocols, ports, cryptography basics and vulnerability classes, often rapid fire.
  2. Walk me through itPick a finding and explain discovery, confirmation, impact and fix in order, as you would in a report.
  3. Evidence puzzlesThe interviewer shows an HTTP request, a scan line or a command output and asks what you would try next.
  4. Scenario designPlan a test of a web app, an internal network or a cloud account, including what you would avoid doing.

Fundamentals questions

Fundamentals for junior testers and first technical screens
QuestionWhat it testsWhat a strong answer shows
What is the difference between a SYN scan and a full connect scan?TCP basicsA SYN scan sends SYN and reads the reply without finishing the handshake, so it is quicker and needs raw socket privileges. A connect scan completes the handshake through the OS, which is slower and more likely to be logged by the application.
A port shows as filtered. What does that tell you?Reading scansNo answer or an ICMP unreachable came back, so something such as a firewall is likely dropping the probe. It does not tell you whether a service is behind it.
Why would you scan UDP separately, and why is it slow?CoverageServices like DNS, SNMP and TFTP live on UDP. Closed UDP ports often give no reply, so the scanner waits for timeouts and rate limits on ICMP slow it further.
Hashing, encryption and encoding: what is the difference?Crypto basicsEncoding is reversible by anyone (Base64). Encryption is reversible with a key. Hashing is one way, and passwords need a slow salted algorithm such as bcrypt or Argon2, not a fast hash.
What is the difference between a vulnerability scan and a penetration test?Scope of workA scan lists likely issues from signatures and versions. A test confirms which ones are real, chains them, and shows impact, removing false positives along the way.
What does CVSS measure, and what does it not?SeverityIt scores technical severity from attack vector, complexity, privileges, user interaction and impact. It does not know the business value of the asset, so testers add context when they rate risk.
What is the same-origin policy?Browser modelScripts from one origin (scheme, host, port) cannot read responses from another. CORS is a controlled exception the server opts into, and a loose CORS policy can undo the protection.
Authentication versus authorization?Access controlAuthentication proves who you are. Authorization decides what you may do. Most serious API findings are authorization gaps, not login bypasses.
What is a reverse shell versus a bind shell?Post-exploitation basicsA bind shell listens on the target and you connect in. A reverse shell connects out to you, which usually passes outbound firewall rules more easily.
Name the OWASP Top 10 categories you test most often.Web coverageBroken access control, injection, security misconfiguration and authentication failures come up constantly. Say how you test each one, not just its name, and note that the list is revised every few years.
Fundamentals for junior testers and first technical screens. Scroll sideways on a small screen.

Web application and API technique questions

Expect at least one injection question where you must explain the mechanism in plain words. The sample below is a common way to show it: the same login check written with string building and with a parameterized query.

import sqlite3

db = sqlite3.connect(":memory:")
db.execute("CREATE TABLE users (name TEXT, password TEXT)")
db.execute("INSERT INTO users VALUES ('alice', 'correct-horse')")

def login_unsafe(name, pw):
    q = f"SELECT count(*) FROM users WHERE name = '{name}' AND password = '{pw}'"
    return db.execute(q).fetchone()[0] > 0

def login_safe(name, pw):
    q = "SELECT count(*) FROM users WHERE name = ? AND password = ?"
    return db.execute(q, (name, pw)).fetchone()[0] > 0

payload = "' OR '1'='1"
print(login_unsafe("alice", payload))  # True: the input rewrote the WHERE clause
print(login_safe("alice", payload))    # False: the input stays a plain string
sqli_demo.py: the same login written two ways against an in-memory SQLite table. The crafted input changes the WHERE clause in the first function and stays a harmless string in the second.
  • Why does the first login return true? AND binds tighter than OR, so the clause becomes (name matches and password is empty) OR a condition that is always true. The fix is a parameterized query, which sends the input as data and never as SQL text. Input filtering alone is a weak second layer.
  • How do you test for blind SQL injection when nothing is echoed back? Compare responses to a true condition and a false one (boolean based), or add a deliberate delay and time the response (time based). Keep payloads read-only and slow on production systems.
  • What is an IDOR and how do you find one? An insecure direct object reference lets you read or change another user's record by changing an ID. Use two test accounts, capture a request from one, and replay it with the other's session. The fix is a server-side ownership check on every request.
  • Explain SSRF and why it matters in the cloud. The server fetches a URL you control, so you can make it reach internal services. In cloud hosts that can include the instance metadata endpoint and its temporary credentials. Fixes include allow-lists, blocking internal ranges after DNS resolution, and metadata protections such as token-required access.
  • Stored, reflected and DOM XSS: how do they differ? Stored XSS is saved and served to other users, reflected XSS bounces off one request, and DOM XSS happens entirely in client-side script that writes untrusted data into the page. Context-aware output encoding and a strict Content Security Policy are the main fixes.
  • How does CSRF work and what stops it? The browser sends a victim's cookies with a forged cross-site request. SameSite cookies, anti-CSRF tokens and checking the Origin header stop it. A JSON API that requires a custom header is harder to forge but still worth testing.
  • What JWT mistakes do you look for? A server that accepts the none algorithm, confuses an RSA public key with an HMAC secret, skips signature checks, or trusts claims such as role without a server-side lookup. Also check expiry and whether logout really revokes anything.
  • Why is insecure deserialization dangerous? If an application rebuilds objects from attacker-controlled data, gadget chains in its libraries can run code during that rebuild. The fix is not to deserialize untrusted input into native objects, or to use a strict data-only format with allow-listed types.
  • How do you test file upload? Try content-type and extension mismatches, double extensions, oversized files, and files that are parsed later (SVG with script, archives with path traversal names). Check where files are stored and whether they can be executed or served from the main domain.

Network and privilege escalation questions

Intermediate questions on infrastructure tests
QuestionWhat it testsWhat a strong answer shows
You find SMB open on an internal host. What do you check first?EnumerationWhether null or guest sessions list shares, which shares are readable or writable, the SMB signing setting, and the OS and domain details the service reveals.
How do you enumerate a web server beyond the home page?DiscoveryContent discovery with a wordlist, virtual host discovery, reading JavaScript files for API routes, checking robots and sitemap files, and noting framework error pages that leak versions.
What do you check for Linux privilege escalation?Local enumerationsudo rights, SUID and SGID binaries, writable cron jobs and scripts, capabilities, credentials in config files and history, kernel version, and services running as root on localhost.
What do you check on Windows?Local enumerationToken privileges such as impersonation rights, unquoted service paths, services with weak permissions, stored credentials, scheduled tasks, missing patches and AlwaysInstallElevated.
Pass-the-hash: what is it and why does it work?Windows authNTLM authenticates with the hash itself, so a captured NT hash can be used without cracking it. Mitigations include LAPS-style unique local admin passwords, restricted admin rights and moving away from NTLM.
How do you pivot into a segment you cannot reach directly?Lateral movementUse a compromised host as a relay through SSH port forwarding or a SOCKS proxy, staying inside the agreed scope and logging what traffic went where.
What is LLMNR or NBT-NS poisoning?Network attacksWhen DNS fails, Windows may ask the local network by broadcast. An attacker answers and collects authentication attempts. Disabling those protocols and enforcing SMB signing are the usual fixes.
Intermediate questions on infrastructure tests. Scroll sideways on a small screen.

Active Directory and cloud questions

  • What is Kerberoasting? Any domain user can request service tickets for accounts with a service principal name. Part of the ticket is encrypted with the service account's password hash, so it can be cracked offline. Long random passwords or managed service accounts are the fix.
  • AS-REP roasting versus Kerberoasting? AS-REP roasting targets accounts that have Kerberos pre-authentication disabled, so you can request material for them without any credentials. Kerberoasting needs a valid domain user first.
  • What does a tool like BloodHound show you? A graph of users, groups, sessions and permissions, so you can find the shortest path from a foothold to a high-value group. Defenders use the same graph to remove dangerous edges.
  • What is a DCSync attack? An account with directory replication rights asks a domain controller to replicate password data, as another domain controller would. Detection relies on spotting replication requests from hosts that are not domain controllers.
  • What do you look at first in a cloud account review? Identity: who can assume which roles, overly broad policies, long-lived access keys, public storage buckets, and exposed metadata endpoints. Most cloud findings are permission mistakes, not software bugs.
  • How is testing a cloud environment different from on-premises? The provider's own terms define what you may test, managed services are out of bounds for some techniques, and the shared responsibility model decides which findings belong to the client.

Senior and scenario questions

Scenarios senior candidates are given
ScenarioWhat the interviewer listens forA good direction
You have three low findings. Is the application secure?ChainingTry to combine them: a username enumeration plus a weak lockout plus a verbose error can add up to account takeover. Report the chain with its combined severity.
A payload you sent caused errors on a production system.Judgment under pressureStop that technique, tell the agreed contact straight away, record exactly what was sent and when, and only resume after the client agrees.
The client disputes a high severity rating.Defensible scoringWalk through the CVSS vector and the business context, show the evidence, and accept a change only if a real factor such as compensating controls lowers it.
The scanner reports a critical CVE on a web server.False positive handlingCheck whether the version banner is accurate, whether the vulnerable module is enabled, and whether a backported patch exists before you rate it.
You get a foothold on a workstation in an internal test.Post-exploitation planEnumerate locally, look for credentials and privilege paths, map the domain quietly, and keep to the objectives in scope rather than spreading everywhere.
Design a test for a mobile banking API in five days.PrioritisationSpend most time on authorization between accounts, session handling and transaction logic, then rate limiting and input handling, with clear notes on what was not covered.
Scenarios senior candidates are given. Scroll sideways on a small screen.

Fictional example

Answering "You found an IDOR. Walk me through it"
Interviewer
Tell me how you would confirm and write up an IDOR on an invoices endpoint.
Candidate
I would use two test accounts I was given. With account A, I request invoice 1042, which belongs to A. Then I replay the same request with account B's session token. If B gets A's invoice, the server is checking that I am logged in but not that I own the record. I would confirm it with one or two more records, never by pulling bulk data, and check whether write methods like PUT or DELETE have the same gap, since that raises the impact. The write-up gives the exact requests, the affected methods, a CVSS vector with my reasoning, and the fix: an ownership check on the server for every object access, plus a test that fails if it is removed.

Practice plan for the technical rounds

  • Week 1: run the SQL injection sample above, then write the same pair for a command injection and an XSS case in a local test app. Explain each in under a minute.
  • Week 2: work through deliberately vulnerable labs on a legal training platform. For every machine, write down the enumeration step that gave the foothold.
  • Week 3: build a small Active Directory lab in local virtual machines and practise Kerberoasting and BloodHound paths, then list the fix for each step.
  • Every day: take one finding and say discovery, confirmation, impact and fix in that order without notes.

For the defensive side of the same topics, see network security interview questions and cybersecurity analyst interview questions. If the role includes a lot of API work, Postman interview questions covers the tool many testers use to replay and script requests.

Technical pentest answers fall apart when the order slips: impact before confirmation, or a fix that does not match the root cause. In a mock round, Natively, an AI interview assistant for Mac and Windows, transcribes your answers on your own computer, so you can check afterwards whether each walkthrough had all four parts. It can read a captured request or a scan excerpt from a screenshot and suggest follow-up angles, and with Pro or the free trial it draws on the résumé and job description you upload. Transcripts and notes stay available for later review.

Questions people ask

What technical questions are asked in a penetration testing interview?

Scan types and what open, closed and filtered mean, the OWASP categories, how SQL injection, XSS, CSRF, SSRF and IDOR work and get fixed, Linux and Windows privilege escalation checks, Kerberos attacks such as Kerberoasting, and CVSS scoring.

How do I explain SQL injection in an interview?

Show that string-built queries let input change the SQL itself, give a simple example, describe how you would confirm it safely, and name parameterized queries as the fix, with input validation only as a second layer.

Do penetration testing interviews include Active Directory questions?

Often, for internal and red team roles. Expect Kerberoasting, AS-REP roasting, pass-the-hash, LLMNR poisoning, BloodHound attack paths and the fix for each.

How should freshers prepare for penetration testing interview questions?

Learn networking and HTTP well, practise on legal training labs, and for each vulnerability class be able to explain discovery, confirmation, impact and fix in order.

Where to go next

Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.

Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.

Keep reading

Put it on your own machine.

A live-conversation assistant that runs locally. Your conversations stay on your machine.

macOS 12+ · Windows 10/11

© 2026 Natively AI Private Limited

Source-available under the Natively Personal Use Source License v1.0 · IP geolocation by DB-IP