👴Junior to Senior Pentester Interview Prep

On this page i'll try to provide a curated list of interview questions for penetration testers that i'll find online and by asking real seniors around me, spanning from junior to senior levels. Designed to help prepare for interviews, these questions cover a range of topics, that are, in my opinion, essential for a successful career in pentesting.

Let's start by having a good understanding of common web attacks ->

This attack allows attackers to interfere with the queries that an application makes to its database. By manipulating input fields, attackers can execute arbitrary SQL code, potentially accessing or modifying data without proper authorization.

🕸️BSCP

It's crucial to know how the attack works, at least in theory and being able to tell the difference with the ones that could be similare:


Difference Between LFI and RFI

Local File Inclusion (LFI):

  • Involves including files that are already present on the server's filesystem.

  • Exploits vulnerabilities where user input is used to include files directly from the server.

  • Example: Accessing /etc/passwd file on the server through a vulnerable parameter.

Remote File Inclusion (RFI):

  • Involves including files from remote servers.

  • Exploits vulnerabilities where user input is used to include files from external URLs.

  • Example: Including a malicious script hosted on an attacker-controlled server into a web application.


What are the main types of XSS

Reflected XSS (Non-Persistent XSS)

  • Description: Occurs when user input is immediately returned by the web application in the response without proper sanitization.

  • Attack Scenario: An attacker crafts a malicious link or URL that, when clicked by a victim, executes a script in the victim's browser.

  • Impact: Can lead to session hijacking, cookie theft, or redirecting users to malicious websites.

2. Stored XSS (Persistent XSS)

  • Description: Also known as Persistent XSS, it occurs when user input containing malicious scripts is stored on the server and then retrieved and displayed to other users later.

  • Attack Scenario: An attacker posts a malicious script (e.g., in a forum post, comment, or message) that is stored on the server. When other users view the content, the script executes in their browsers.

  • Impact: More severe as it affects multiple users and can lead to widespread attacks such as defacement of websites, data theft, or distribution of malware.

3. DOM-Based XSS

  • Description: This type of XSS occurs when the vulnerability exists within the client-side JavaScript code rather than the server-side code.

  • Attack Scenario: Malicious code is injected into the DOM (Document Object Model) environment, typically through client-side scripts like JavaScript. The attack payload is processed by the client-side code and executed in the victim's browser.

  • Impact: Difficult to detect with traditional server-side defenses; can lead to the same consequences as other XSS types, depending on the vulnerability's exploitation.


What are the different penetration phases?

(kudos to THM for this one)

The five phases in pentesting are reconnaissance, enumeration, exploitation, privilege escalation, and post-exploitation.

  1. Reconnaissance - Pose as the hacker to gain information about a company, including details of the network topology, operating systems and applications, user accounts, etc.

  2. Enumeration / Scanning - Identify the potential ways to hack into a company using various tools to identify open ports. For example, finding a web server that may be potentially vulnerable.

  3. Exploitation - Leveraging vulnerabilities discovered on a system or application. This stage can involve the use of public exploits or exploiting application logic.

  4. Privilege Escalation - Once you have successfully exploited a system or application (known as a foothold), you would then attempt to expand your access to a system.

  5. Post-Exploitation - This stage involves gathering any final information as a privileged user, and covering your tracks by removing logs and any evidence that the system was accessed. You would also conduct a report to detail your findings.


Explain Tor Browser & Tor network

  • Ports Used: Tor uses port 9050 for SOCKS proxy connections, allowing applications to route their traffic through the Tor network. Port 9001 is used for directory connections, enabling nodes to share information about their existence and current state within the network.

  • Three Connection Phases:

    1. Entry Node: When a user initiates a connection to the Tor network, they select an entry node (also known as a guard node). This node establishes an encrypted connection with the user's device, ensuring that data leaving the device is protected from surveillance or monitoring.

    2. Middle Nodes: After the data is encrypted by the entry node, it passes through a series of randomly selected middle nodes. Each middle node only knows the IP address of the previous and next nodes in the chain, adding layers of encryption that prevent anyone from tracing the complete path of the data.

    3. Exit Node: Once the data reaches the last middle node, it is decrypted and forwarded to an exit node. The exit node establishes a connection to the destination website or service requested by the user. From the perspective of the destination, the traffic appears to originate from the exit node, masking the user's original IP address.

Last updated