keysau / get-log4j-windows.ps1 Goto Github PK
View Code? Open in Web Editor NEWIdentifying all log4j components across all windows servers, entire domain, can be multi domain. CVE-2021-44228
License: MIT License
Identifying all log4j components across all windows servers, entire domain, can be multi domain. CVE-2021-44228
License: MIT License
Thanks for making this script publicly available.
Had some trouble with some hosts returning "Error, Script Failed". After having a look through the remnant temp files and the script, I found that these hosts only had really old versions of Log4J that don't ship with pom.properties. I converted this section of code to search for MANIFEST.MF instead and pull out version info from Implementation-Version, swapped groupId for Implementation-Title and set artifactId to "N/A".
Thx for the script! The Windows-local version works great!
Having a bit trouble to get this one working.
I get following output.
PS C:\Windows\system32> C:\support\Get-log4j-Windows.ps1
cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
PreReq: Powershell 5.0+. Proceeding..
PreReq: 7-zip tools installed. Proceeding..
PreReq: Credentials Detected. Proceeding..
WARNING: Valid values for attribute 'SamAccountName' should end with '$'; the filter clause '(SamAccountName -like )' may not work as intended.
Get-ADComputer : The search filter cannot be recognized
At C:\support\Get-log4j-Windows.ps1:88 char:12
+ $Servers = Get-ADComputer -Filter "SamAccountName -like '$($AdCompSea ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-ADComputer], ADException
+ FullyQualifiedErrorId : ActiveDirectoryServer:8254,Microsoft.ActiveDirectory.Management.Commands.GetADComputer
0.) Ping AD servers to make sure online..
Test-Connection : Cannot validate argument on parameter 'ComputerName'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At C:\support\Get-log4j-Windows.ps1:120 char:63
+ ... IF (Test-Connection -BufferSize 32 -Count 1 -ComputerName $_ -Quiet) ...
+ ~~
+ CategoryInfo : InvalidData: (:) [Test-Connection], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.TestConnectionCommand
1.) Complete.
2.) Splitting 0 AD servers into blocks of 1 Servers each..
3.) Complete.
4.) Multi-thread Searching blocks of servers..
5.) Complete.
6.) Building Report Object..
7.) Complete.
8.) --All Complete--
9.) ------------------
I changed
$Domain = (Get-WmiObject Win32_ComputerSystem).Domain
to
$Domain = (Get-WmiObject Win32_ComputerSystem).mydomain.com
I don't need the multi domain switches. So it's not really clear if I need to change these values.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.