Hot Downloads

Welcome, Guest
Username: Password: Remember me

TOPIC: Closing ports...

Closing ports... 13 years 3 weeks ago #1745

  • jwkcu
  • jwkcu's Avatar
  • Offline
  • New Member
  • Posts: 4
  • Karma: 0
Is there a way someone could manually close a port. Command? Program? I do not feel like going through services and shutting them down, instead i want to be able to just shut down the port # itself.
Here smoke this till you can speak my language!
The administrator has disabled public write access.

Re: Closing ports... 13 years 3 weeks ago #1747

  • sahirh
  • sahirh's Avatar
  • Offline
  • Honored Member
  • Posts: 1700
  • Karma: 0
Do you mean a TCP/UDP port ? Which port exactly ? Not all of them are shutdown through services, a lot are opened just by programs that are running (ok now someone will get technical on me and say that services are really just programs). Anyway you can't really just shut a port down..

What happens is when an application wants a port it 'binds' that port and starts listening on it. What you can do is block the port from being accessed, you can use a firewall or a personal firewall like zonealarm (www.zonelabs.com).

Don't just arbitrarily shut down ports unless you know what they do, you might break something. Drop me the port number and I'll give you an idea of what it probably is and how you can shut it down.

On a side note you know whats really fun ? setting up your own little program to listen on that port and just collect whatever data is sent to it.. kind of like a primitive honeypot. Somedays I like to setup netcat to listen on port 80 (HTTP) and when someone connects just send them some data which looks like a webserver answering.. its fun to see what wierd requests you get. I log all the requests to a file and then when I'm done for the day I just look through them. You never know.. you might even capture a new worm like this.

If you want netcat
www.atstake.com/research/tools/network_utilities/

You can set it up as a listener by typing
nc -lp <port> where <port> is the port you want it to bind to.

Wanna know what an HTTP request from your browser looks like ? Setup netcat
nc -lp 80

Then in your browser type 127.0.0.1 and see what data you can see in the netcat window. I got
[code:1]
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\WINDOWS>nc -lp 80
GET / HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shock
wave-flash, */*
Accept-Language: en-us
XXXXXXXXXXXXXXX: XXXXXXXXXXXXX
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Host: 127.0.0.1
Connection: Keep-Alive


C:\WINDOWS>
[/code:1]

Yknow this is actually a very nice way to learn the internal workings of protocols..

Of course that may be far more info than you wanted, I just like to point out interesting experiments you can do with low level networking.. to see what happens when you do day to day things..

Anyone notice how my 'on a side note' always gets longer than the answer itself ?
Sahir Hidayatullah.
Firewall.cx Staff - Associate Editor & Security Advisor
tftfotw.blogspot.com
The administrator has disabled public write access.

Re: Closing ports... 13 years 3 weeks ago #1749

  • jwkcu
  • jwkcu's Avatar
  • Offline
  • New Member
  • Posts: 4
  • Karma: 0
Actually that is exactly what I wanted. Thank you.

By the way, I am currently a student in college majoring in Computer Science and studying System Administration and Networking. I am just being curious about network security and would like to learn whatever more you have to offer.
Here smoke this till you can speak my language!
The administrator has disabled public write access.

Re: Closing ports... 13 years 3 weeks ago #1750

  • tfs
  • tfs's Avatar
  • Offline
  • Expert Member
  • Posts: 521
  • Karma: 0
Sahirh,

OK, services are really just programs.

Feel better now???

Didn't want you to feel unwanted. :lol:
Thanks,

Tom
The administrator has disabled public write access.
Time to create page: 0.078 seconds

CCENT/CCNA

Cisco Routers

  • SSL WebVPN
  • Securing Routers
  • Policy Based Routing
  • Router on-a-Stick

VPN Security

  • Understand DMVPN
  • GRE/IPSec Configuration
  • Site-to-Site IPSec VPN
  • IPSec Modes

Cisco Help

  • VPN Client Windows 8
  • VPN Client Windows 7
  • CCP Display Problem
  • Cisco Support App.

Windows 2012

  • New Features
  • Licensing
  • Hyper-V / VDI
  • Install Hyper-V

Linux

  • File Permissions
  • Webmin
  • Groups - Users
  • Samba Setup