Archive for January 11th, 2010
Using telnet to access pop3 (retrieve emails) and smtp (send emails)
by z3n on Jan.11, 2010, under Uncategorized
Problem:
How to test retrieve and send emails by raw telnet?
Solution:
Retrieving emails (bold lines are the commands, italics are outputs)
telnet mail.yourserver.com 110
Trying 1.2.3.4…
Connected to mail.yourserver.com.
Escape character is ‘^]’.
+OK Dovecot ready.
user your_email@yourserver.com
+OK
pass your_password
+OK Logged in.
list
+OK 1 messages:
1 1133
.
retr 1
message
.
quit
Sending emails:
telnet mail.youremailserver.com 25
Trying 1.2.3.4…
Connected to mail.youremailserver.com.
Escape character is ‘^]’.
220 youremailserver.com ESMTP Postfix
helo yourdomain.com
250 youremailserver.com
auth login
334 VXNlcm5hbWU6
eW91cmVtYWlsQHlvdXJkb21haW4uY29t (youremail@yourdomain.com base64 encoded)
334 UGFzc3dvcmQ6
eW91cnBhc3N3b3Jk (yourpassword base64 encoded)
235 2.0.0 Authentication successful
mail from:youremail@yourdomain.com
250 2.1.0 Ok
rcpt to: someone@somedomain.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
subject: test
hi
.
250 2.0.0 Ok: queued as 8B65ED40075
quit
Note that there’s many different authentication protocols, base64 is the less secure one, some servers may require a better authentication mechanism, or even use an ecrypted port, which will not work with telnet, try open ssl instead.
Port Scan on Linux
by z3n on Jan.11, 2010, under Uncategorized
Problem:
How to do a port scan on a specific ip/hostname on linux?
Solution:
nc -z <ip> <port-range>
eg.: nc -z 127.0.0.1 1-1024
Source: