Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: copy to clipboard Payloads (web browser) #26

Merged
merged 1 commit into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
575 changes: 574 additions & 1 deletion package-lock.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@
"react-dom": "^18.2.0",
"react-icons": "^4.6.0",
"react-router-dom": "^6.4.2",
"styled-components": "^5.3.6"
"react-syntax-highlighter": "^15.5.0",
"styled-components": "^5.3.6",
"react-copy-to-clipboard": "^5.0.4"
},
"devDependencies": {
"@types/react": "^18.0.17",
"@types/react-copy-to-clipboard": "^5.0.4",
"@types/react-dom": "^18.0.6",
"@types/react-syntax-highlighter": "^15.5.5",
"@types/styled-components": "^5.1.26",
"@vitejs/plugin-react": "^2.1.0",
"typescript": "^4.6.4",
Expand Down
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import {Route, Routes, useLocation} from "react-router-dom";
import {Route, Routes} from "react-router-dom";

import { Navbar, Footer, Payloads, SecList, Tools, Homepage } from './components/';
import {Footer, Homepage, Navbar, Payloads, SecList, Tools} from './components/';

const xssPayloads = [
'onload=alert(1)><svg/1=',
Expand Down
38 changes: 38 additions & 0 deletions src/components/GoogleDorks/GoogleDorks.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React, {useState} from 'react';

const GoogleDorks = () => {


const DorkList = 'site:';
const DorkList2 = 'intitle:';
const DorkList3 = 'inurl:';

// const searchDork = DorkList[0];
const [value, setValue] = useState("");
const [inurlValue, setInurlValue] = useState("");

const handleClick = () => {
const site = value;
const inurlValueDork = DorkList3 + inurlValue;
const searchUrl = `https://www.google.com/search?q=${DorkList}` + site + ` ` + inurlValueDork;

console.log(searchUrl);
window.open(searchUrl, "_blank");
};


return (
<div>
<input type="text" placeholder={"site:"} name={"site"} value={value}
onChange={(e) => setValue(e.target.value)}/>

<input type="text" placeholder={"inurl:"} name={"inurl"} value={inurlValue}
onChange={(e) => setInurlValue(e.target.value)}/>

<br/>
<button className="button-final" onClick={handleClick}> Submit</button>

</div>
);
};
export default GoogleDorks;
12 changes: 12 additions & 0 deletions src/components/GoogleDorks/GoogleDorksElements.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import styled from 'styled-components';

export const GoogleDorks = styled.div`
display: flex;
flex-direction: column;
color: #fff;
padding: 0 30px;
position: relative;
z-index: 1;
margin-top: 80px;
width: 500px;
`;
35 changes: 3 additions & 32 deletions src/components/Homepage/Homepage.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,11 @@
import React, {useState} from 'react';

import React from 'react';

const Homepage = () => {


const DorkList = 'site:';
const DorkList2 = 'intitle:';
const DorkList3 = 'inurl:';

// const searchDork = DorkList[0];
const [value, setValue] = useState("");
const [inurlValue, setInurlValue] = useState("");

const handleClick = () => {
const site = value;
const inurlValueDork = DorkList3 + inurlValue;
const searchUrl = `https://www.google.com/search?q=${DorkList}` + site + ` ` + inurlValueDork;

console.log(searchUrl);
window.open(searchUrl, "_blank");
};


return (
<div>
<input type="text" placeholder={"site:"} name={"site"} value={value}
onChange={(e) => setValue(e.target.value)}/>

<input type="text" placeholder={"inurl:"} name={"inurl"} value={inurlValue}
onChange={(e) => setInurlValue(e.target.value)}/>

<br/>
<button className="button-final" onClick={handleClick}> Submit</button>

<h1>Homepage</h1>
</div>
);
);
};

export default Homepage;
1 change: 1 addition & 0 deletions src/components/Navbar/NavList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { NavItem, NavListContainer } from "./NavListElements";

const navItems = [
{ to: '', title: 'Home' },
{ to: 'googleDorks', title: 'Google Dorks' },
{ to: 'payloads', title: 'Payloads' },
{ to: 'tools', title: 'Tools' },
{ to: 'sec-list', title: 'SecList' },
Expand Down
48 changes: 42 additions & 6 deletions src/components/Payloads/Payloads.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,47 @@
import React from "react";
import React, {useState} from "react";
import SyntaxHighlighter from 'react-syntax-highlighter';
import {CopyToClipboard} from 'react-copy-to-clipboard';
import {PayloadsContainer, PayloadsCopyToClipboard, PayloadsHeading,} from "./PayloadsElements";
import {AiOutlineCopy} from 'react-icons/ai';
import {docco} from 'react-syntax-highlighter/dist/esm/styles/hljs';

const Payloads = () => {
return (
<div>
<h1>Payloads</h1>
</div>
);

const PayloadsList = [
"onload=alert(1)><svg/1=",
">alert(1)</script><script/1=",
];

const [state, setState] = useState({
value: '',
copied: false,
});

const PayloadsListMap = PayloadsList.map((payload, index) => {
return (
<PayloadsCopyToClipboard key={index}>
<SyntaxHighlighter language="javascript" style={docco}>
{payload}
</SyntaxHighlighter>
<CopyToClipboard text={payload} onCopy={() => setState({value, copied: true})}>
<AiOutlineCopy/>
</CopyToClipboard>
</PayloadsCopyToClipboard>
);
});

return (
<PayloadsContainer>
<PayloadsHeading>Payloads</PayloadsHeading>
<SyntaxHighlighter>TTY shell</SyntaxHighlighter>

{PayloadsListMap}


{state.copied ? <span style={{color: 'red'}}>Copied.</span> : null}

</PayloadsContainer>
);
};

export default Payloads;
29 changes: 29 additions & 0 deletions src/components/Payloads/PayloadsElements.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import styled from 'styled-components';

export const PayloadsContainer = styled.div`
display: flex;
flex-direction: column;
color: #fff;
padding: 0 30px;
position: relative;
z-index: 1;
margin-top: 80px;
width: 500px;
`;


export const PayloadsCopyToClipboard = styled.div`
display: flex;

`;

export const PayloadsHeading = styled.h2`

`;



export const CopyToClipboard = styled.h2`

`;