Modifying data between the server and the client

When performing a MITM attack, we are able not only to listen to everything being sent between the victim systems but also to modify requests and responses and, thus, make them behave as we want.

In this recipe, we will use Ettercap filters to detect whether or not a packet contains the information we are interested in and to trigger the change operations.

Getting ready

We need to have MITM working before starting this recipe.

How to do it...

  1. Our first step is to create a filter file. Save the following code in a text file (we will call it regex-replace-filter.filter) as is shown here:
    # If the packet goes to vulnerable_vm on TCP port 80 (HTTP) if (ip.dst == '192.168.56.102'&& tcp.dst == 80) { # if the ...

Get Kali Linux Web Penetration Testing Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.