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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.