Forum Discussion
Jason_40769
Nimbostratus
May 18, 2011Code injection
I am trying to figure out how to inject code into a web site like a POP Under AD from an ad company without it disrupting the site itself. Im a beginner Iruler any thoughts?
Jason_40769
Nimbostratus
May 19, 2011
when RULE_INIT {
set txt_texttoinsert "
"
}
when HTTP_REQUEST {
Don't allow data to be chunked
if { [HTTP::version] eq "1.1" } {
if { [HTTP::header is_keepalive] } {
HTTP::header replace "Connection" "Keep-Alive"
}
HTTP::version "1.0"
}
}
when HTTP_RESPONSE {
if { [HTTP::header Content-Type] starts_with "text/html" } {
if { [HTTP::header exists "Content-Length"] } {
set content_length [HTTP::header "Content-Length"]
} else {
set content_length 1000000
}
if { $content_length > 0 } {
HTTP::collect $content_length
}
}
}
when HTTP_RESPONSE_DATA {
set resp [HTTP::payload]
(( search resp for body or /body and get the offset ))
(( set first_part substr $resp 1 ))
(( set rest $insert_text[substr $resp
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects