InfoSec_38553
Feb 12, 2012Nimbostratus
Removing Server Header from F5 Response
Hi all,
I have irule block specific request. The F5 response include this header:
Server: BigIP
How I can remove this header from F5 response.
Note: This F5 response not server response.
I tried the following code, but it is not working.
I'm not sure I already using the right event for this.
when HTTP_RESPONSE {
TCP::collect
}
}
when HTTP_RESPONSE_DATA {
if { [regexp -indices "Server: BigIP" [TCP::payload] firstmatch] } {
set matchlen [expr [lindex $firstmatch 1] - [lindex $firstmatch 0] + 1]
set replacement [binary format c* {97 98 99 0 100 101 102}]
TCP::payload replace [lindex $firstmatch 0] $matchlen ""
TCP::release
}
}
Also I tried this event:
when SERVER_CONNECTED {
TCP::collect
}
when SERVER_DATA {
if { [regexp -indices "Server: BigIP" [TCP::payload] firstmatch] } {
set matchlen [expr [lindex $firstmatch 1] - [lindex $firstmatch 0] + 1]
set replacement [binary format c* {97 98 99 0 100 101 102}]
TCP::payload replace [lindex $firstmatch 0] $matchlen ""
TCP::release
}
}