创建 test.js
This commit is contained in:
20
scripts/test.js
Normal file
20
scripts/test.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
Java.perform(function() {
|
||||||
|
var ByteArrayOutputStream = Java.use('java.io.ByteArrayOutputStream');
|
||||||
|
var HttpsURLConnection = Java.use('javax.net.ssl.HttpsURLConnection');
|
||||||
|
|
||||||
|
HttpsURLConnection.getOutputStream.implementation = function() {
|
||||||
|
var outputStream = this.getOutputStream();
|
||||||
|
|
||||||
|
// 创建一个新的 ByteArrayOutputStream 实例,以便于我们读取数据。
|
||||||
|
var byteArrayOutputStream = ByteArrayOutputStream.$new();
|
||||||
|
|
||||||
|
outputStream.write.overload('[B').implementation = function(buffer) {
|
||||||
|
byteArrayOutputStream.write(buffer);
|
||||||
|
console.log("[*] Data written to URL:", this.getURL().toString());
|
||||||
|
console.log("[*] Data:", byteArrayOutputStream.toString('UTF-8'));
|
||||||
|
return outputStream.write(buffer);
|
||||||
|
};
|
||||||
|
|
||||||
|
return outputStream;
|
||||||
|
};
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user