Site Map - skip to main content

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes every weekday Monday through Friday.
This page was generated by The HPR Robot at


hpr3338 :: Using openssl s_client like telnet

OpenSSL s_client is the new telnet. Here is how to use it.

<< First, < Previous, , Latest >>

Hosted by Klaatu on Wednesday, 2021-05-19 is flagged as Clean and is released under a CC-BY-SA license.
telnet, openssl. (Be the first).
The show is available on the Internet Archive at: https://archive.org/details/hpr3338

Listen in ogg, spx, or mp3 format. Play now:

Duration: 00:19:49

Networking.

This series will try and explain the basics of networking to the listener as well as introduce more detailed topics.

Connect to port 443 and send some HTTP signals:


$ openssl s_client -connect example.com:443
    [...snip...]
    Verify return code: 0 (ok)
    Extended master secret: no
    Max Early Data: 0
---

You're now connected. If you wait too long, your connection will likely time out. View the default landing page of the site you've connected with:


GET / HTTP/1.1
HOST: example.com

In return, you get a dump of the HTML source of the default page (usually index.html) in your terminal.

You can also use OpenSSL s_client for email servers using SSL. Before you can send credentials, you must encode your email username and passphrase into Base64. The easiest method I know is this Perl one-liner:


$ perl -MMIME::Base64 -e 'print encode_base64("myUserName");'
$ perl -MMIME::Base64 -e 'print encode_base64("myPassPhrase");'

Take note of the results.

The s_client session, aside from authentication, is basically the same as a telnet session. You can find good telnet tutorials all over the Internet, and aside from sending your credentials, they apply to s_client.

Here's a copy-paste of an example session:


$ openssl s_client -starttls smtp -connect email.example.com:587
> ehlo example.com
> auth login
##paste your user base64 string here####
##paste your password base64 string here####

> mail from: noreply@example.com
> rcpt to: admin@example.com
> data
> Subject: Test 001
This is a test email.
.
> quit

Comments

Subscribe to the comments RSS feed.

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Title:
Comment:
Anti Spam Question: What does the letter P in HPR stand for?
Are you a spammer?
Who is the host of this show?
What does HPR mean to you?