cross site scripting e uma falha q o navegador interpreta uma entrada de dados como se fosse um codigo da pagina, veja uma pagina simples de vun xss
se agente ao inves de digitar um comentario e sim um codigo html ele vai interpretar e ai q ta bicho '-', para evitar isso agente pode substituir < e > por < e >, criei essa funçao simples q faz isso de maneira facil
so colocar a funçao fts_antixss e passar como argumento a string q ele converte automaticamente
bom galera e isso ^^
by hacker fts315
- Código:
<html>
<body bgcolor="black" text="white">
<script type="text/javascript">
function hack()
{
dados = document.getElementById("fts315").value;
document.getElementById("saida").innerHTML = dados;
}
</script>
<center>
<h1 color="red"> FTS XSS Refletido</h1>
<input type="text" id="fts315">
<input type="button" value="enviar" onclick="hack()">
<hr>
<div id="saida">
aq vai ser o comentario ^^
</div>
</center>
</body>
</html>
se agente ao inves de digitar um comentario e sim um codigo html ele vai interpretar e ai q ta bicho '-', para evitar isso agente pode substituir < e > por < e >, criei essa funçao simples q faz isso de maneira facil
- Código:
function fts_antixss(string1)
{
tam = string1.length;
string2 = string1.replace(/</g,"<");
string1 = string2.replace(/>/g,">");
return string1;
}
so colocar a funçao fts_antixss e passar como argumento a string q ele converte automaticamente
- Código:
<html>
<body bgcolor="black" text="white">
<script type="text/javascript">
function fts_antixss(string1)
{
tam = string1.length;
string2 = string1.replace(/</g,"<");
string1 = string2.replace(/>/g,">");
return string1;
}
function hack()
{
dados = document.getElementById("fts315").value;
document.getElementById("saida").innerHTML = fts_antixss(dados);
}
</script>
<center>
<h1 color="red"> FTS XSS Refletido</h1>
<input type="text" id="fts315">
<input type="button" value="enviar" onclick="hack()">
<hr>
<div id="saida">
aq vai ser o comentario ^^
</div>
</center>
</body>
</html>
bom galera e isso ^^
by hacker fts315