Home All Groups Group Topic Archive Search About
Author
11 May 2005 2:33 PM
Bob
Hello folks!

I have a web server and I closed all ports except port 80 for http.

Now I want to add a program to the server that sends emails on certain
events.

Can I write code that will open the email port (I think it's 25) and
then close that port when my email has been sent?

Bob

Author
11 May 2005 4:33 PM
Karl E. Peterson
Bob wrote:
> Hello folks!
>
> I have a web server and I closed all ports except port 80 for http.
>
> Now I want to add a program to the server that sends emails on certain
> events.
>
> Can I write code that will open the email port (I think it's 25) and
> then close that port when my email has been sent?

Sounds like a bit of a bear.  What are you worried about - spammer hijacking?  I'd
choose to open a more obscure outgoing port, such as 2525, and use that instead.
(You control the SMTP server, as well, right?)
--
Working Without a .NET?
http://classicvb.org/petition
Author
11 May 2005 4:53 PM
Bob Sweeney
Using an "obscure" port like 2525 is not a good solution. Hackers use a
loop to look for open ports and simply use any that are open.

I want to be able to open and then close a port after I've sent my
email.

Anybody got a  solution?




*** Sent via Developersdex http://www.developersdex.com ***
Author
11 May 2005 5:09 PM
Karl E. Peterson
Bob Sweeney wrote:
> Using an "obscure" port like 2525 is not a good solution. Hackers use
> a loop to look for open ports and simply use any that are open.

I thought this was an outgoing port.  You seem concerned about inbound issues?  (You
realize you can restrict the direction, as well as the port number, right?)
--
Working Without a .NET?
http://classicvb.org/petition
Author
13 May 2005 3:20 PM
Andrew D. Newbould
In message <eJtLtnkVFHA.2***@TK2MSFTNGP10.phx.gbl>, Bob Sweeney
<go1***@yahoo.com> writes
>
>Using an "obscure" port like 2525 is not a good solution. Hackers use a
>loop to look for open ports and simply use any that are open.
>
>I want to be able to open and then close a port after I've sent my
>email.
>
>Anybody got a  solution?
>

In order for you to achieve the desired effect you would need to be able
to control the firewall blocking the ports in the first place. I don't
know of any such firewall other than writing one yourself (NOT a simple
task).

Just because a Port is Open does not mean that it has to be a threat to
security. The security issue comes from what is listening to that port
and how it handles the incoming data.

As already suggested, you should open an obscure port (most below 8000
are used by some commercial software or system services). While your
software has the port opened other software can't open that same port.
All you have to do in your program is ignore incoming data on that port
(ie: discard it) when you are NOT sending your emails.

If you have a decent firewall or router then you could further restrict
this open port to the 2 machines on your network using it (providing
both have static IP's or course).

Kind Regards,

--
Andrew D. Newbould                  E-Mail:  newsgroups@NOSPAMzadsoft.com

ZAD Software Systems                Web   :  www.zadsoft.com
Author
11 May 2005 5:58 PM
Jeff Johnson [MVP: VB]
"Bob" <Go1***@Yahoo.Com> wrote in message
news:1115822030.130012.44600@g43g2000cwa.googlegroups.com...

> I have a web server and I closed all ports except port 80 for http.
>
> Now I want to add a program to the server that sends emails on certain
> events.
>
> Can I write code that will open the email port (I think it's 25) and
> then close that port when my email has been sent?

Your server should be capable of restricting access to its ports by IP
range. Therefore, you could set it to allow 10.x.x.x (or whatever internal,
private IP range you're using) and disallow everything else.

I realize no one's answering the exact question you've asked, but that's
basically because there are better ways of getting the result you want than
what you've asked to do.

AddThis Social Bookmark Button