|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Open a Port.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 Bob wrote:
> Hello folks! Sounds like a bit of a bear. What are you worried about - spammer hijacking? I'd> > 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? choose to open a more obscure outgoing port, such as 2525, and use that instead. (You control the SMTP server, as well, right?) 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 *** Bob Sweeney wrote:
> Using an "obscure" port like 2525 is not a good solution. Hackers use I thought this was an outgoing port. You seem concerned about inbound issues? (You> a loop to look for open ports and simply use any that are open. realize you can restrict the direction, as well as the port number, right?) In message <eJtLtnkVFHA.2***@TK2MSFTNGP10.phx.gbl>, Bob Sweeney
<go1***@yahoo.com> writes > In order for you to achieve the desired effect you would need to be able >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? > 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 "Bob" <Go1***@Yahoo.Com> wrote in message Your server should be capable of restricting access to its ports by IP 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? 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. |
|||||||||||||||||||||||