Author Topic: Other ways to Access Cookies  (Read 421 times)

0 Members and 1 Guest are viewing this topic.

Offline Moistfish

  • Serf
  • *
  • Posts: 20
  • Cookies: 1
    • View Profile
Other ways to Access Cookies
« on: February 14, 2015, 12:18:39 pm »
Hi, question for the wise

htmlspecialchars($_COOKIE["name"]) - PHP
$_COOKIE["name"] - PHP
document.cookie - Javascript

Currently i have these commands to grab the cookie.  However, the victim has javascript disabled and PHP is currently being sanitised with the addition of comment tags between < and ?, so output is <!--?   ......PHP CODE ...... ?-->. 
I am attempting to XSS a forum, where the victim posts his own cookie, using HTML as the XSS (this may be the wrong way but its an attempt i am trying in the name of learning and education ^^)

My current code (if it helps with context) is:

<form action="comment.py" method="POST">
<input type="hidden" name="comment" value="$_COOKIE['auth']"/>
<input type="submit" value="&nbsp;"/>
</form>

This successfully posts $_COOKIE['auth'] to the forum, when clicked. (i know the PHP tags are missing but they are just commented out.


My Question: Is there any other languages that i could use within HTML value field to grab the value of a cookie?

P.S. this is part of a CTF game =)
« Last Edit: February 14, 2015, 12:22:05 pm by Moistfish »