Skip to content

Instantly share code, notes, and snippets.

@c0d3x27
Created January 14, 2025 01:10
Show Gist options
  • Save c0d3x27/c943b4429887b6114e729086a3ac3d6d to your computer and use it in GitHub Desktop.
Save c0d3x27/c943b4429887b6114e729086a3ac3d6d to your computer and use it in GitHub Desktop.
xss stored
function decodeAndExecute(encodedStr) {
let decodedCode = decodeURIComponent(encodedStr); // Decodes the URL-safe string back
eval(decodedCode); // Executes the decoded JavaScript code
}
// Example usage with a decoded URL-safe string
let encodedStr = "eval%28String.fromCharCode%2897%2C%20108%2C%20101%2C%20114%2C%20116%29%29";
decodeAndExecute(encodedStr); // Executes the decoded alert("Hello")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment