<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Hackbook</title><link href="https://hackbook.ericturner.it/" rel="alternate"/><link href="https://hackbook.ericturner.it/feeds/all.atom.xml" rel="self"/><id>https://hackbook.ericturner.it/</id><updated>2026-05-23T09:07:00-04:00</updated><entry><title>Active Scanning</title><link href="https://hackbook.ericturner.it/recon/active_scanning/" rel="alternate"/><published>2026-05-23T09:07:00-04:00</published><updated>2026-05-23T09:07:00-04:00</updated><author><name>Eric Turner</name></author><id>tag:hackbook.ericturner.it,2026-05-23:/recon/active_scanning/</id><summary type="html">&lt;h2 id="active-gathering"&gt;Active Gathering&lt;/h2&gt;
&lt;p&gt;These all have a higher chance of detection due to the fact you are actively targeting the organization directly. &lt;/p&gt;
&lt;h2 id="port-scanning"&gt;Port Scanning&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Host Discovery Strategies: https://nmap.org/book/host-discovery-strategies.html&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By default, nmap scans top 1000 ports with SYN scan, &lt;code&gt;-sS&lt;/code&gt;. This scan is default when ran as …&lt;/p&gt;</summary><content type="html">&lt;h2 id="active-gathering"&gt;Active Gathering&lt;/h2&gt;
&lt;p&gt;These all have a higher chance of detection due to the fact you are actively targeting the organization directly. &lt;/p&gt;
&lt;h2 id="port-scanning"&gt;Port Scanning&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Host Discovery Strategies: https://nmap.org/book/host-discovery-strategies.html&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By default, nmap scans top 1000 ports with SYN scan, &lt;code&gt;-sS&lt;/code&gt;. This scan is default when ran as root. Without root privs, &lt;code&gt;-sT&lt;/code&gt; TCP scan is used instead.&lt;/p&gt;
&lt;p&gt;Ports can be open, closed or filtered (unknown / firewall interference)&lt;/p&gt;
&lt;p&gt;When identifying issues &lt;code&gt;--packet-trace&lt;/code&gt; can be utilized to trace packets and identify the response. Other packet types, such as ICMP, DNS or ARP can be disabled with &lt;code&gt;-Pn&lt;/code&gt;, &lt;code&gt;-n&lt;/code&gt; and &lt;code&gt;--disable-arp-ping&lt;/code&gt;, respectively.&lt;/p&gt;
&lt;h3 id="tcp-connect-scan"&gt;TCP Connect Scan&lt;/h3&gt;
&lt;p&gt;The TCP connect scan, &lt;code&gt;-sT&lt;/code&gt; fully completes the TCP three-way handshake by sending a SYN packet, waiting for a SYN/ACK response, then returning an ACK or RST. This method is highly accurate, but also is less stealthy. As the handshake completes, the connection can trigger alarms in firewall or IDS systems. However, this scan may be required to bypass system firewall rules where inbound is blocked but outbound is allowed.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="gp"&gt;eric@hackbook:~$ &lt;/span&gt;nmap&lt;span class="w"&gt; &lt;/span&gt;-sT
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h4 id="when-to-use"&gt;When to use&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;accuracy is a priority&lt;/li&gt;
&lt;li&gt;stealth is not required&lt;/li&gt;
&lt;li&gt;full handshake is needed to prevent errors or instability on target device&lt;/li&gt;
&lt;li&gt;target may have a host firewall that drops inbound-only connections&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="tcp-syn-scan_1"&gt;TCP SYN Scan&lt;/h3&gt;
&lt;p&gt;The SYN scan, &lt;code&gt;-sS&lt;/code&gt; is known as a half-open scan or stealth scan, as the scanner only sends a SYN packet and monitors for SYN/ACK as open or RST to determine open/closed. The three-way handshake is not completed, which can potentially evade logs or IDS/IPS solutions.&lt;/p&gt;
&lt;h4 id="when-to-use_1"&gt;When to use&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;stealth is important&lt;/li&gt;
&lt;li&gt;speed is important, at the cost of some accuracy&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="tcp-ack-scan_1"&gt;TCP ACK Scan&lt;/h3&gt;
&lt;p&gt;The ACK scan, &lt;code&gt;-sA&lt;/code&gt; sends a packet with only the ACK flag, which means the host must respond with RST for closed/open ports. ACK packets tend to bypass firewall rules as it indicates a connection may already be in progress. However, these scans only return filtered or unfiltered and &lt;code&gt;--packet-trace&lt;/code&gt; may be required to make further sense of the results&lt;/p&gt;
&lt;h4 id="when-to-use_2"&gt;When to use&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;firewalls / IPS / IDS are filtering other TCP packets from reaching the destination&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="tcp-fin-null-xmas-scans_1"&gt;TCP FIN, NULL &amp;amp; Xmas Scans&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;-sN&lt;/code&gt;, &lt;code&gt;-sF&lt;/code&gt;, and &lt;code&gt;-sX&lt;/code&gt; are scans meant to exploit a loophole in TCP's RFC 793 that states any packet missing SYN, RST or ACK should return RST if the port is closed and nothing if the port is open. This scan type will never return a true &lt;code&gt;open&lt;/code&gt; status, only &lt;code&gt;open|filtered&lt;/code&gt;, &lt;code&gt;closed&lt;/code&gt; or &lt;code&gt;filtered&lt;/code&gt;. Further investigation will be required on any &lt;code&gt;open|filtered&lt;/code&gt; ports to further narrow down the state. Utilizing version detection with &lt;code&gt;-sV&lt;/code&gt; defeats the purpose of this scan and is not advised.&lt;/p&gt;
&lt;h4 id="when-to-use_3"&gt;When to use&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;need to sneak through non-stateful firewalls and/or packet filtering routers&lt;/li&gt;
&lt;li&gt;stealth is important&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="udp-scan_1"&gt;UDP Scan&lt;/h3&gt;
&lt;p&gt;The UDP scan, &lt;code&gt;-sU&lt;/code&gt; , exclusively targets UDP ports. It can be used in conjunction with either the TCP connect or SYN scan to scan both TCP and UDP ports in the same run. UDP scanning is tricky, as UDP ports are not required to respond, and there is no handshake. Certain known ports like DNS/SNMP will get a more custom payload to attempt to get a response back. Otherwise, ports receive a packet with an empty payload. Most commonly, ports are seen as &lt;code&gt;open|filtered&lt;/code&gt; which means nmap is unsure the true status of the port. Adding version scanning, using &lt;code&gt;-sUV&lt;/code&gt; can help further narrow down if the port is open, but increases the time further. This scan can be extremely slow due to rate limiting of unreachable UDP packets. A full 65k port scan on a single linux host can take over 18 hours.&lt;/p&gt;
&lt;h4 id="when-to-use_4"&gt;When to use&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;To specifically check for services on UDP ports&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="scripts_1"&gt;Scripts&lt;/h3&gt;
&lt;p&gt;Default scripts can be loaded with &lt;code&gt;-sC&lt;/code&gt; or &lt;code&gt;--script=default&lt;/code&gt;. These include safe scans such as robots.txt, ftp checks, clock skew, dns checks, smb checks. Other scripts can be searched using &lt;code&gt;--script-help &amp;lt;keyword|category&amp;gt;&lt;/code&gt;. There are 14 total categories of scripts:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Category&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;auth&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Determination of authentication credentials.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;broadcast&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Scripts, which are used for host discovery by broadcasting and the discovered hosts, can be automatically added to the remaining scans.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;brute&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Executes scripts that try to log in to the respective service by brute-forcing with credentials.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;default&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Default scripts executed by using the&amp;nbsp;&lt;code&gt;-sC&lt;/code&gt;&amp;nbsp;option.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;discovery&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Evaluation of accessible services.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;dos&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;These scripts are used to check services for denial of service vulnerabilities and are used less as it harms the services.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;exploit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;This category of scripts tries to exploit known vulnerabilities for the scanned port.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;external&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Scripts that use external services for further processing.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;fuzzer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;This uses scripts to identify vulnerabilities and unexpected packet handling by sending different fields, which can take much time.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;intrusive&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Intrusive scripts that could negatively affect the target system.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;malware&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Checks if some malware infects the target system.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;safe&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Defensive scripts that do not perform intrusive and destructive access.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;version&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Extension for service detection.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;vuln&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Identification of specific vulnerabilities.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;### Performance&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;--initial-rtt-timeout 50ms --max-rtt-timeout 100ms&lt;/code&gt; can set the round-trip-time min/max timeout to speed up the scan.&lt;ul&gt;
&lt;li&gt;This can cause an increase in scan speed, but can also cause hosts or ports that respond slower to be mislabeled as down.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--max-retries&lt;/code&gt; by default nmap tries 10 times. &lt;ul&gt;
&lt;li&gt;can be lowered to increase scan speed, but again can miss slower responding ports or hosts&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--min-rate&lt;/code&gt; setting the # of packets to be sent per second can increase scan speed. need to be careful not to set too high and overload the network&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-T&lt;/code&gt; sets the speed/aggressiveness of the scan &lt;code&gt;0-5&lt;/code&gt;&lt;ul&gt;
&lt;li&gt;this also sets some of the settings above automatically as seen &lt;a href="https://nmap.org/book/performance-timing-templates.html"&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;T0 and T1 have 5m and 15s scan delay, respectively. In other words, each packet will have a sleep period in between packets. These are good for IDS evasion and remaining stealthy during scanning&lt;/li&gt;
&lt;li&gt;T5 is the most aggressive that also makes use of max-retries and max-rtt-timeout that can cause some accuracy loss, but is incredibly quick and noisy. IDS or firewalls may block or rate-limit this.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Omitting version detection (no &lt;code&gt;-sV&lt;/code&gt;) can also greatly increase performance. Using a basic port scan to find open ports in the first pass, then going back to target version scanning on specific ports can help performance.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="evasion"&gt;Evasion&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://nmap.org/book/man-bypass-firewalls-ids.html"&gt;Firewall/IDS Evasion and Spoofing | Nmap Network Scanning&lt;/a&gt;
* &lt;code&gt;-sA&lt;/code&gt; can be used to carry out a TCP ACK scan to determine filtered state of a port
* &lt;code&gt;-D&lt;/code&gt; can be used to spoof IPs and setup decoys to mask which IP is the legitimate source of the scan
    * &lt;code&gt;-D RND:5&lt;/code&gt; creates 5 random IPs to spoof packets from
    * Decoys do not work with version detection &lt;code&gt;-sV&lt;/code&gt; or connect scans &lt;code&gt;-sC&lt;/code&gt;
    * Generally, it's better to specify which IPs as decoys and ensure these IPs are actually online. If the decoy IPs are all down, it becomes trivial to determine which IP was the real scanner, and it can inadvertently SYN flood the target.
