1

我想使用 Frida Socket 创建一个 tcp 服务器,并接受多个客户端。

JS代码:

function failure(err)
{
    console.error(err.message);
}
function accepted(connection)
{
    console.warn('accepted');
    connection.close();
}
function listened(listener)
{
    console.warn('listened');
    listener.accept()
        .then(accepted)
        .catch(failure);
}
function interaction()
{
    Socket.listen({"family": 'unix', 'host': '127.0.0.1', 'port': 6658})
        .then(listened)
        .catch(failure);
}
interaction();

使用 Python 进行测试:

import socket

address = "127.0.0.1"
port = 6658

def test_frida_socket():
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((address, port))
    s.close()

test_frida_socket()

我运行了 4 次 python 代码,但仅第一次打印了“接受”。

4

0 回答 0