Skip to content

Instantly share code, notes, and snippets.

@thedarkcolour
Last active July 29, 2023 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thedarkcolour/8d58cb778f795b7481ed053cb413b14b to your computer and use it in GitHub Desktop.
Save thedarkcolour/8d58cb778f795b7481ed053cb413b14b to your computer and use it in GitHub Desktop.
Julia script to check for any usages of ObjectInputStream in mod JARs in case of BleedingPipe exploit
# Script written by thedarkcolour
# To use, drop this script file into a mods folder and run it with the Julia REPL.
# Install ZipFile
using Pkg
Pkg.add("ZipFile")
using ZipFile
wd = @__DIR__
println("Checking for ObjectInputStream usages in mod JAR files in $wd")
for (root, dirs, files) in walkdir(wd)
for file_name in files
file = joinpath(root, file_name)
if (endswith(file_name, ".jar"))
reader = ZipFile.Reader(file)
is_vulnerable = false
for innerFile in reader.files
if (occursin("ObjectInputStream", read(innerFile, String)))
is_vulnerable = true
break
end
if (is_vulnerable)
break
end
end
if (is_vulnerable)
println("Mod JAR $file_name uses ObjectInputStream and thus may be vulnerable to the BleedingPipe exploit! Ensure you are using a patched version.")
is_vulnerable = false
end
close(reader)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment