

And as always, stay tuned for more hacking lessons! Or, if you have an unrelated hacking question, stop by the Null Byte forum.

If you have any questions on any of this, please ask them in the comments below. Your patience now, though, will likely be rewarded if you can get past the firewall or NIDS without being detected! Questions?

For instance, the "sneaky" scan can take up to 5 hours per IP address vs.42 seconds for the default scan. The downside, of course, is that we need to be VERY patient as this type of scan can take longer than a default scan or an insane scan (the fastest). Our scan will now sail right past the NIDS and firewall without being detected. Now, we set our scan down to sneaky speed by using this command: The two slowest speeds, paranoid and sneaky, are both below the Snort threshold for port scans. We can change the speeds by using the -T switch followed by either the name of the speed or that speed's corresponding number. See my previous articles using evading an NIDS with Snort here and here for more information.įortunately, nmap allows us to scan at different speeds-and it has six different built-in speeds. Remember, the more we know about the firewall and NIDS, the better we can evade them. If we scan scan below that threshold, our scan will go undetected! In Snort, the threshold is set by default at 15 ports per second.

It has signatures built into its ruleset to detect scans like those we are attempting from nmap, but because networks see so many port scans everyday (large corporate networks might see 1000s a day), they set a minimum threshold level that the scan must meet before it triggers an alert. The most widely used NIDS in the world is Snort. If we can figure out what this threshold is and stay below it, we can run our reconnaissance scan without being blocked and without triggering an alert. That weakness is that they only detect and alert on these scans when the number of packets that meet its signature exceed a certain level or threshold. Most of these perimeter defenses, though, have a weakness. If you're blocked by the firewall or NIDS, the alert will capture your scan and IP address as it identifies your scan. Modern firewalls and nearly every NIDS can detect these types of scans and block your scan or send an alert. Each of these will return results, but with diminished reliability.Īlthough these scans will not be logged, the firewall or NIDS may block or alert the system admin of the scan. Step 3: Alternate Scansĭepending upon the system, we might also try a UDP scan (using the UDP protocol to find open ports), a NULL scan (a TCP packet with no flags set), and an Xmas (a TCP packet with the P, U, F flags set) scan. As you can see, it also provides us with us list of open ports and is nearly as reliable as the TCP connect scan, but without leaving a trail in the log files.
