Jump to content

Recommended Posts

Posted

You do this in your script after you pull _GetExtendedTcpTable() function out (pseudo):

$aArrayOfData = _GetExtendedTcpTable()
; ...check for errors here

For $i = 1 To UBound($aArrayOfData) - 1
    If $aArrayOfData[$i][3] = -that what you use To idetify the connection - Then
        $sConnectionState = $aArrayOfData[$i][0]
        ExitLoop
    EndIf
Next

If $sConnectionState = "ESTABLISHED" Then ; or whatever
    ;Do Something
Else
    ;Do something else
EndIf

Thx,

I want this to run in background not through the complete GUI. How should I do this? I don't need the complete GUI overhead but dunno what to strip and what not.

"-that what you use To idetify the connection -" is that in my case : mDNS;5355?

The more you learn, the less you know.

Posted

Thx,

I want this to run in background not through the complete GUI. How should I do this? I don't need the complete GUI overhead but dunno what to strip and what not.

"-that what you use To idetify the connection -" is that in my case : mDNS;5355?

I meant $aArrayOfData[$i][] instead of $aArrayOfData[$i][3]

You probably got that.

You are asking a basic stuff about what to strip. I'm not gonna help you with that.

♡♡♡

.

eMyvnE

Posted

Roger that.

One last one though, I know that I have to check if the UDP port 5355 is used. Where is that stored in which array?

thx.

The more you learn, the less you know.

Posted (edited)

Roger that.

One last one though, I know that I have to check if the UDP port 5355 is used. Where is that stored in which array?

thx.

_GetUdpTable() should be just fine.

If not for some reason then _GetExtendedUdpTable().

Edited by trancexx

♡♡♡

.

eMyvnE

  • 3 weeks later...
Posted

This is good. Tried in in 32bit windows 7 and 64bit Vista. no problems....so far. if it works for 64 bit vista then I would expect to be OK in Windows 7 64 bit. I will upgrade soon. However, there is a TCPView from sysinternal which is fine in all versions of windows. You have the code for me to add to that TCPview does not have....so far. Good job.

Dr SherlockAlways a way

  • 2 weeks later...
  • 2 months later...
Posted

:mellow:

I have a remote WMI query working for bytes sent, but want to check for ports opened..

Is this any use or interest to you?

#include <GUIConstants.au3>
#include <WindowsConstants.au3>

GUICreate("Based on Lod3n's Bandwidth Monitor:",220,100,0,0,-1,$WS_EX_TOOLWINDOW)

$label1 = GUICtrlCreateLabel ( "Waiting for data...", 10, 5,200,20)
$label2 = GUICtrlCreateLabel ( "Waiting for data...", 10, 50,200,20)

GUISetState ()

$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$colItems = ""
;$strComputer = "localhost"
$strComputer = "remotehost"
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")

while 1
    $colItems = $objWMIService.ExecQuery("SELECT BytesReceivedPersec,BytesSentPersec FROM Win32_PerfRawData_Tcpip_NetworkInterface", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
    If IsObj($colItems) then
        For $objItem In $colItems
   ToolTip($objItem.Name, 0, 0)
  ; sleep (1000)
        ;   If $objItem.Name = "ADAPTER NAME HERE" Then ;MUST PUT ADAPTER NAME HERE
                $in = $objItem.BytesReceivedPersec
                $out = $objItem.BytesSentPersec
   
                $intext = "Bytes In: " & $in & @CRLF
                $outtext = "Bytes Out: " & $out &@CRLF

                GUICtrlSetData ($label1,$intext)
                GUICtrlSetData ($label2,$outtext)
        ;   EndIf
        Next
    EndIf
    sleep(100)
    If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
Posted

Well no.

WMI solution depends on one particular service running. That service can easily be shut off or disabled or whatever. I don't consider WMI solution reliable unless there is absolutely no other way of getting precious informations (there are few cases unfortunately).

♡♡♡

.

eMyvnE

  • 2 months later...
Posted

Seemed like a good idea to follow the development of the AutoIt and make use of some new features and maybe data types.

New script is in the first post.

...

It's hard to get a grip of some code if there are little comments, even if it's AutoIt. I dare to say it's almost as hard as with opcodes. You wouldn't agree? :mellow:

Anyways, find the easter egg. I plant one often in my scripts but hardly anyone ever find them. Variation of this one was seen before, but never mind. Fun is fun. Ahh, I'm talking too much.

♡♡♡

.

eMyvnE

Posted

Anyways, find the easter egg. I plant one often in my scripts but hardly anyone ever find them. Variation of this one was seen before, but never mind. Fun is fun. Ahh, I'm talking too much.

Msgbox(0,"",BinaryToString("0x596F75206469642C20616E6420612066696E65206A6F6220697420697320746F6F21"))

  • 1 year later...
Posted

push... nice job ... I ve a problem and parts of this tool include the solution... sadly I am to lame to rip out what I need.

I hope someone can help me ... what I need is a function (parameter is a process) that fills me an 2D array with:

1. ips the process is connected with

2. the port

3. the type (udp/tcp)

I would be glad if someone could help me. thanx in advance!

  • 1 year later...
  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...