* &lt;code&gt;--source-port&lt;/code&gt; binds activity to a specific port which could evade firewall
    * for example, binding it to 80/443 will make it look like HTTP traffic instead of a random high port performing port scanning
    * same logic for port 53, hosts may respond on a DNS request instead of another type.&lt;/p&gt;
&lt;h3 id="cheatsheet"&gt;Cheatsheet&lt;/h3&gt;
&lt;!-- cs-label: nmap quick commands --&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# simple full TCP port scan with version detection&lt;/span&gt;
nmap&lt;span class="w"&gt; &lt;/span&gt;-sSV&lt;span class="w"&gt; &lt;/span&gt;-p-&lt;span class="w"&gt; &lt;/span&gt;-oA&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;output_file&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;target&amp;gt;

&lt;span class="c1"&gt;# nmap with scripts, version detection and all ports saved to file&lt;/span&gt;
nmap&lt;span class="w"&gt; &lt;/span&gt;-sC&lt;span class="w"&gt; &lt;/span&gt;-sV&lt;span class="w"&gt; &lt;/span&gt;-p-&lt;span class="w"&gt; &lt;/span&gt;-oA&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;output_file&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;target&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;

&lt;span class="c1"&gt;# aggressive scan that performs service detection, OS detection, traceroute&lt;/span&gt;
&lt;span class="c1"&gt;# and default scripts. better to use against specific ports&lt;/span&gt;
nmap&lt;span class="w"&gt; &lt;/span&gt;-A&lt;span class="w"&gt; &lt;/span&gt;-p&amp;lt;port&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;target&amp;gt;

