IDS/IPS Evasion

Stalking isn't that easy.

Firewall Detection

Testing Firewall rules (Using ACK scan)

circle-exclamation
└──╼ $ sudo nmap 10.10.10.10 -p 21,22,25 -sS -Pn -n --disable-arp-ping --packet-trace

SENT (0.0278s) TCP 10.10.14.2:57347 > 10.10.2.10:21 S .. <SNIP> ..
SENT (0.0278s) TCP 10.10.14.2:57347 > 10.10.10.10:22 S .. <SNIP> ..
SENT (0.0278s) TCP 10.10.14.2:57347 > 10.10.10.10:25 S .. <SNIP> ..

RCVD (0.0329s) ICMP [10.10.10.10 > 10.10.14.2 Port 21 unreachable (type=3/code=3) ] .. <SNIP> ..
RCVD (0.0341s) TCP 10.10.10.10:22 > 10.10.14.2:57347 SA .. <SNIP> ..
RCVD (1.0386s) TCP 10.10.10.10:22 > 10.10.14.2:57347 SA .. <SNIP> ..

SENT (1.1366s) TCP 10.10.14.2:57348 > 10.10.10.10:25 S .. <SNIP> ..

PORT   STATE    SERVICE
21/tcp filtered ftp 
22/tcp open     ssh 
25/tcp filtered smtp 
MAC Address: DE:AD:00:00:BE:EF (Intel Corporate)

IDS/IPS Evasion

circle-info

We can determine whether there are IDS systems by scanning from a single host from a VPS and see whether we get banned from that IP or not.

Since we must be as quiet as possible in our scans, here we provide some techniques to evade getting caught in our scans:

Scenario 1 : Hiding our IP with legitimate IPs

We can hide our real IP address in a collection of IP addresses so that the IDS/IPS won't filter out our probes and treat them like legitimate ones.

triangle-exclamation

Solution : Decoys

The idea is generating random IP addresses and hide our IP in a random position in between.

Scenario 2 : Some services are only available for specific subnets

Solution : Changing source IP address

Scenario 3 : We need to perform DNS resolution but there are DNS-based Firewalls or filtering systems

Solution : DNS Proxying

circle-info

The idea is :

Instead of sending DNS queries directly to the target's DNS server, the queries are sent to a third-party DNS server (the proxy) or even use the company's DNS server.

Scenario 4 : Hiding our probes with legitimate DNS resolution queries

circle-info

Many DNS requests to be made via TCP port 53 due to changes in DNS resolution methods, so it's better we try to exploit this port.

  • SYN scan from default port:

  • SYN scan from port 53:

circle-check

Last updated