Created
May 31, 2022 01:02
-
-
Save usernam121/af2983132c827c43593f8e00a30caad3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
import DOMPurify from 'dompurify'; | |
function Xss(){ | |
const [text, setText] = useState(""); | |
const [script, setScript] =useState(""); | |
const [imgg, setimgg] = useState(""); | |
const [userInput, setInput] = useState(""); | |
const [pure, setPure] = useState(""); | |
return( | |
<div className="xss"> | |
<h1 className="" dangerouslySetInnerHTML={{__html: text}}/>Type your Script <br></br> | |
<input value={text} onChange={e => setText(e.target.value.replace("", ""))} /> | |
<h1 dangerouslySetInnerHTML={{__html: imgg}}/>Type your Script img has been blacklisted <br></br> | |
<input value={imgg} onChange={e => setimgg(e.target.value.replace("img", ""))} /> | |
<h1 dangerouslySetInnerHTML={{__html: script}}/>Use a button to cauase XSS <br></br> | |
<input value={script} onChange={e => setScript(e.target.value.replace("script", ""))} /> | |
<h1 dangerouslySetInnerHTML={{ __html: pure }} />Banned Charactors<br></br> | |
<input value={pure} onChange={e => setPure(e.target.value.replace(/[#_/]/g, ""))} /> | |
<h1 dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(userInput) }} />Sanatized with DOMPurify default settings<br></br> | |
<input value={userInput} onChange={e => setInput(e.target.value.replace())} /> | |
</div> | |
)} | |
export default Xss |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First π₯π to comment. Hehe. Thank you so much, fellow hacker! ^_^ I saw your fresh YouTube video, and you mentioned this resource in the description. π€ππ€π₯³π₯π₯ππ π»βπ₯ππππ―π₯π»π₯Έπ₯°πͺπ»πͺπ»
I also wanted to say that there are at least three typos that you may made:
cause*
Use a button to cauase XSS
Characters*
Banned Charactors
Sanitized*
Sanatized with DOMPurify default settings