I haven't used this in a while but the example packet sniffer has stopped working. I have downloaded it again but still no luck.
code:
var xniff = new ActiveXObject( "w00t.Xniff" ); // create the activexobject
xniff.IP = getLocalIp(); // assign your last local IP address, automatically detected (if you want to force a specific ip to listen to, just set it as a string 'XXX.XXX.XXX.XXX')
xniff.Start(); //start monitoring
var etc = function(){ // jscript tricks
function xniff:nData (srcip,srcport,destip,destport,data,datalen){ // event raised by the activexobject when data is available, arguments are obvious i think
if (srcport == '1863') if (datalen > 0) // incoming from port 1863 (msn server)
Debug.Trace('« (' + datalen + ') ' + data); // show in in the debug window
if (destport == '1863') if (datalen > 0) // outcoing packet to msn server
Debug.Trace('» (' + datalen + ') ' + data); // show again
}
}
etc();
function getLocalIp(){ //retrieves your local ip. if there is more than one, the last one is used. thanks Plik for the function
var wmiObj = new ActiveXObject('WbemScripting.SWbemLocator');
var wmiInst = wmiObj.ConnectServer('.', "root\\cimv2");
wmiInst.Security_.ImpersonationLevel = 3;
var col = wmiInst.ExecQuery('Select * from Win32_NetworkAdapterConfiguration');
var colEnum = new Enumerator(col);
var ipAddr;
for (; !colEnum.atEnd(); colEnum.moveNext()){
var objIp = colEnum.item();
var addr = objIp.IPAddress(0);
if((typeof addr == 'string') && addr.match(/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/)){
ipAddr = addr;
}
}
return ipAddr;
}
function OnEvent_Initialize(MessengerStart){}
function OnEvent_Uninitialize(MessengerExit){xniff.Stop();}
Error:
code:
Script is starting
Error: unknown.
Line: 1. Code: -2147024770.
Script has failed to start
any help would be great