国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

Frida API操作之網(wǎng)絡(luò)API

2020-10-08 09:26 作者:無情劍客Burning  | 我要投稿

在聊天系統(tǒng)開發(fā)(1) 的文章中,對TCP/IP相關(guān)的網(wǎng)絡(luò)編程進行了介紹。在Frida API進階-文件 對文件描述符、輸入輸出流進行了介紹。本篇文章集于此介紹Frida中網(wǎng)絡(luò)相關(guān)的API。

Socket

Socket.listen([options]): open a TCP or UNIX listening socket. Returns a Promise that receives a SocketListener. Defaults to listening on both IPv4 and IPv6, if supported, and binding on all interfaces on a randomly selected TCP port.

Socket.connect(options): connect to a TCP or UNIX server. Returns a Promise that receives a SocketConnection.

Socket.type(handle): inspect the OS socket handle and return its type as a string which is either tcp, udp, tcp6, udp6, unix:stream, unix:dgram, or null if invalid or unknown.

Socket.localAddress(handle), Socket.peerAddress(handle): inspect the OS socket handle and return its local or peer address, or null if invalid or unknown. The object returned has the fields:

  • ip: (IP sockets) IP address as a string.

  • port: (IP sockets) IP port as a number.

  • path: (UNIX sockets) UNIX path as a string.

SocketListener

All methods are fully asynchronous and return Promise objects.

  • path: (UNIX family) path being listened on.

  • port: (IP family) IP port being listened on.

  • close(): close the listener, releasing resources related to it. Once the listener is closed, all other operations will fail. Closing a listener multiple times is allowed and will not result in an error.

  • accept(): wait for the next client to connect. The returned Promise receives a SocketConnection.

SocketConnection

Inherits from IOStream. All methods are fully asynchronous and return Promise objects.

  • setNoDelay(noDelay): disable the Nagle algorithm if noDelay is true, otherwise enable it. The Nagle algorithm is enabled by default, so it is only necessary to call this method if you wish to optimize for low delay instead of high throughput.

代碼示例

  1. function frida_Java() {

  2. Java.perform(function () {

  3. ? ? ?var ip_family = new Object();

  4. ? ? ?ip_family.family = "ipv4";

  5. ? ? ?ip_family.host = "47.92.90.25";

  6. ? ? ?ip_family.port = 7000;

  7. ? ? ?var socket = Socket.connect(ip_family);

  8. ? ? ?socket.then(function(successMessage){

  9. ? ? ? ?console.log(successMessage instanceof SocketConnection);

  10. ? ? ? ?successMessage.setNoDelay(true);

  11. ? ? ? ?var promise = successMessage.input.read(1000);

  12. ? ? ? ?promise.then(function(result){

  13. ? ? ? ? ?console.log(' burning'+hexdump(result,{lenght:1000}));

  14. }).catch(function(error){

  15. ? ? ? ? ?console.log(' fail:'+error);

  16. });

  17. });

運行結(jié)果如下,可以看出successMessage的類型是SocketConnection。

Nagle algorithm

在發(fā)出去的數(shù)據(jù)還沒有被確認(rèn)之前,假如又有小數(shù)據(jù)生成,那么就把小數(shù)據(jù)收集起來,湊滿一個MSS或者等收到確認(rèn)后再發(fā)送。

JavaScript判斷數(shù)據(jù)類型

instanceof 是用來判斷 A 是否為 B 的實例,表達式為:A instanceof B,如果 A 是 B 的實例,則返回 true,否則返回 false。 在這里需要特別注意的是:instanceof 檢測的是原型。

由上圖可以看出[]的原型指向Array.prototype,間接指向Object.prototype, 因此 [] instanceof Array 返回true, [] instanceof Object 也返回true。

其他的判斷方式

  1. typeof

  2. toString?Object.prototype.toString.call(window);//[object global] window 是全局對象 global 的引用

  3. constructor

公眾號

更多Frida相關(guān)內(nèi)容,歡迎關(guān)注我的微信公眾號:無情劍客。


Frida API操作之網(wǎng)絡(luò)API的評論 (共 條)

分享到微博請遵守國家法律
昌都县| 迭部县| 富裕县| 双牌县| 拜城县| 安顺市| 木里| 嘉善县| 瓮安县| 长宁县| 清徐县| 罗定市| 静宁县| 启东市| 略阳县| 门头沟区| 饶河县| 阿拉善左旗| 读书| 铜川市| 周至县| 太湖县| 灌云县| 营口市| 聊城市| 古浪县| 商城县| 丽水市| 普定县| 辽源市| 东城区| 乐陵市| 南雄市| 萨迦县| 喀喇沁旗| 贵港市| 门源| 疏勒县| 二连浩特市| 隆德县| 公主岭市|