Sorry for late post back, and thx for replay!
So, I replace filter and it looks no like:
Code:
# Ask server not Encoding packets
if (ip.proto == TCP && tcp.dst == 80) {
if (search(DATA.data, "Accept-Encoding")) {
replace("Accept-Encoding", "Accept-Rubbish!");
msg("<< Drop encoding \n");
}
}
# Replace Image
if (ip.proto == TCP && tcp.src == 80) {
if (pcre_regex(DATA.data, "<img")) {
log(DATA.data, "/tmp/before.log");
pcre_regex(DATA.data, "<img.[^>]*src=.[^>]*>", "nothing");
log(DATA.data, "/tmp/after.log");
msg(">> image replace \n");
}
}
So, and as i can understand using it I will replace:
Code:
... some html head body tags ...
<img src='graphics/rate_star.png'></img>
... some closepup html head body tags ...
to this:
Code:
... some html head body tags ...
nothing</img>
... some closepup html head body tags ...
But in practice I face with other results:
1) page loading take extra long time
2) page content was only one word "nothing"
p.s.
my debug logs contain such data:
/tmp/before.log
Code:
HTTP/1.0 200 OK
Date: Tue, 26 Jan 2010 22:11:42 GMT
Server: Apache
Last-Modified: Tue, 26 Jan 2010 22:11:34 GMT
ETag: "21735e-b7-47e18919ad180"
Accept-Ranges: bytes
Content-Length: 183
Content-Type: text/html
X-Cache: MISS from server.org
X-Cache-Lookup: HIT from server.org:8080
Via: 1.0 server.org:8080 (squid)
Connection: keep-alive
... some html head body tags ...
<img src='graphics/rate_star.png'></img>
... some closepup html head body tags ...
/tmp/after.log
p.p.s.
Sorry for this mess html-replcae-strings but i cant post lins