Alister West

home is where your code is ...

Telnet interfaces

HTTP :80

> telnet alisterwest.com 80
GET / HTTP/1.1
Host: alisterwest.com

... OUTPUT ..

HTTP with netcat

# Use netcat to pipe raw html output
> echo "GET /server-admin/index?do=restart_apache;go=go HTTP/1.1
Host: alister.example.com
Cookie: s=4263757f0498ad35442e628576c65e1f

" >  request.http
$ netcat alister.example.com 80 < request.http
<html>...

HTTPS :443

> openssl s_client -connect alister.example.com:443 -state -debug
GET / HTTP/1.1
Host: alisterwest.com

... OUTPUT ..

SMTP :25

> telnet alister.example.com 25
HELO mail.alister.example.com
MAIL FROM: alister@alisterwest.com
RCPT TO: mistermr@example.com
DATA
Subject: Sending from telnet
From: alister@alisterwest.com
this is the message body (sending from telnet).
.
QUIT

SMTP with swaks :25

# Swaks is a smtp testing swiss-army knife.
$ swaks -h example.com -f alister@example.com -t alister@alisterwest.com -s localhost -p 25

MEMCACHED :11211

http://www.alphadevx.com/a/90-Accessing-Memcached-from-the-command-line

stats
STAT pid 23423 ...

stats slabs
STAT 1:chunk_size 88 ...

stats items
STAT items:1:number 1 ...

# stats cachedump [slab ID] [number of items, 0 for all items]
stats cachedump 1 0
ITEM testkey [9 b; 23409234 s] ...

get testkey
VALUE testkey 0 9 ...

MANAGE-SIEVE :4190

Sieve and the accompanying ManageSieve protocol (RFC-5804) are seeking to become a standard for mail filters. I recommend using sieve-connect.pl to manage scripts via commandline eg ./sieve-connect.pl -s localhost -p 4190 -u foo@example.com --authmech PLAIN --nosslverify

# With a local connection we can ignore the TSL connection upgrade.
> telnet localhost 4190

> CAPABILITY
...
"STARTTLS"
"SASL" "PLAIN"
OK "Dovecot ready."

# Plain Simple Auth (SASL) RFC-4616 encode email and password.
# perl -MMIME::Base64 -E '$e=q"postmaster@myexample.com";$p="Password1"; $s=join "\0",$e,$e,$p; say encode_base64($s,"");'
#
> Authenticate "PLAIN" "cG9zdG1hc3RlckBteWV4YW1wbGUuY29tAHBvc3RtYXN0ZXJAbXlleGFtcGxlLmNvbQBQYXNzd29yZDE="
OK "Logged in."

> LISTSCRIPTS
"filters" ACTIVE
OK "Listscripts completed."

> GETSCRIPT "filters"
...    
By Alister West