五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(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的評論 (共 條)

分享到微博請遵守國家法律
景东| 保亭| 濮阳市| 武清区| 辽中县| 名山县| 资中县| 于田县| 旺苍县| 汝南县| 鸡东县| 牙克石市| 胶州市| 舟山市| 济源市| 宜州市| 屯门区| 都昌县| 晋州市| 五莲县| 铜山县| 耿马| 乌兰浩特市| 建水县| 建德市| 吴旗县| 将乐县| 平塘县| 乌拉特中旗| 三河市| 远安县| 文登市| 郑州市| 玛曲县| 大悟县| 莆田市| 钦州市| 济阳县| 抚顺市| 望江县| 平顶山市|