liveBook · Manning

Penetration testing

As explained in Grokking Web Application Security

Penetration testing is an authorized security assessment that attempts to identify exploitable weaknesses in a system.

Penetration testing is an authorized attempt to find weaknesses in a web application before a malicious attacker finds and exploits them. It puts an attacker’s methods to defensive use: a friendly hacker or automated service probes the application for vulnerable entry points, so problems can be addressed before release or abuse. section 5.18 section 1.1

The same tools may be used by defenders and attackers. Kali Linux collects commonly used forensic and hacking tools, while Metasploit can incorporate proof-of-concept exploits to probe websites for known vulnerabilities. The defensive difference is authorization and intent: testing is performed to identify and repair exposure, not to cause harm. section 1.1 section 1.1

Automated penetration testing turns this activity into a repeatable application check:

  • Configure a service such as Invicti or Detectify to crawl the web application. section 5.18
  • Allow the service to maliciously modify HTTP parameters while it probes for vulnerabilities as a hacker would. section 5.18
  • Run potentially disruptive testing in staging when data corruption is a concern. section 5.18
  • Check applicable local law before using automated hacking tools. section 5.18

A pre-release web-application probe

Before deploying a release, point an automated testing service at a staging version that closely resembles production. The service crawls the application and alters HTTP parameters to search for weaknesses. Findings can then join other pre-release checks, alongside dependency and static analysis, rather than waiting for an incident to reveal them. section 5.18 section 5.23

Penetration testing is one layer of a broader security process, not a substitute for secure development or incident response. Source control, build tools, unit tests, and code reviews help detect code-level defects; automated deployment reduces configuration mistakes; and firewalls, intrusion detection systems, and antivirus software can block or detect incidents as they occur. If an incident happens, diagnosing its cause helps prevent recurrence. section 5.23

Known software weaknesses are often cataloged with CVE numbers after a patch becomes available. Proof-of-concept exploits may appear quickly and be incorporated into tools, making early discovery and remediation important. Security researchers can document and demonstrate flaws to software maintainers so they can be fixed. section 1.1 section 1.1

How Grokking Web Application Security covers it

How deep it goes
Defines automated testing and gives configuration, HTTP-parameter probing, staging, and legal-use guidance without detailing exploit construction.
Examples
Uses Kali Linux, Metasploit, Invicti, and Detectify as tools that scan, crawl, and probe web applications.
What you can do after
Operate/configure automated penetration-testing services against a staging web application before release.
How it connects
Connects penetration testing with Kali Linux, Metasploit, CVE, proof-of-concept exploits, static analysis, and intrusion detection systems.

Also explained in

Compare how 2 books explain penetration testing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Web Application Security. The section links point to the parts of the book it draws on.