`ip` and `port` don't exist in `SocketEndpointAddress` error
TrueBers opened this issue · comments
Dmitry Mostovenko commented
Socket activity example:
Process
.getModuleByName({ linux: 'libc.so', darwin: 'libSystem.B.dylib', windows: 'ws2_32.dll' }[Process.platform])
.enumerateExports().filter(ex => ex.type === 'function' && ['connect', 'recv', 'send', 'read', 'write'].some(prefix => ex.name.indexOf(prefix) === 0))
.forEach(ex => {
Interceptor.attach(ex.address, {
onEnter: function (args) {
var fd = args[0].toInt32();
if (Socket.type(fd) !== 'tcp')
return;
var address = Socket.peerAddress(fd);
if (address === null)
return;
console.log(fd, ex.name, address.ip + ':' + address.port);
}
})
})
Got an error:
Error TS2339: Property 'ip' does not exist on type 'SocketEndpointAddress'. Property 'ip' does not exist on type 'UnixEndpointAddress'.
Same for the port
property.
If use JSON.Stringify(address)
got:
{"ip": "0.0.0.0", "port": 0}
for every connection.
Frida 12.8.14
iddoeldor commented
I'm providing an examples which works for me :) you are more than welcome to PR