|
2 | 2 | Forwarding Machine |
3 | 3 | ****************** |
4 | 4 |
|
5 | | -Scapy's ``ForwardMachine`` is a utility that allows to create server that forwards packets to another server, with the ability |
6 | | -to modify them on-the-fly. This is similar to a "proxy", but works with any protocols over IP/IPv6. The ``ForwardMachine`` was initially designed to be used with TPROXY, |
7 | | -a linux feature that allows to bind a socket that received *packets to any IP destination* (in which case it properly forwards the packet to the initially |
8 | | -intended destination), but it also work as a standalone server. |
| 5 | +Scapy's ``ForwardMachine`` is a utility that allows to create a server that forwards packets to another server, with the ability |
| 6 | +to modify them on-the-fly. This is similar to a "proxy", but works on the layer 4 (rather than 5+). The ``ForwardMachine`` was initially designed to be used with TPROXY, |
| 7 | +a linux feature that allows to bind a socket that receives *packets to any IP destination* (usually, a socket only receives packets whose destination is local), but it also work as a standalone server (that binds a normal socket). |
9 | 8 |
|
10 | 9 | A ``ForwardMachine`` is expected to be used over a normal Python socket, of any kind, and needs to extended with two |
11 | | -functions: ``xfrmcs`` and ``xfrmsc``. The first one is called whenever data is received from the client side (client-to-server), the other when the data |
12 | | -is received from the server. |
| 10 | +functions: ``xfrmcs`` and ``xfrmsc``. The first one is called whenever data is received from the client side (client-to-server, "cs"), the other when the data |
| 11 | +is received from the server (server-to-client, "sc") |
13 | 12 |
|
14 | 13 | ``ForwardMachine`` can be used in two modes: |
15 | 14 |
|
16 | | -- **TPROXY** |
17 | | -- **SERVER**, in which case a normal socket is bound. Think of it as a glorified socat |
| 15 | +- **TPROXY**, acts as a transparent proxy that intercepts one or many connections towards multiple servers |
| 16 | +- **SERVER**, acts like a glorified socat that accepts connections towards the local server |
18 | 17 |
|
19 | 18 | Basic usage |
20 | 19 | ___________ |
|
0 commit comments