Jump to content
paxnWo

chrome ftw

Recommended Posts

Salvati un .htaccess cu urmatoarele:

RewriteEngine on
RewriteBase /
RewriteRule ^(.*)\.png$ $1.php [L]

Salvati un index.php cu urmatoarele:

<?php 

$fopen = fopen("a.txt", "a");
fwrite($fopen, "wink");
fclose($fopen);

?>

Salvati fisierul a.txt gol cu perm 777.

Salvati mail.php cu urmatoarele:


<?
$to = "emailul tau";
$from = "";
$subject = "s0z";
$message = <<<EOF
<html>
<img src="http://host.ro/index.png">
</html>
EOF;
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
mail($to, $subject, $message, $headers);

echo "d0ne.";
?>

Accesati mail.php, deschideti mailul primit cu chrome, dati show images, apoi accesati a.txt. A scris "wink" in el, nu ? Deci se executa.

Pe ff si ie nu merge.

Link to comment
Share on other sites

incearca sa dai clear la buffer. la mine merge


<?php ob_start();

$fopen = fopen("a.txt", "a");
fwrite($fopen, "wink");
fclose($fopen);

ob_clean();
header('Content-type: image/gif');
//1x1 pixel transparent gif
print base64_decode('R0lGODlhAQABALMAAAAAAIAAAACAA'.
'ICAAAAAgIAAgACAgMDAwICAgP8AAA'.
'D/AP//AAAA//8A/wD//wBiZCH5BAE'.
'AAA8ALAAAAAABAAEAAAQC8EUAOw==');

?>

Link to comment
Share on other sites

revin putin la topicul asta.

daca avem codul:



<?php

ob_start();

$html = "a";
$fl = fopen('a.txt', 'a');
fwrite($fl, $html);
fclose($fl);

ob_clean();
@header('Content-type: image/gif');
print base64_decode('R0lGODlhAQABALMAAAAAAIAAAACAA'.
'ICAAAAAgIAAgACAgMDAwICAgP8AAA'.
'D/AP//AAAA//8A/wD//wBiZCH5BAE'.
'AAA8ALAAAAAABAAEAAAQC8EUAOw==');

?>

si accesez image.gif ( care-i defapt image.php; url rewrite ), gasesc un "a" in a.txt, deci se executa fwrite.

insa, daca eu vreau un echo, in loc de fwrite, la un iframe catre o pagina ce contine fie un redirect js sau php, nu va mai merge ( testez asa : daca e accesata pagina prin redirectul respectiv, sa scrie ceva in b.txt ). m-am gandit ca n-are timp sa se execute ca-i intre ob_start si ob_clean si-am incercat si cu sleep, doar ca la fel, nu merge ... e oarecum normal.

aveti idee cum pot sa execut cumva un mic redirect intre ob_start si ob_clean pentru codul de mai sus ?

le:

oare merge asa ?

index.php:


<?php

@header('Content-type: image/gif');
print base64_decode('R0lGODlhAQABALMAAAAAAIAAAACAA'.
'ICAAAAAgIAAgACAgMDAwICAgP8AAA'.
'D/AP//AAAA//8A/wD//wBiZCH5BAE'.
'AAA8ALAAAAAABAAEAAAQC8EUAOw==');

@header('Location: do.php');

unde do.php este:



echo "<iframe src='pagina_ce_contine_un_redirect_js.html'>";

@header('Content-type: image/gif');
print base64_decode('R0lGODlhAQABALMAAAAAAIAAAACAA'.
'ICAAAAAgIAAgACAgMDAwICAgP8AAA'.
'D/AP//AAAA//8A/wD//wBiZCH5BAE'.
'AAA8ALAAAAAABAAEAAAQC8EUAOw==');


?>

ideea este ca index.gif sa fie vazut ca o imagine de yahoo atunci cand trimit cuiva pe mail:

<img src="http://site.ro/index.gif">

e vazut ca imagine atunci cand apare Show Images si nu e vazut ca imagine atunci cand apare X.

logic ca nu o sa iti mearga, pentru ca ai pus deja continutul header-ului ca fiind o imagine, daca il pui ca imagine el asteapta o imagine, nu ai cum sa scrii text intr-un header de la o imagine, apropo daca folosesti un image.php sa afisezi o imagine si in background sa execute ceva merge pe toate browserele

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...