Skip to contentSkip to conversation

Matching text from HTTP?

DISCUSSION Mihael Kukec 2 participants 2 messages Mar 13, 2004

lore
Share & tools
lore
#0 lore raw

Is that possible? Matching text from HTTP? And possibly changing it?

For example, change every occurrence of ABC with *** ?

#1 lore raw
Quoted 1 line · Mihael Kukec

Is that possible? Matching text from HTTP?

It is just about possible (with the string match), however it is not at all recommended:

1. It will only match if the entire string is contained within one packet - if the string you search for crosses packet boundaries, netfilter cannot match it.

2. It can only search for plaintext strings, and an increasing amount of HTTP content these days is compressed (gzipped, basically) during transmission.

Quoted 1 line

And possibly changing it?

No, netfilter cannot change the contents of a packet (only the contents of certain headers).

Quoted 1 line

For example, change every occurrence of ABC with *** ?

Use Squid, or Apache as a proxy.

Antony.

Signature · 6 lines
There's no such thing as bad weather - only the wrong clothes.

 - Billy Connolly

                                                     Please reply to the list;
                                                           please don't CC me.