Lab05 Siemj
Lab05 Siemj
The aim of this lab is to configure logging on network and host-based devices such as Pfsense
firewall and Windows 2003 server. Similarly, to create Snort intrusion detection system
signatures to detect network-based intrusion and attacks. The Splunk SIEM application needs
to be configured to receive logs from above mentioned devices for security monitoring and
incident investigation purposes.
Our first activity is to configure the pfSense firewall as performed in the previous labs to setup
network connection. In the lab you will be provided
with network group in which you can select the LAN 192.168.x.0/24 and DMZ IP addresses
192.168.y.0/24 for configuration as shown in Figure 1.
Demo: https://youtu.be/Nla6ZDheBkU
http://asecuritysite.com/csn11128/nets
Main gateway/
fireweall Firewall
(pfSense)
_Public 192.168.x.254/24 _Private
em0 em1
(DHCP) U001 - Ubuntu
em2
10.200.0.1/24 Server
192.168.y.254/24 192.168.x.7/24)
K001 - Kali
W001 - Windows 2003
(DHCP)
Server
(192.168.y.7/24)
K002 - Kali
_DMZ Splunk
(192.168.y.9/24)
forwarder
W003 – Windows 2008
with Splunk Enterprise
(192.168.y.8/24)
On the Pfsense firewall enable remote logging through options Status -> System logs ->
Settings -> Remote Logging Options. Enable the checkbox on Send log messages to remote
It is important to audit logon attempts to Server especially the failure logon attempts as they
help to understand about attacks such as brute force, dictionary, and other password based
attacks against Web server. On the Windows 2003 Server go to Run -> gpedit.msc ->
Windows Settings -> Local Policies -> Audit Policy and enable Failure audit logon events as
shown below in the Figure 5.
In addition, the account lockout policy can be configured under Windows Settings -> Security
Settings -> Account Policies -> Account Lockout Policy -> Account lockout threshold to
disable a user account if the number of logon attempts exceeds some specified number of
attempts.
# Port scan
preprocessor sfportscan:\
proto { all } \
scan_type { all } \
sense_level { high } \
logfile { portscan.log }
# Bad logins
alert tcp any 21 -> any any (msg:"FTP Bad login"; content:"530 User "; nocase;
flow:from_server,established; sid:491;rev:5;)
# Telnet login
alert tcp any any <> any 23 (flags:S; msg:"Telnet Login";sid:9000005;rev:1;)
# ping sweep
alert icmp any any -> any any (msg:"ICMP Packet found";sid:9000000;)
alert icmp any any -> any any (itype: 0; msg: "ICMP Echo Reply";sid:9000001;)
alert icmp any any -> any any (itype: 3; msg: "ICMP Destination
Unreachable";sid:9000002;)
alert icmp any any -> any any (itype: 4; msg: "ICMP Source Quench Message
received";sid:9000003;)
alert icmp any any -> any any (itype: 5; msg: "ICMP Redirect message";sid:9000004;)
alert icmp any any -> any any (itype: 8; msg: "ICMP Echo Request";sid:9000005;)
alert icmp any any -> any any (itype: 11; msg: "ICMP Time Exceeded";sid:9000006;)
# Note you may have to add the following for the stream analysis
Snort will store its alerts in the alerts.ids file into the log folder below where you run it from.
Make a note of the place that Snort will save its file to:
The Splunk SIEM provides a free forwarder tool which can be utilised to forward logs from
multiple remote systems to the Splunk indexing and consolidation system. In our case the
Windows 2003 Server does not contain Splunk forwarder instance installed. You can download
and install the Splunk forwarder from the link provided below:
https://enusec.org/cyber/splunk-forwarder.msi
Now, the Splunk forwarder running on the Windows 2003 Server is configured to collect
Windows audit logs and Snort logs from the local system. In the next step, the forwarder needs
to be configured to forward logs to the Splunk program running on the management server /
Windows 2008 server.
Finally setup the Receiving Indexer at your Windows 2008 server (192.168.y.8) on port 9997
(Figure 8).
Once the Windows audit logs are generated they can be seen on the Splunk application.
Similarly, in case of any alert got generated while running Snort they can be seen using the
Splunk web interface. In addition the Snort app can used to check statistics using its built-in
search commands.
Next, the Splunk server needs to be configured to receive data from the pfSense firewall. Use
Settings -> Data Inputs -> New -> UDP. Enter port 514 and for sourcetype select as
“pfsense_pf”. This is important as this request the pfSense add-on app installed on Splunk to
format the received PfSense data.
2. The Snort rule should detect a bad login into FTP on Windows 2003. Login into FTP
using a valid login and an invalid one.
3. The Snort rule should detect a ping on the Windows 2003 computer, so test it with a
ping.
4. The Snort rule should detect a port scan on the Windows 2003 server. Perform an NMAP
scan, and see if Splunk will detect it.
6. The Snort rules should detect a port scan on the host. Now open-up your firewall to
allow all TCP ports to be allowed from the WAN to your Windows 2003 host. Next,
using NMAP, perform a port scan of your Windows 2003 server, from your Kali host.
Red v Blue
We will now do a basic Red v Blue exercise. If you are in a lab, ask your neighour what IP
address they have mapped their Windows 2003 server to (which is their WAN address). If you
are studying remotely, see if you can “buddy” up with another distance student (or ask your
tutor to test your setup).
Now ask them to monitor the Splunk interface. Perform the following, but do it in a random
order, and ask your neighbour to identify you when they see a trace:
Now go to:
http://asecuritysite.com/tests/tests?sortBy=siem