Monday, September 23, 2019

Enumerating RSYNC servers with examples

Listing remote files and directories

root@ubuntu:~# rsync -rdt rsync://148.43.33.23:873
code            backup
root@ubuntu:~# 
root@ubuntu:~# rsync -rdt rsync://148.43.33.23:873/code
drwxr-xr-x          4,096 2019/08/26 11:57:35 .
-rw-rw-r--         10,240 2019/08/26 11:57:35 archive.tar
-rw-rw-r--        151,155 2019/08/04 16:45:38 fgets.png
-rw-rw-r--        151,483 2019/08/04 16:43:16 file-get-contents.png
-rw-rw-r--        150,683 2019/08/04 16:28:27 fread.png
-rw-r--r--          4,304 2019/08/26 11:45:23 fuzz.php
-rw-rw-r--         14,514 2019/08/17 12:49:43 http-auth.png
-rw-rw-r--        150,810 2019/08/04 16:43:52 include.png
-rw-rw-r--        388,241 2019/08/19 13:12:31 lfi-rce-perl.png
-rw-rw-r--        406,990 2019/08/17 20:18:15 lfi-rce.png
-rw-rw-r--        150,723 2019/08/04 16:44:51 readfile.png
-rw-rw-r--        344,161 2019/08/06 15:56:35 recipes-1.0.zip
drwxrwxr-x          4,096 2019/08/17 20:03:33 logs
-rwxrwxr-x         65,863 2019/08/17 20:01:11 logs/access.log
root@ubuntu:~# 

Copy a file to a server

rsync -zvh [local file] [user]@[host]:/path/to/remote/dir
root@ubuntu:~# rsync -zvh archive.tar data@148.43.33.23:/home/data/backup/
data@148.43.33.23's password: 
archive.tar

sent 252 bytes  received 35 bytes  52.18 bytes/sec
total size is 10.24K  speedup is 35.68
root@ubuntu:~# 

Copy files from a server

rsync -zvh [user]@[host]:/path/to/remote/file [local file]
root@ubuntu:~# rsync -zvh data@148.43.33.23:/home/data/backup/fuzz.php f.php
data@148.43.33.23's password: 
fuzz.php

sent 43 bytes  received 1.73K bytes  236.40 bytes/sec
total size is 4.30K  speedup is 2.43
root@ubuntu:~# 

Copy a directory to a server

rsync -avz [local dir] [user]@[host]:/path/to/remote/dir
root@ubuntu:~# rsync -avz Pictures/ data@148.43.33.23:/home/data/backup/
data@148.43.33.23's password: 
sending incremental file list
./
fgets.png
file-get-contents.png
fread.png
http-auth.png
include.png
lfi-rce-perl.png
lfi-rce.png
readfile.png

sent 1,503,262 bytes  received 171 bytes  273,351.45 bytes/sec
total size is 1,564,599  speedup is 1.04
root@ubuntu:~# 

Copy directories from a server

rsync -avz [user]@[host]:/path/to/remote/dir [local dir]
root@ubuntu:~# rsync -azvh data@148.43.33.23:/home/data/backup/logs logs
data@148.43.33.23's password: 
receiving incremental file list
created directory logs
logs/
logs/access.log

sent 47 bytes  received 3.02K bytes  245.60 bytes/sec
total size is 65.86K  speedup is 21.45
root@ubuntu:~# 

No comments:

Post a Comment

Exploiting Weak WEBDAV Configurations

The server we are going to audit has the following fingerprint. 80/tcp open http Apache httpd 2.2.8 ((Ubuntu) DAV/2) Next we need t...