()
| 23 | |
| 24 | |
| 25 | export default function ReverseShell () { |
| 26 | const useIPv4State = PersistedState<Ipv4TcpCacheState>( 'ipv4_tcp_cache' ); |
| 27 | const [ searchText, setSearchText ] = useState( '' ); |
| 28 | const [ searchedColumn, setSearchedColumn ] = useState( '' ); |
| 29 | const searchInput = useRef<InputRef>( null ); |
| 30 | |
| 31 | const [ values, setValues ] = useIPv4State( { |
| 32 | ip: '', |
| 33 | port: '', |
| 34 | shell: '/bin/sh', |
| 35 | } ); |
| 36 | |
| 37 | const [ messageApi, contextHolder ] = message.useMessage(); |
| 38 | const info = () => { |
| 39 | messageApi.success( 'Your reverse shell has been copied to the clipboard!' ); |
| 40 | }; |
| 41 | |
| 42 | const items = [ |
| 43 | { |
| 44 | key: '1', |
| 45 | label: 'Base64 Encoded', |
| 46 | }, |
| 47 | { |
| 48 | key: '2', |
| 49 | label: 'URL Encoded', |
| 50 | }, |
| 51 | { |
| 52 | key: '3', |
| 53 | label: 'Double URL Encoded', |
| 54 | }, |
| 55 | ]; |
| 56 | |
| 57 | const handleChange = ( name: string ) => ( event: { target: { value: string } } ) => { |
| 58 | setValues( { ...values, [ name ]: event.target.value } ); |
| 59 | }; |
| 60 | |
| 61 | const handleChangeSelect = ( prop: string ) => ( data: any ) => { |
| 62 | setValues( { ...values, [ prop ]: data } ); |
| 63 | }; |
| 64 | |
| 65 | const [ filteredInfo, setFilteredInfo ] = useState<Record<string, FilterValue | null>>( {} ); |
| 66 | const [ sortedInfo, setSortedInfo ] = useState<SorterResult<DataType>>( {} ); |
| 67 | const handleChangeFilter: TableProps<DataType>[ 'onChange' ] = ( _, filters, sorter ) => { |
| 68 | setFilteredInfo( filters ); |
| 69 | setSortedInfo( sorter as SorterResult<DataType> ); |
| 70 | }; |
| 71 | |
| 72 | const handleSearch = ( |
| 73 | selectedKeys: string[], |
| 74 | confirm: ( param?: FilterConfirmProps ) => void, |
| 75 | dataIndex: DataIndex, |
| 76 | ) => { |
| 77 | confirm(); |
| 78 | setSearchText( selectedKeys[ 0 ] ); |
| 79 | setSearchedColumn( dataIndex ); |
| 80 | }; |
| 81 | |
| 82 | const handleReset = ( clearFilters: () => void ) => { |
nothing calls this directly
no test coverage detected