How to close port in windows

Control port in linux

1
2
3
4
5
6
7
8
9
# status
netstat -anp

# close
iptables -A INPUT -p tcp --drop 8080 -j DROP
iptables -A OUTPUT -p tcp --dport 8080 -j DROP

# open
iptables -A INPUT -ptcp --dport 8080 -j ACCEPT

Control port in windows

1
2
3
4
5
6
7
8
# status
netstat -ano

# find program name
tasklist|findstr "3624"

# kill it
taskkill /f /t /im Dandelion.exe
  1. open control-panel -> manage-tool open local safety policy
    choose Ip safety policy to create a new ip policy.

  2. remove use add guide, click add new rule, then add a new filter.

  3. edit filter properties, src is any ip address, target is my id address.
    in protocol tab, protocol type choose TCP, to this port input 135.

  4. repeat UDP port in [135, 139, 445]
    TCP port in [135, 137, 139, 445, 593, 1025, 2745, 3127, 6129, 3389]
  5. in new rule dialog, the filter operation choose forbidden.
  6. confirm new rule, in ip policy right click rule choose dispatch.
  7. restart computer.