Introduction

In the first part of this post I explained the scenario and the initial approach for data gathering, in this second part I’m going to discuss the approach to collect data while the incident is happening.

Understanding Data Gathering Process

To better understand the information gathering flow that we are about to configure, review the diagram below:

image

The expected flow in this scenario is:

  1. The attacker starts the procedure against the company’s resource.
  2. Once the amount of attempts reaches a certain number an alert is triggered.
  3. Event Viewer will log the event 21284 and since it is configured to trigger an action once this event happens, it will execute the script.
  4. The script will open netmon and start collect data.

Although this is the basic flow for this scenario, we also have an option to follow a different approach, for example: leave netmon running until the network traffic from the attacker’s IP is received and once event viewer shows the event you can trigger a different action. For this example we will use the following flow:

  1. We will leave Netmon running (following the steps from NetWiz to create the nmcap command line)
  2. The attacker starts the procedure against the company’s resource.
  3. Nmcap is configure to capture all traffic coming from this source IP (which is the one that you already determine from previous 21284)
  4. Once the amount of attempts reaches a certain number an alert is triggered and event 21284 will be logged.
  5. Task Scheduler is configured to run a task (a BAT file for example) that will send a traffic pattern to force netmon to stop capturing.

Preparing the Environment

In order to use Netwiz you should have Network Monitor installed first in your system, once you finish installing Netmon, download NetWiz from Codeplex and follow the steps below on your Edge device:

  1. Double click NetWiz1.1.exe
  2. Click Yes on the initial pop up window.
  3. In the Welcome page, click Next.
  4. In the Protocols page select All protocols coming from this host (IP address). For the purpose of this example I’m going to use the IP 192.168.0.1.
  5. On the Schedule Start page leave it as default (Now) and click Next.
  6. On the File Size page leave it as default (100 MB) and click Next.
  7. On the Schedule Stop page choose When the following traffic comes in and click Select Traffic button. Type the IP address of one internal resource that you want to establish a connection when this event happens. For this example we will use the IP address of one internal web server. Choose Destination, TCP as protocol and port 80. Click OK and click Next.
  8. On the Interface page, select the adapter that face Internet connection and click Next.
  9. On the Options page, leave the default option and click Next.
  10. Click Finish.

Second part is to configure Event Viewer to trigger an action when this event happens, in order to do that follow the guidelines from this post. The BAT (or script) that will be used during this process must have the command that will initiate a connection on port 80 of the internal web server (telnet webserver_IP 80). This is an important step in order to comply with the parameters that were configured in NetWiz. This BAT (or script) can also contain a lot more commands (including other tools that can gather more data about a target system); it all depends on what you want to collect in additional to netmon traces.

imageIt is also important to emphasize that sometimes this type of attack comes from random IP addresses, if this is the case, you will not need to create filters to only collect data coming from one specific address.

Now What?

Once you have the traffic pattern and also identified the IP address that is starting the attack against your resource you can start by contacting your service provider to report the abuse of resources coming from this IP. Check if it is possible for your ISP to track this IP and take actions against this type of attack.