SNORT CHALLENGE (BASICS)
WRITING IDS RULES: HTTP
Write a single rule to detect "all TCP port 80 traffic" packets in the given pcap file. What is the number of detected packets?
#write a rule based on specification - Snort 3 Rule Writing Guide
root@thm:~$ BROWSER > https://docs.snort.org/welcome
Search: searchWord
- https://docs.snort.org/rules
#syntax <action> <protocol> <sourceIP> <sourcePort> <direction> <destinationIP> <destinationPort> (options {general rule options | payload rule options | non-payload rule options}; sid:uniqueID; rev:revisionNumber;)
root@dco:~$ nano /etc/snort/rules/local.rules
alert tcp any any <> any 80 (msg:"All TCP port 80 traffic"; sid:1000001; rev:1;)
#test user-created rule by reading pcaps - this will generate snort log files
root@dco:~$ snort -c local.rules -r mx-3.pcap -A full -l .
#perform log analysis on the alert file
root@thm:~$ ls
alert local.rules mx-3.pcap snort.log.1735772343
root@thm:~$ cat alert
[**] [1:1000001:1] All TCP port 80 traffic [**]
[Priority: 0]
root@thm:~$ grep [\[\*\*\]] alert | wc -l
* 164Write a single rule to detect "all TCP port 80 traffic" packets in the given pcap file then investigate the log file. What is the destination address of packet 63?
#write a rule based on specification - Snort 3 Rule Writing Guide
root@thm:~$ BROWSER > https://docs.snort.org/welcome
Search: searchWord
- https://docs.snort.org/rules
#syntax <action> <protocol> <sourceIP> <sourcePort> <direction> <destinationIP> <destinationPort> (options {general rule options | payload rule options | non-payload rule options}; sid:uniqueID; rev:revisionNumber;)
root@dco:~$ nano /etc/snort/rules/local.rules
alert tcp any any <> any 80 (msg:"All TCP port 80 traffic"; sid:1000001; rev:1;)
#test user-created rule by reading pcaps - this will generate snort log files
root@dco:~$ snort -c local.rules -r mx-3.pcap -A full -l .
#perform log analysis on the snort log file
root@thm:~$ ls
alert local.rules mx-3.pcap snort.log.1735772343
root@thm:~$ sudo snort -r snort.log.1735772343 -n 63
* the -n option specifies the number of packets to process when reading a packet capture file
- this cmd specifically limit Snort to processing the first 63 packets in the log file.
- if there are fewer than 63 packets in the file, Snort will process all available packets
* WARNING: No preprocessors configured for policy 0.
05/13-10:17:10.295515 145.254.160.237:3371 -> 216.239.59.99:80
TCP TTL:128 TOS:0x0 ID:3917 IpLen:20 DgmLen:761 DF
***AP*** Seq: 0x36C21E28 Ack: 0x2E6B5384 Win: 0x2238 TcpLen: 20
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+Write a single rule to detect "all TCP port 80 traffic" packets in the given pcap file then investigate the log file. What is the ACK number of packet 64?
#write a rule based on specification - Snort 3 Rule Writing Guide
root@thm:~$ BROWSER > https://docs.snort.org/welcome
Search: searchWord
- https://docs.snort.org/rules
#syntax <action> <protocol> <sourceIP> <sourcePort> <direction> <destinationIP> <destinationPort> (options {general rule options | payload rule options | non-payload rule options}; sid:uniqueID; rev:revisionNumber;)
root@dco:~$ nano /etc/snort/rules/local.rules
alert tcp any any <> any 80 (msg:"All TCP port 80 traffic"; sid:1000001; rev:1;)
#test user-created rule by reading pcaps - this will generate snort log files
root@dco:~$ snort -c local.rules -r mx-3.pcap -A full -l .
#perform log analysis on the snort log file
root@thm:~$ ls
alert local.rules mx-3.pcap snort.log.1735772343
root@thm:~$ sudo snort -r snort.log.1735772343 -n 64
* the -n option specifies the number of packets to process when reading a packet capture file
- this cmd specifically limit Snort to processing the first 63 packets in the log file.
- if there are fewer than 63 packets in the file, Snort will process all available packets
* WARNING: No preprocessors configured for policy 0.
05/13-10:17:10.295515 145.254.160.237:3371 -> 216.239.59.99:80
TCP TTL:128 TOS:0x0 ID:3917 IpLen:20 DgmLen:761 DF
***AP*** Seq: 0x36C21E28 Ack: 0x2E6B5384 Win: 0x2238 TcpLen: 20
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+Write a single rule to detect "all TCP port 80 traffic" packets in the given pcap file then investigate the log file. What is the SEQ number of packet 62?
#write a rule based on specification - Snort 3 Rule Writing Guide
root@thm:~$ BROWSER > https://docs.snort.org/welcome
Search: searchWord
- https://docs.snort.org/rules
#syntax <action> <protocol> <sourceIP> <sourcePort> <direction> <destinationIP> <destinationPort> (options {general rule options | payload rule options | non-payload rule options}; sid:uniqueID; rev:revisionNumber;)
root@dco:~$ nano /etc/snort/rules/local.rules
alert tcp any any <> any 80 (msg:"All TCP port 80 traffic"; sid:1000001; rev:1;)
#test user-created rule by reading pcaps - this will generate snort log files
root@dco:~$ snort -c local.rules -r mx-3.pcap -A full -l .
#perform log analysis on the snort log file
root@thm:~$ ls
alert local.rules mx-3.pcap snort.log.1735772343
root@thm:~$ sudo snort -r snort.log.1735772343 -n 62
* the -n option specifies the number of packets to process when reading a packet capture file
- this cmd specifically limit Snort to processing the first 63 packets in the log file.
- if there are fewer than 63 packets in the file, Snort will process all available packets
* WARNING: No preprocessors configured for policy 0.
05/13-10:17:10.295515 145.254.160.237:3371 -> 216.239.59.99:80
TCP TTL:128 TOS:0x0 ID:3917 IpLen:20 DgmLen:761 DF
***AP*** Seq: 0x36C21E28 Ack: 0x2E6B5384 Win: 0x2238 TcpLen: 20
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+Write a single rule to detect "all TCP port 80 traffic" packets in the given pcap file then investigate the log file. What is the TTL of packet 65?
#write a rule based on specification - Snort 3 Rule Writing Guide
root@thm:~$ BROWSER > https://docs.snort.org/welcome
Search: searchWord
- https://docs.snort.org/rules
#syntax <action> <protocol> <sourceIP> <sourcePort> <direction> <destinationIP> <destinationPort> (options {general rule options | payload rule options | non-payload rule options}; sid:uniqueID; rev:revisionNumber;)
root@dco:~$ nano /etc/snort/rules/local.rules
alert tcp any any <> any 80 (msg:"All TCP port 80 traffic"; sid:1000001; rev:1;)
#test user-created rule by reading pcaps - this will generate snort log files
root@dco:~$ snort -c local.rules -r mx-3.pcap -A full -l .
#perform log analysis on the snort log file
root@thm:~$ ls
alert local.rules mx-3.pcap snort.log.1735772343
root@thm:~$ sudo snort -r snort.log.1735772343 -n 65
* the -n option specifies the number of packets to process when reading a packet capture file
- this cmd specifically limit Snort to processing the first 63 packets in the log file.
- if there are fewer than 63 packets in the file, Snort will process all available packets
* WARNING: No preprocessors configured for policy 0.
05/13-10:17:10.325558 145.254.160.237:3372 -> 65.208.228.223:80
TCP TTL:128 TOS:0x0 ID:3918 IpLen:20 DgmLen:40 DF
***A**** Seq: 0x38AFFFF3 Ack: 0x114C81E4 Win: 0x25BC TcpLen: 20
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+Write a single rule to detect "all TCP port 80 traffic" packets in the given pcap file then investigate the log file. What is the source IP of packet 65?
Write a single rule to detect "all TCP port 80 traffic" packets in the given pcap file then investigate the log file. What is the source port of packet 65?
WRITING IDS RULES: FTP
Write a single rule to detect "all TCP port 21" traffic in the given pcap. What is the number of detected packets?
Write a single rule to detect "all TCP port 21" traffic in the given pcap then Investigate the log file. What is the FTP service name?
Write a rule to detect failed FTP login attempts in the given pcap. What is the number of detected packets?
Write a rule to detect successful FTP logins in the given pcap. What is the number of detected packets?
Write a rule to detect FTP login attempts with a valid username but no password entered yet. What is the number of detected packets?
Write a rule to detect FTP login attempts with the "Administrator" username but no password entered yet. What is the number of detected packets?
WRITING IDS RULES: PNG
Write a rule to detect the PNG file in the given pcap. Investigate the logs and identify the software name embedded in the packet.
Write a rule to detect the GIF file in the given pcap. Investigate the logs and identify the image format embedded in the packet.
WRITING IDS RULES: TORRENT METAFILE
Write a rule to detect the torrent metafile in the given pcap. What is the number of detected packets?
Write a rule to detect the torrent metafile in the given pcap. What is the name of the torrent application?
Write a rule to detect the torrent metafile in the given pcap. What is the MIME (Multipurpose Internet Mail Extensions) type of the torrent metafile?
Write a rule to detect the torrent metafile in the given pcap. What is the hostname of the torrent metafile?
TROUBLESHOOTING RULE SYNTAX ERRORS
Fix the syntax error in local-1.rules file and make it work smoothly. What is the number of the detected packets?
Fix the syntax error in local-2.rules file and make it work smoothly. What is the number of the detected packets?
Fix the syntax error in local-3.rules file and make it work smoothly. What is the number of the detected packets?
Fix the syntax error in local-4.rules file and make it work smoothly. What is the number of the detected packets?
Fix the syntax error in local-5.rules file and make it work smoothly. What is the number of the detected packets?
Fix the logical error in local-6.rules file and make it work smoothly to create alerts. What is the number of the detected packets?
Fix the logical error in local-7.rules file and make it work smoothly to create alerts. What is the name of the required option:
USING EXTERNAL RULES (MS17-010)
Use the given rule file (local.rules) to investigate the ms1710 exploitation. What is the number of detected packets?
Use local-1.rules empty file to write a new rule to detect payloads containing the "\IPC$" keyword. What is the number of detected packets?
Use local-1.rules empty file to write a new rule to detect payloads containing the "\IPC$" keyword. Investigate the log/alarm files. What is the requested path?
USING EXTERNAL RULES (LOG4J)
Use the given rule file (local.rules) to investigate the log4j exploitation. What is the number of detected packets?
Use the given rule file (local.rules) to investigate the log4j exploitation. Investigate the log/alarm files. How many rules were triggered?.
Use the given rule file (local.rules) to investigate the log4j exploitation. Investigate the log/alarm files. What are the first six digits of the triggered rule sids?
Use local-1.rules empty file to write a new rule to detect packet payloads between 770 and 855 bytes. What is the number of detected packets?
Use local-1.rules empty file to write a new rule to detect packet payloads between 770 and 855 bytes. What is the name of the used encoding algorithm?
Use local-1.rules empty file to write a new rule to detect packet payloads between 770 and 855 bytes. What is the IP ID of the corresponding packet?
Last updated