0

I recently wanted to create a plugin that would run a traceroute from the server to a player. I have some struggles with java cause my server hosting doesn't allow me to have access to other file than the minecraft part, so i can't setup correctly the libraries i need.

I thought about creating a Rest API that would be on a VPS where i have all permissions, but i'm not sure we can run a traceroute from another IP than the local one, and i need to run it from the minecraft server to the player.

The traceroute that i currently use is this one: https://gist.github.com/djangofan/1d0e3de52ac5375d3f52249c5293d588

The problem is that it uses Jpcap, which is a native library and therefore it requires to set it up via different system properties etc which i'm not allowed with my server hosting.

How would you do ?

NoeXWolf
  • 241
  • 1
  • 12

1 Answers1

0

I assume that you and the server operator are no longer friends when you do something like this … but that's your decision.

When you can't apply the native library to the server, your only option would be to re-implement traceroute in Java – although I have no clue if the JVM has deep enough access into the system as that might be possible at all.

If you can write to the file system of your Minecraft server, and when you upload a JAR to it, in order to install the plugin, you can add the native library as a binary resource to the JAR. If you can upload only a class, you can add the library as a big BASE64 String to that class.

Before you start your traceroute, you write the native library out to the file system, then you call System.load() for it, and finally you execute the traceroute. – But this definitely belongs to the category "Dirty Hack", as it may destabilise the server, and it may not even work, because of an active SecurityManager that prevents you from doing so.

When the traceroute library does the call to System.load() (or System.loadLibrary()) itself, you may get along with manipulating the property java.library.path instead of calling System.load(), but again, an active SecurityManager could prevent that …

tquadrat
  • 3,033
  • 1
  • 16
  • 29