Advertisement
Guest User

Untitled

a guest
Jan 20th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. [TELNET] SMTP
  2. =============
  3.  
  4. ### Connect to the server
  5.  
  6. ```
  7. $ telnet <servername_or_ip> <port>
  8. ```
  9.  
  10. *(Default port : 25)*
  11.  
  12.  
  13. ### Polite people says Hello first
  14.  
  15. ```
  16. > EHLO <servername>
  17. ```
  18.  
  19. ### Authentification
  20.  
  21. First encode username and password in B64:
  22.  
  23. ```
  24. $ perl -MMIME::Base64 -e 'print encode_base64("<username>");'
  25. $ perl -MMIME::Base64 -e 'print encode_base64("password");'
  26. ```
  27.  
  28. Then inside the telnet
  29.  
  30. ```
  31. > AUTH LOGIN
  32. ```
  33.  
  34. The server return:
  35.  
  36. ```
  37. > 334 VXNlcm5hbWU;
  38. ```
  39.  
  40. ***B64 encoded string asking for username***
  41.  
  42. Paste the base64 encoded username:
  43.  
  44. ```
  45. > dXNlcm5hbWU=
  46. ```
  47.  
  48. Then the server return:
  49.  
  50. ```
  51. > 334 UGFzc3dvcmQ6;
  52. ```
  53.  
  54. ***B64 encoded string asking for password***
  55.  
  56. Paste the B64 encoded password:
  57.  
  58. ```
  59. > cGFzc3dvcmQ=
  60. ```
  61.  
  62. Now the server should return:
  63.  
  64. ```
  65. > 235 Authentication succeeded
  66. ```
  67.  
  68. ### Define Sender
  69.  
  70. ```
  71. > MAIL FROM:<sender@domain.tld>
  72. ```
  73.  
  74. The server should return:
  75.  
  76. ```
  77. > 250 2.1.0 Ok
  78. ```
  79.  
  80. ***Warning : Even if the sender is wrong or not authorized the server always return Ok, because the checking is done with both sender and recipient***
  81.  
  82. ### Define Recipient
  83.  
  84. ```
  85. > RCPT TO:<recipient@domain.tld>
  86. ```
  87.  
  88. The server should return:
  89.  
  90. ```
  91. > 250 2.1.0 Ok
  92. ```
  93.  
  94. ### Insert DATA
  95.  
  96. ```
  97. > DATA
  98. ```
  99. The server return:
  100.  
  101. ```
  102. > 354 End data with <CR><LF>.<CR><LF>
  103. ```
  104.  
  105. Enter actual mail content:
  106.  
  107. ```
  108. > From: sender@example.com
  109. > To: recipient@example.com
  110. > Subject: Test message
  111. > Reply-to: sender@example.com
  112. > This is a test message.
  113. ```
  114.  
  115. Then press enter, a dot then enter again:
  116.  
  117. ```
  118. > 250 2.6.0 Queued mail for delivery
  119. ```
  120.  
  121. Disconnect
  122.  
  123. ```
  124. > QUIT
  125. ```
  126.  
  127. The server return :
  128.  
  129. ```
  130. > 221 <servername> ESMTP <serverbannner> closing connection
  131. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement