Skip to content
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

1.Resolving the issue of not being able to find the SmithProbeProxy d… #648

Merged
merged 3 commits into from
Jul 5, 2024

Conversation

cnguoyj-leminis
Copy link
Collaborator

…ue to the class sandbox in Glassfish;

2.In Glassfish, hooking java.io.File can cause the JVM to exit with an exception when adding a WAR file. For now, temporarily disable the hook on java.io.File

A similar PR may already be submitted!
Please search among the Pull request before creating one.

Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:

For more information, see the CONTRIBUTING guide.

Summary

This PR fixes/implements the following bugs/features

  • Bug 1
  • Bug 2
  • Feature 1
  • Feature 2
  • Breaking changes

Explain the motivation for making this change. What existing problem does the pull request solve?

Test plan (required)

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.

Code formatting

Closing issues

Fixes #

…ue to the class sandbox in Glassfish;

2.In Glassfish, hooking java.io.File can cause the JVM to exit with an exception when adding a WAR file. For now, temporarily disable the hook on java.io.File
if(exceptionObject instanceof ClassNotFoundException) {
String classname = (String) args[1];
//SmithLogger.logger.info("processGlassfishClassLoaderfindClass find class:"+classname);
if (((classname.startsWith("com.security.smith.") ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这部分建议单独封装一个函数,后续如果有依赖添加,只需要改一次

classname.startsWith("rasp.com") ||
classname.startsWith("rasp.javassist")))

return (Object)Class.forName(classname);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里也是可能抛异常的,自己捕获一下吧

"org.apache.felix.framework.BundleWiringImpl$BundleClassLoader"
};

private Set<String> addedJarset = Collections.synchronizedSet(new HashSet<>());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不是只有一个jar包吗?是否还需要集合

…ing java.io.File will cause the JVM process to crash directly if hooked;

2.It has been tested and passed in GlassFish 5 and GlassFish 7 versions;
@cnguoyj-leminis cnguoyj-leminis merged commit 3e5557c into memshell-main Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants