paxnWo Posted January 1, 2010 Report Posted January 1, 2010 Salvati un .htaccess cu urmatoarele:RewriteEngine onRewriteBase /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. Quote
lucian Posted January 1, 2010 Report Posted January 1, 2010 incearca sa bagi cu header in index.php<?php header("Content-Type: image/png");readfile("image.png");$fopen = fopen("a.txt", "a"); fwrite($fopen, "wink");fclose($fopen);?> Quote
lucian Posted January 1, 2010 Report Posted January 1, 2010 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=='); ?> Quote
loki Posted January 1, 2010 Report Posted January 1, 2010 mai merge mai simplu (fara htaccess) parca asa:in index.php la coada un $s=file_get_contents("ceva.png"); echo $s;<img src> executa codul php in orice browser Quote
Vlachs Posted February 19, 2010 Report Posted February 19, 2010 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 Quote