Solved

How do I close Windows port from Command Line?

Posted on 2010-08-24
7
1,109 Views
Last Modified: 2012-05-10
How do I close Windows port from Command Line?
0
Comment
Question by:dennisk1718
7 Comments
 
LVL 3

Expert Comment

by:clw3388
ID: 33511508
netsh will assist you in setting windows firewall exceptions..
http://support.microsoft.com/kb/875357
0
 
LVL 10

Accepted Solution

by:
jorlando66 earned 50 total points
ID: 33511532
From command line

To view ports open through the Windows Firewall
netsh firewall show portopening

To open a specific port from the command line
netsh firewall add

To close a specific port form the command line:
netsh firewall delete
0
 
LVL 10

Assisted Solution

by:jorlando66
jorlando66 earned 50 total points
ID: 33511567
If you are on windows 7 or server2008 use use "netsh advfirewall firewall" instead.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 3

Assisted Solution

by:alexfarias
alexfarias earned 25 total points
ID: 33511597
See if that helps. Just replace "enable the" disable "and Appends the port you want. Save the file as. Bat

@echo Enabling HTTP port 80
netsh firewall set portopening TCP 80 "HTTP"
@echo Enabling SSL port 443
netsh firewall set portopening TCP 443 "SSL"
@echo Enabling port for SQL Server Browser Service's 'Browse' Button
netsh firewall set portopening UDP 1434 "SQL Browser"
@echo Allowing multicast broadcast response on UDP (Browser Service Enumerations OK)
netsh firewall set multicastbroadcastresponse ENABLE
0
 
LVL 3

Expert Comment

by:alexfarias
ID: 33511616
See if that helps. Just replace "enable" for "disable" and Appends the port you want. Save the file as. Bat

@echo =========  disabling unused ports  ==============
@echo Enabling HTTP port 80
netsh firewall set portopening TCP 80 "HTTP"
@echo Enabling SSL port 443
netsh firewall set portopening TCP 443 "SSL"
@echo Enabling port for SQL Server Browser Service's 'Browse' Button
netsh firewall set portopening UDP 1434 "SQL Browser"
@echo Allowing multicast broadcast response on UDP (Browser Service Enumerations OK)
netsh firewall set multicastbroadcastresponse ENABLE
0
 
LVL 23

Assisted Solution

by:Stelian Stan
Stelian Stan earned 25 total points
ID: 33511654
If you want to close port 139

netsh firewall delete portopening TCP 139
0
 
LVL 12

Assisted Solution

by:kadafitcd
kadafitcd earned 25 total points
ID: 33511661
Here's a link for a more in depth look at the netsh commands:  http://technet.microsoft.com/en-us/library/bb490617.aspx

Good Luck HTH.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
cPanel is a Unix based web hosting control panel that provides a graphical interface and automation tools designed to simplify the process of hosting a web site. cPanel utilizes a 3 tier structure that provides functionality for administrators, rese…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now