&lt;span class="c1"&gt;# nmap scan IP range and print just online IPs (ICMP / ARP scan)&lt;/span&gt;
sudo&lt;span class="w"&gt; &lt;/span&gt;nmap&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;.129.2.0/24&lt;span class="w"&gt; &lt;/span&gt;-sn&lt;span class="w"&gt; &lt;/span&gt;-oA&lt;span class="w"&gt; &lt;/span&gt;tnet&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;grep&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;cut&lt;span class="w"&gt; &lt;/span&gt;-d&lt;span class="s2"&gt;" "&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-f5

&lt;span class="c1"&gt;# ICMP echo only, with packet trace (TTL can assist in identifying OS)&lt;/span&gt;
nmap&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;.129.2.18&lt;span class="w"&gt; &lt;/span&gt;-sn&lt;span class="w"&gt; &lt;/span&gt;-oA&lt;span class="w"&gt; &lt;/span&gt;host&lt;span class="w"&gt; &lt;/span&gt;-PE&lt;span class="w"&gt; &lt;/span&gt;--packet-trace&lt;span class="w"&gt; &lt;/span&gt;--disable-arp-ping&lt;span class="w"&gt; &lt;/span&gt;

&lt;span class="c1"&gt;# TCP, UDP, with version detection (CAN BE VERY SLOW, NARROWING DOWN PORTS PREFERRED)&lt;/span&gt;
nmap&lt;span class="w"&gt; &lt;/span&gt;-sSUV&lt;span class="w"&gt; &lt;/span&gt;-p&amp;lt;ports&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;target&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;

