Check For Open Relay Using Telnet

Discussion in 'Engineering Concepts' started by pradeep, Aug 22, 2007.

  1. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    Behind the scenes, the commands sent to mail servers are simple text commands. These commands can be to sent to an email server manually via telnet. This is a quick way to test an email server to determine if it is an open relay.

    First, determine the MX for the domain in question, run this command on command prompt:

    nslookup type=mx go4expert.com

    it should return something like:

    Code:
    Non-authoritative answer:
     go4expert.com   MX preference = 10, mail exchanger = ASPMX.L.GOOGLE.com
     go4expert.com   MX preference = 20, mail exchanger = ALT1.ASPMX.L.GOOGLE.com
     go4expert.com   MX preference = 30, mail exchanger = ALT2.ASPMX.L.GOOGLE.com
     go4expert.com   MX preference = 40, mail exchanger = ASPMX2.GOOGLEMAIL.com
     go4expert.com   MX preference = 50, mail exchanger = ASPMX3.GOOGLEMAIL.com
     
     go4expert.com   nameserver = ns1.go4expert.com
     go4expert.com   nameserver = ns2.go4expert.com
     ASPMX.L.GOOGLE.com	  internet address = 209.85.199.27
     ASPMX.L.GOOGLE.com	  internet address = 209.85.199.114
     ASPMX2.GOOGLEMAIL.com   internet address = 209.85.135.27
     ASPMX3.GOOGLEMAIL.com   internet address = 64.233.167.27
    The first five lines tell you about the mail server (MX = Mail Exchange). In this case, ASPMX.L.GOOGLE.com(209.85.199.27) and ALT1.ASPMX.L.GOOGLE.com(209.85.199.114).

    So, armed with this knowledge, in command prompt type

    Code:
    telnet 209.85.199.114 25
    Server should respond with: 220
    HELO

    Server responds with: 250 OK
    MAIL FROM:user@go4expert.com

    Server responds with: 250 Address Ok.
    RCPT TO:user@otherdom.com

    Server responds with: 250 user@otherdom.com OK
    DATA

    Server Responds (or may not): 354 Enter Mail
    Enter message, then on a new line,
    .

    The message should now be sent, if the server does not accept the message its not open relay. By modifying the MAIL FROM and RCPT TO lines, you can test for open relay.
     
  2. rajkumar_singhalmca

    rajkumar_singhalmca New Member

    Joined:
    Aug 22, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    student
    Location:
    bikaner(raj)
    hello,
    i am read this information but you cannot maintain that this service can be use by the l.a.n to w.a.n
     
  3. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    You can, if you have a gateway to the internet!
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice