Port monitor

Just starting out? Need help? Post your questions and find answers here.
Wolf
Enthusiast
Enthusiast
Posts: 234
Joined: Sat Apr 03, 2004 12:00 pm
Location: S.T

Port monitor

Post 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
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

sounds like an advanced task for a beginner.
Have you used pb before?
Wolf
Enthusiast
Enthusiast
Posts: 234
Joined: Sat Apr 03, 2004 12:00 pm
Location: S.T

Post 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.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

hmm. i only know how to see if a port is open.
Wolf
Enthusiast
Enthusiast
Posts: 234
Joined: Sat Apr 03, 2004 12:00 pm
Location: S.T

Post 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.
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post 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
User avatar
Andre
PureBasic Team
PureBasic Team
Posts: 2139
Joined: Fri Apr 25, 2003 6:14 pm
Location: Germany (Saxony, Deutscheinsiedel)
Contact:

Post 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:
Bye,
...André
(PureBasicTeam::Docs & Support - PureArea.net | Order:: PureBasic | PureVisionXP)
Wolf
Enthusiast
Enthusiast
Posts: 234
Joined: Sat Apr 03, 2004 12:00 pm
Location: S.T

Post by Wolf »

Thank you thefool.

Thanks Andre its great.
BongMong
User
User
Posts: 31
Joined: Sat Jan 03, 2004 6:50 pm

Post 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
1300 @ 1450mhz, DDR400, MX440, XP pro / 2000Pro
Wolf
Enthusiast
Enthusiast
Posts: 234
Joined: Sat Apr 03, 2004 12:00 pm
Location: S.T

Post by Wolf »

Very thanks BongMong.

Your source is big help.
PWS32
User
User
Posts: 85
Joined: Sat May 10, 2003 1:02 pm
Location: Germany

Post by PWS32 »

Hi BongMong,

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

Best regards,
Peter
Post Reply