| | |
Code to monitor port 135 on windows OS
![]() |
•
•
Join Date: Mar 2005
Posts: 10
Reputation:
Solved Threads: 0
I'am trying to develop a notification program to notify user on my
network that their computer have a worm . The program that I want to develop a can monitor port 135 on windows OS . The system will monitor port 135 on one computer and see wheter there is a computer that tried to connect to this computer by using that port . If there is a computer that trying to connect by using this port , the program will notify a user that their computer maybe have a worm .
From your opinion , what programming technique that suitable for this program . Is there anybody can guide me in developing this program . Thank you very much
network that their computer have a worm . The program that I want to develop a can monitor port 135 on windows OS . The system will monitor port 135 on one computer and see wheter there is a computer that tried to connect to this computer by using that port . If there is a computer that trying to connect by using this port , the program will notify a user that their computer maybe have a worm .
From your opinion , what programming technique that suitable for this program . Is there anybody can guide me in developing this program . Thank you very much
Well, You will need to use sockets..., and build a server program that listens on that port. I can code such a program, in VB6, but I don't have .NET, nor do I use it enough to know how sockets work in it. But, I will tell you that creating a socket on that port for listening is the way to go about doing what you would like.
•
•
Join Date: Mar 2005
Posts: 10
Reputation:
Solved Threads: 0
thanks for reply me .
Actually I'am a beginner in VB . Is there any major different in VB6 and VB.net . If it is possible in writing the code in VB6 can you guide me on writing this code .
Can you explain more about socket programming . Is there any programming technique that I should learn if I want to write a code for socket/port listening.
Actually I'am a beginner in VB . Is there any major different in VB6 and VB.net . If it is possible in writing the code in VB6 can you guide me on writing this code .
Can you explain more about socket programming . Is there any programming technique that I should learn if I want to write a code for socket/port listening.
Do you have a copy of VB6, or just VB.Net? They are the same basic syntax, but the languages are completely different. There is still arguments and fuss about which is better and if vb6 is phasing out. I am a VB6 Advocate, And I don't much care for .NET, that it requires an installation of an entire platform. A good google search of sockets and VB (whichever one you choose) will give you a whole lot of good info. I prefer to use the catalyst socketwrench control: http://www.catalyst.com. I have no problem coding a small server app in VB6 with comments if you choose the VB6 route. If VB.Net is your option (maybe due availability) I can find a ton of resources to help you out. Let me know.
•
•
Join Date: Mar 2005
Posts: 10
Reputation:
Solved Threads: 0
i'am so sorry . I dont know that vb6 and vb.net have a major different . I actually have VB 6.0 . Can I continue asking this question in VB.NET forum although i want to use vb6 as my programming technique . I'm really sorry about this .
Can you explain more about catalyst socketwrench control . As far as I know catalyst socketwrench control is a complete software . Is there possible to write a vb6.0 code that will monitor certain port and inform if there is any computer that want to connect to this computer by using that port . Can you please teach me in writing the code .
Can you explain more about catalyst socketwrench control . As far as I know catalyst socketwrench control is a complete software . Is there possible to write a vb6.0 code that will monitor certain port and inform if there is any computer that want to connect to this computer by using that port . Can you please teach me in writing the code .
Ok,
I have written, and commented a server written in VB6 with catalyst socketwrench. This program listens on port 135 for a connection. If it recieves a connection, it accepts the connection momentarily (long enough to grab the IP and the Hostname), then immediately disconnects. It Writes The Date, Time, IP Address and Hostname of the computer that tried to make the connection to a log file, and displays a "notification" window similar to that of MSN Messengers Notification window (when you recieve an IM, or someone logs on). I have attached and Included the needed socket control, the complete and commented source code, along with a zip file that contains an installation program should you feel more comfortable using it instead of compiling it yourself.
Now, Be Advised that this program will not work in windows XP as long as you have other programs that listen on port 135. This is the procedure that I had to follow in order to make sure that this program would listen on port 135 (otherwise, you'll get an error that says something along the lines of: this address is already in use). In XP Home edition:
Click Start
Click Run
Type in: services.msc
Then in the pane on the right, find: Distributed Transaction Coordinator
Right click on it, and choose properties, and set "Startup Type" to disabled.
and Hit ok. Do the same thing for:
TCP/IP NetBIOS Helper
Task Scheduler
and
Routing and Remote Access
Then you close out of services.
Then go to start again, run, type in: regedit
Once you are in the registry, on the left pane, open:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc
Highlight Rpc, (the folder). Then on the right, doubleclick "DCOM Protocols"
and remove the line: ncacn_tcp, and make sure to move everything up a line if it's needed, then OK that window. Now, back to the left, to the folders. Open up Rpc, and there should be a folder called: ClientProtocols. Open that one up, and on the right, find and delete: ncacn_tcp, and ncadg_udp. Reboot Your computer, and port 135 should be closed, and able to run the server program I wrote.
However, Before you do ANY OF THAT, I want you to make a backup of your registry. Save it somewhere you won't lose it. You back up the registry, as follows:
click start, go to run
type in: regedit
click "file", then "Export"
At the bottom where it says "Export Range" set it to "all"
Find somewhere to save it, and give it a name. The registry is now backed up.
I realize that's a little bit complicated, so let me know if you need any additional help with disabling the services that windows has running on port 135.
Ps: Sorry about that, I tried to upload the source, AND a setup program... but for some reason I could only get the source to upload. If you need help compiling it, or getting it to load, just let me know.
I have written, and commented a server written in VB6 with catalyst socketwrench. This program listens on port 135 for a connection. If it recieves a connection, it accepts the connection momentarily (long enough to grab the IP and the Hostname), then immediately disconnects. It Writes The Date, Time, IP Address and Hostname of the computer that tried to make the connection to a log file, and displays a "notification" window similar to that of MSN Messengers Notification window (when you recieve an IM, or someone logs on). I have attached and Included the needed socket control, the complete and commented source code, along with a zip file that contains an installation program should you feel more comfortable using it instead of compiling it yourself.
Now, Be Advised that this program will not work in windows XP as long as you have other programs that listen on port 135. This is the procedure that I had to follow in order to make sure that this program would listen on port 135 (otherwise, you'll get an error that says something along the lines of: this address is already in use). In XP Home edition:
Click Start
Click Run
Type in: services.msc
Then in the pane on the right, find: Distributed Transaction Coordinator
Right click on it, and choose properties, and set "Startup Type" to disabled.
and Hit ok. Do the same thing for:
TCP/IP NetBIOS Helper
Task Scheduler
and
Routing and Remote Access
Then you close out of services.
Then go to start again, run, type in: regedit
Once you are in the registry, on the left pane, open:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Rpc
Highlight Rpc, (the folder). Then on the right, doubleclick "DCOM Protocols"
and remove the line: ncacn_tcp, and make sure to move everything up a line if it's needed, then OK that window. Now, back to the left, to the folders. Open up Rpc, and there should be a folder called: ClientProtocols. Open that one up, and on the right, find and delete: ncacn_tcp, and ncadg_udp. Reboot Your computer, and port 135 should be closed, and able to run the server program I wrote.
However, Before you do ANY OF THAT, I want you to make a backup of your registry. Save it somewhere you won't lose it. You back up the registry, as follows:
click start, go to run
type in: regedit
click "file", then "Export"
At the bottom where it says "Export Range" set it to "all"
Find somewhere to save it, and give it a name. The registry is now backed up.
I realize that's a little bit complicated, so let me know if you need any additional help with disabling the services that windows has running on port 135.
Ps: Sorry about that, I tried to upload the source, AND a setup program... but for some reason I could only get the source to upload. If you need help compiling it, or getting it to load, just let me know.
•
•
•
•
Originally Posted by amuarica
The code work well . you are a great programmer , Comatose.
but can you explain to me about serversock function . i have a book about visual basic 6 and it doesnt even mention about serversock . where can i find a source that will explain about serversock ?
![]() |
Similar Threads
- Code to monitor port 135 on windows OS (Existing Scripts)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: debugging word 2003 vba macros
- Next Thread: Help on How to make a DATA TREE
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






