Page 1 of 1

Port monitor

Posted: Sat Apr 03, 2004 12:43 pm
by Wolf
Hi i am beginner and this is my first post :wink:

I want make a port monitor software.( Security soft )

How can i detect one program are access to port and if user want can stop access that program to port?

Very thanks

Posted: Sat Apr 03, 2004 1:50 pm
by thefool
sounds like an advanced task for a beginner.
Have you used pb before?

Posted: Sat Apr 03, 2004 11:43 pm
by Wolf
No full thefool.

I want just know about it .

If exist source code it's big help for me or if not exist, one help for how make this soft.

Thanks.

Posted: Sat Apr 03, 2004 11:51 pm
by thefool
hmm. i only know how to see if a port is open.

Posted: Sun Apr 04, 2004 1:52 pm
by Wolf
thefool wrote:hmm. i only know how to see if a port is open.
It's good for start please tell me.

You or somebody know how close one port or detect what program is access to one port?

Thanks.

Posted: Sun Apr 04, 2004 4:13 pm
by thefool
try to connect to it.
i would ping it and see result.
I dont really 100% know, but try:

InitNetwork()
conid= OpenNetworkConnection("host", 85);host,port
If conid ~ NULL
MessageRequester("","port open")
EndIf

Posted: Sun Apr 04, 2004 8:26 pm
by Andre
@Wolf: Welcome at the forum and here a hint for a "PB Newbie": www.PureArea.net contains are large collection of PB sources in the CodeArchive.... :wink:

Posted: Mon Apr 05, 2004 1:48 am
by Wolf
Thank you thefool.

Thanks Andre its great.

Posted: Mon Apr 05, 2004 9:35 am
by BongMong

Code: Select all

Result = initnetwork()
if Result = 0
Messagerequester("Error","No Connection Found",0)
Endif

;---Strings

Ip$ = "127.0.0.1"

;---Loop

For A=1 To 65536                                                   ;Ports
B = Opennetworkconnection(Ip$,A)                          ;Scanning
if B                                                                        ;If port open
Messagerequester("Scanning","Port open: "+Str(A),0)
endif
next

Posted: Tue Apr 06, 2004 1:16 am
by Wolf
Very thanks BongMong.

Your source is big help.

Posted: Wed Apr 07, 2004 1:06 pm
by PWS32
Hi BongMong,

nice code !, its are little bit slow, please speed up the tests

Best regards,
Peter