&lt;span class="c1"&gt;# search for specific scripts&lt;/span&gt;
nmap&lt;span class="w"&gt; &lt;/span&gt;--script-help&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;keyword&lt;span class="p"&gt;|&lt;/span&gt;category&amp;gt;

&lt;span class="c1"&gt;# alternate method of searching for scripts&lt;/span&gt;
find&lt;span class="w"&gt; &lt;/span&gt;/&lt;span class="w"&gt; &lt;/span&gt;-type&lt;span class="w"&gt; &lt;/span&gt;f&lt;span class="w"&gt; &lt;/span&gt;-name&lt;span class="w"&gt; &lt;/span&gt;ftp*&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&amp;gt;/dev/null&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;grep&lt;span class="w"&gt; &lt;/span&gt;scripts

&lt;span class="c1"&gt;# run a certain category of scripts, like vuln&lt;/span&gt;
nmap&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;target&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;--script&lt;span class="w"&gt; &lt;/span&gt;vuln

&lt;span class="c1"&gt;# run multiple specific scripts&lt;/span&gt;
nmap&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;target&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;--script&lt;span class="w"&gt; &lt;/span&gt;banner,smtp-commands

&lt;span class="c1"&gt;# run specific scripts in a category&lt;/span&gt;
nmap&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;target&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;--script&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"discovery and http-*"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id="vuln-scanning_1"&gt;Vuln Scanning&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Using more detailed scanners like &lt;code&gt;nessus&lt;/code&gt; or &lt;code&gt;OpenVas&lt;/code&gt; to probe for specific vulns on a target. High likelihood of detection, can be even noisier than a simple port scan&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="network-mapping"&gt;Network Mapping&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Using &lt;code&gt;traceroute&lt;/code&gt;, &lt;code&gt;nmap&lt;/code&gt; to identify multiple hosts and gateways. Medium-High likelihood of detection depending on speed of scanning.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="banner-grabbing"&gt;Banner Grabbing&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Retrieving service info via banners via &lt;code&gt;nc&lt;/code&gt; or &lt;code&gt;curl&lt;/code&gt;. Low chance of detection but connection attempts can appear in logs.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="os-fingerprinting"&gt;OS Fingerprinting&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;nmap -O&lt;/code&gt; Low likelihood of detection, similar to banner grabbing&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="service-enumeration"&gt;Service Enumeration&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;nmap -sV&lt;/code&gt; Low likelihood of detection, similar to banner grabbing&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="web-spidering"&gt;Web Spidering&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Crawling website to identify pages, directories and files such as with &lt;code&gt;Burp Suite Spider&lt;/code&gt;. Low-Medium chance of detection depending on crawler configuration&lt;/li&gt;
&lt;/ul&gt;</content><category term="recon"/></entry><entry><title>Reconnaissance</title><link href="https://hackbook.ericturner.it/recon/" rel="alternate"/><published>2026-05-23T09:07:00-04:00</published><updated>2026-05-23T09:07:00-04:00</updated><author><name>Eric Turner</name></author><id>tag:hackbook.ericturner.it,2026-05-23:/recon/</id><summary type="html">&lt;h2 id="passive-gathering"&gt;Passive Gathering&lt;/h2&gt;
&lt;p&gt;These have a very low chance of detection as you are using publicly available resources and not directly targeting the organization.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Search Engines / Google Dorking&lt;ul&gt;
&lt;li&gt;using specific queries to attempt to uncover information about a target&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;WHOIS Lookups&lt;ul&gt;
&lt;li&gt;searching for domain registration information&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;DNS&lt;ul&gt;
&lt;li&gt;identifying subdomains, mail servers …&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;h2 id="passive-gathering"&gt;Passive Gathering&lt;/h2&gt;
&lt;p&gt;These have a very low chance of detection as you are using publicly available resources and not directly targeting the organization.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Search Engines / Google Dorking&lt;ul&gt;
&lt;li&gt;using specific queries to attempt to uncover information about a target&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;WHOIS Lookups&lt;ul&gt;
&lt;li&gt;searching for domain registration information&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;DNS&lt;ul&gt;
&lt;li&gt;identifying subdomains, mail servers, TXT records and other information about a domain&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Web Archive Analysis&lt;ul&gt;
&lt;li&gt;web archivers, like the wayback machine, scan and capture periodic snapshots of websites that can reveal information that may no longer be present&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Social Media Analysis&lt;ul&gt;
&lt;li&gt;Employee information or job listings can reveal information about technologies, hierarchy, phishing targets and other organization information&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Code Repositories&lt;ul&gt;
&lt;li&gt;GitHub and similar repos can have credentials or source code publicly available for finding vulnerabilities.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Cloud Buckets&lt;ul&gt;
&lt;li&gt;Public Amazon AWS or Azure cloud repositories could have information that is unauthenticated and could be valuable&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="footprinting"&gt;Footprinting&lt;/h2&gt;
&lt;p&gt;See [[Footprinting#Infrastructure Enumeration]] for detailed notes on gathering data for external infrastructure. 
See [[Footprinting#Host Based Enumeration]] for notes on gathering data via various services on a host.&lt;/p&gt;
&lt;h2 id="web-enumeration"&gt;Web Enumeration&lt;/h2&gt;
&lt;p&gt;see [[Information Gathering - Web]]&lt;/p&gt;
&lt;h2 id="exploits"&gt;Exploits&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;ExploitDB (&lt;code&gt;searchsploit&lt;/code&gt;), Rapid7 DB, Vulnerability Lab or Metasploit can help find exploits for particular applications&lt;/li&gt;
&lt;/ul&gt;</content><category term="recon"/></entry><entry><title>Penetration Testing Process</title><link href="https://hackbook.ericturner.it/intro/pentesting_process/" rel="alternate"/><published>2026-05-23T08:40:00-04:00</published><updated>2026-05-23T08:40:00-04:00</updated><author><name>Eric Turner</name></author><id>tag:hackbook.ericturner.it,2026-05-23:/intro/pentesting_process/</id><summary type="html">&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;&lt;img alt="" src="https://hackbook.ericturner.it/assets/images/1_pentesting_process.png"/&gt;&lt;/p&gt;
&lt;h2 id="pre-engagement"&gt;Pre-Engagement&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Multiple documents should be reviewed during the pre-engagement period:&lt;ul&gt;
&lt;li&gt;Non-Disclosure Agreement (NDAs)&lt;ul&gt;
&lt;li&gt;NDAs can come in different types: unilateral, bilateral, multilateral. Each of these will protect only one party, both parties, or multiple parties from disclosing information discovered. Multilateral NDAs could be used for cooperative or hybrid networks …&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;&lt;img alt="" src="https://hackbook.ericturner.it/assets/images/1_pentesting_process.png"/&gt;&lt;/p&gt;
&lt;h2 id="pre-engagement"&gt;Pre-Engagement&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Multiple documents should be reviewed during the pre-engagement period:&lt;ul&gt;
&lt;li&gt;Non-Disclosure Agreement (NDAs)&lt;ul&gt;
&lt;li&gt;NDAs can come in different types: unilateral, bilateral, multilateral. Each of these will protect only one party, both parties, or multiple parties from disclosing information discovered. Multilateral NDAs could be used for cooperative or hybrid networks that may affect more than one party.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Scoping Questionnaire&lt;ul&gt;
&lt;li&gt;Such tests could include: internal pentest, external pentest, internal vuln assessment, external vuln assessment, wireless assessment, physical security assessment, application security assessment, social engineering assessment, web app assessment&lt;ul&gt;
&lt;li&gt;External pentest is the full picture; Similar to how an attacker would get in, it starts with the attacker on the outside of the environment, probing publicly available infrastructure to attempt to gain a foothold&lt;/li&gt;
&lt;li&gt;Internal pentest can start after successful exploitation during the external pentest, or can start as part of an "assumed-breach" scenario to test what would happen if the external defenses were breached.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Each test should have further questions. Example: for social engineering, should this be restricted to just email phishing? Or are phone calls (vishing), text messages (smishing) or in person attacks acceptable?&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Pentesting Proposal (Contract / Scope of Work)&lt;ul&gt;
&lt;li&gt;A signed scope of work (SOW) or contract is crucial for setting the guardrails of what can be tested. This should be in writing and signed by a authorized signatory for the target. Validation of the signatory to confirm they are eligible to commence a penetration test is crucial to ensuring the pentester is protected during or after the test.&lt;/li&gt;
&lt;li&gt;Information about the scope such as # of live hosts, IPs/CIDR ranges, domains, wireless SSIDs, web/mobile apps, targeted users, physical locations, targeting of AD, bypassing of controls (NAC, firewall, AV).etc&lt;/li&gt;
&lt;li&gt;Define critical infrastructure that is out of scope&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Rules of Engagement (RoE)&lt;ul&gt;
&lt;li&gt;see below for some of the sections that could be included&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Contractors Agreement&lt;ul&gt;
&lt;li&gt;required for physical tests if a pentester is caught and police are called&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;After-Assessment Reports&lt;ul&gt;
&lt;li&gt;All the notes from the assessment should be revised and aggregated into a final report&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These sections can be a part of multiple of the above documents, particuarly the RoE
* Goals
    * Milestones that must be achieved during the engagement
* Pentest Type
    * Scoping should be exhaustive to determine what type of test is being requested. This can be done with a questionnaire
* Methodologies
    * OWASP, OSSTMM.etc
* Pentesting Locations
    * Internal, or remote.etc
* Time Estimation
    * At least start and end dates for the full engagement
    * Determining time windows for each phase and if testing should occur during work hours or after
* Third Parties
    * Cloud Providers, ISPs, hosting providers may need to be looped into the agreement depending on the targeted infrastructure
* Evasiveness
    * The stealthiness of the test should also be considered. Should it be evasive and attempt to be undetected the entire time? Should it be a hybrid and start stealthy but can ramp up to determine when the controls are able to detect the activity? Or is stealth not required and tooling can be loud and hammer away, barring denial-of-service or being destructive.
* Risks
    * Risks and consequences should be outlined. While the intent is not to cause a system outage, it is possible that the exploitation of a vulnerability could inadvertently take a system down.
    * Brute-forcing can cause user accounts to lock-out
* Information Handling
    * Laws and regulations can differ depending on the target's industry and location. All laws need to be researched beforehand to ensure compliance during testing
        * GDPR is a data privacy regulation that impacts personal data and information disclosure for European entities. The US does not have a national data regulation, but some states such as California have their own version that needs to be considered, if applicable.
        * Target's industry can impact data disclosure as well. Healthcare organizations in the US have to respect HIPAA. School districts in the US need to be mindful of COPPA. Financial institutions also have other regulations such as SOX or GLBA.
* Contact Information
    * Name, job title, email, phone number and escalation priority order during the engagement
* Lines of Communication
    * What channels should be used during the engagement? Email, phone, in-person meetings.etc&lt;/p&gt;
&lt;p&gt;This phase should always boil down to these main points:
* Written consent from the owner or authorized agent of the network is required before testing begins, including a range of IPs / domains that are in-scope for testing
* The scope can not be breached without additional written and signed addendums to the contract
* Exploits should not damage the systems or network being tested
* Access to discovered personal or company-confidential data should not be accessed without written consent. This is paramount to complying with the multitude of data disclosure regulations globally.
* Intercepting communications (emails, phone calls) needs consent of one of the parties to prevent breach of wire-tapping or monitoring laws
* Certain regulatory systems, such as systems under HIPAA, require additional authorization before testing can occur to prevent data disclosure, or downtime of critical infrastructure.
For each pentest engagement, a new VM should be stood up. This prevents any traces of data from the last engagement and ensures we are starting with a clean slate.
* Kali Linux or ParrotOS come with a breadth of tools to get off the ground running quickly.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It's important to state that during all phases of the process, detailed notes, including any screenshots, logs, commands, files created/removed, policies changed, hosts compromised, accounts compromised.etc, are being taken. Not only to aid during cleanup, but to make the final report easier to assemble.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="information-gathering"&gt;Information Gathering&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Different test types can differ in how much information we start with&lt;ul&gt;
&lt;li&gt;Blackbox is the minimal information provided to start such as external IP ranges and domains. Nothing more.&lt;/li&gt;
&lt;li&gt;Greybox provides an additional layer of information, maybe specific IPs, URLs, hostnames or subnets to focus on&lt;/li&gt;
&lt;li&gt;Whitebox provides a full disclosure. Could be full network topology diagrams, detailed configurations, admin credentials, source code&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Different environments can also vary how information is gathered&lt;ul&gt;
&lt;li&gt;Some environments, like IoT or SCADA environments, are more fragile and cannot have automated tooling scanning or it could DoS the entire network. &lt;/li&gt;
&lt;li&gt;Cloud environments mean the cloud provider also may need notified or have additional rules for engagement.&lt;/li&gt;
&lt;li&gt;Mobile devices could be corporate-owned or BYOD, which could be out of scope.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;During recon, it is important not to jump ahead at the first potential vulnerability discovered, but ensure as much information is gathered up front. This can help prevent a loss of time if the exploitation of the first vuln fails and won't require falling back into more recon.&lt;ul&gt;
&lt;li&gt;Pentests differ from CTFs in that a pentest is meant to be exhaustive. This stage should be much more meticulous and require more patience to ensure as much information is gathered up front before the exploitation phase starts. CTFs tend to immediately jump into the first vuln/exploit as time is of the essence.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Multiple ways to gather this information including:&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;OSINT&lt;/strong&gt; - reviewing publicly available data with methodologies such as Google Dorking. Does not require polling the target directly.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enumeration&lt;/strong&gt; - utilizing tooling directly on the authorized network ranges to attempt to discover services, hosts and other information.&lt;ul&gt;
&lt;li&gt;See [[Footprinting]] for more info on methodology&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="vulnerability-assessment"&gt;Vulnerability Assessment&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Divided into two areas, one is scanning for known vulns using automated tools. The other is analyzing the results to determine a path forward&lt;/li&gt;
&lt;li&gt;Analysis can be broken down further into&lt;ul&gt;
&lt;li&gt;Descriptive - describes data set based on characteristics&lt;/li&gt;
&lt;li&gt;Diagnostic - ex. reviewing data to determine root cause of vulnerability&lt;/li&gt;
&lt;li&gt;Predictive - evaluating historical and current data to determine future probabilities or detect trends&lt;/li&gt;
&lt;li&gt;Prescriptive - narrow down what actions to take to eliminate a problem or trigger a certain action&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="exploitation"&gt;Exploitation&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;One fork after the assessment stage, requires utilizing the information from the two prior steps to prepare targeted attacks against the found endpoint.&lt;/li&gt;
&lt;li&gt;Attacks can be prioritized with the probability of success, complexity and probability of damage. CVSS scoring and NVD calculator can aid in determining the success rate.&lt;/li&gt;
&lt;li&gt;Also broken into two main areas: actual exploitation of potential vulnerabilities, and remotely exposed services that could be misconfigured or vulnerable for access&lt;/li&gt;
&lt;li&gt;Web exploitation tends to be its own special focus due to the diversity of web frameworks, hosting options, dependencies&lt;/li&gt;
&lt;li&gt;There may not be a readily available PoC for a specific vulnerability. This requires setting up a local test VM as close as possible to the target environment. Then, we can attempt to reconstruct the exploit for use in the live test against our target, taking into consideration the easiness and destructiveness of the exploit.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="post-exploitation"&gt;Post-Exploitation&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Once exploitation succeeds, access tends to be granted as least-privilege (ie, a locked-down service account specifically used for running the web app).&lt;/li&gt;
&lt;li&gt;This stage essentially starts a new chapter for information gathering, as new recon is required to determine the best path forward into privilege escalation and/or lateral movement.&lt;ul&gt;
&lt;li&gt;At the post-exploitation stage, pillaging is a new element for info gathering. This helps understand the role of the system and how it communicates with other systems that could be used for lateral movement or stealing credentials to re-use.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;This stage can be the most critical for evasive testing. As simple commands like &lt;code&gt;net user&lt;/code&gt; or &lt;code&gt;whoami&lt;/code&gt; from a strange account or IP can trigger alerts and cause our comprised user account or host to become quarantined. &lt;/li&gt;
&lt;li&gt;Data exfiltration can be an additional step during post-exploitation. This needs to be already stated in the scope, as the type of data could be under other regulations (HIPAA, PCI, GLBA.etc)&lt;ul&gt;
&lt;li&gt;Dummy data could be created to test exfiltration and see if DLP, EDR or firewall systems detect this&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="lateral-movement"&gt;Lateral Movement&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Succeeds exploitation and part of post-exploitation. One of the available paths forward in further compromising the environment.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="proof-of-concept"&gt;Proof-Of-Concept&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;A detailed writeup on how a vulnerability was exploited, that can be reproduced to confirm the vulnerability exists&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="post-engagement"&gt;Post-Engagement&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Clean-up of all exploitation commands&lt;/li&gt;
&lt;li&gt;Polishing of notes into a summary report that is detailed and consumable by both executive and technical teams&lt;/li&gt;
&lt;li&gt;The role of a pentester is to remain impartial and provide remediation recommendations for all discovered activity. It is not on the pentester to perform any remediation or provide detailed remediation advice. (ie. "sanitize user input" for code vulnerable to SQL injection instead of rewriting and providing a copy of better code)&lt;/li&gt;
&lt;li&gt;Regulations may require the evidence from the test be retained for a period of time. Encrypting these results and destroying the VM that was used during the test are critical for maintaining confidentiality.&lt;/li&gt;
&lt;/ul&gt;</content><category term="intro"/></entry><entry><title>Getting Started</title><link href="https://hackbook.ericturner.it/intro/getting-started/" rel="alternate"/><published>2026-05-23T08:26:00-04:00</published><updated>2026-05-23T08:26:00-04:00</updated><author><name>Eric Turner</name></author><id>tag:hackbook.ericturner.it,2026-05-23:/intro/getting-started/</id><summary type="html">&lt;h2 id="welcome"&gt;Welcome&lt;/h2&gt;
&lt;p&gt;This hackbook is a WIP source of truth for me as I go for my OSCP certification. My plan here is to document methodology used to exploit the full kill chain, include references to tools and their syntax.&lt;/p&gt;
&lt;h2 id="mitre-attck"&gt;MITRE ATT&amp;amp;CK&lt;/h2&gt;
&lt;p&gt;The MITRE ATT&amp;amp;CK framework is a matrix …&lt;/p&gt;</summary><content type="html">&lt;h2 id="welcome"&gt;Welcome&lt;/h2&gt;
&lt;p&gt;This hackbook is a WIP source of truth for me as I go for my OSCP certification. My plan here is to document methodology used to exploit the full kill chain, include references to tools and their syntax.&lt;/p&gt;
&lt;h2 id="mitre-attck"&gt;MITRE ATT&amp;amp;CK&lt;/h2&gt;
&lt;p&gt;The MITRE ATT&amp;amp;CK framework is a matrix and knowledge base of adversary tactics and techniques. The current version, v19, was released on Apr 28, 2026. It introduced a major change, with the Defense Evasion tactic being split into Stealth and Defense Impairment. &lt;/p&gt;
&lt;p&gt;The MITRE ATT&amp;amp;CK framework also serves as a sort of killchain, documenting specific techniques as it progresses across the complete killchain.&lt;/p&gt;
&lt;h1 id="this-site_1"&gt;This Site&lt;/h1&gt;
&lt;p&gt;I have seen other sites, such as &lt;a href="https://hacktricks.wiki/en/index.html"&gt;HackTricks&lt;/a&gt; create a similar source of truth for offense security techniques. My goal with this one is to align such methodologies directly with the MITRE ATT&amp;amp;CK as I become familiar with them. This site may not have &lt;em&gt;every&lt;/em&gt; technique in the matrix, but as I learn specific methodology I will tie it to those specific techniques. It also will serve as a compendium of notes from related offensive security courses I have taken.&lt;/p&gt;</content><category term="intro"/></entry></feed>