Script for alerting when an IP address connects to port 3389 of my machine

Source: Internet
Author: User

I know that using IPSEC can only allow access from an IP address. Using netstat-an, you can see that an IP address is accessing port 3389 of my machine, I want to monitor and enable access from an IP address, and then trigger an alarm or input> *. txt...

Can you set up a firewall to allow a single IP address to connect to you by 3389?
Scripts are not omnipotent ......

I just read it. Indeed, windows Firewall can be recorded .. Close thank you...
Here is a work und.
1. Save the following code as a vbs file.Copy codeThe Code is as follows: Set obji = GetObject ("winmgmts: {impersonationLevel = impersonate }! Win32_Service = 'termservice '")
If obji. TotalSessions> 0 then
Wscript. echo "Warning: a remote user connection is in! "
End if

2. Place the above script in the scheduled task and run it every 10 minutes;
3. The principle of this method is very simple. If a user connects to the system, the total number of sessions will be greater than 1. An alarm is reported!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.