Skip to content
Smarter by Design.Simpler for Business

sys-cmd telnet ​

sys-cmd telnet is an interactive client that opens a TCP connection to a port of a target from the route table selected in WEB-CLI. It shows instantly whether the connection is established; if it is, every line written is sent to the server and its response is seen on the screen. It is used to check manually whether a backend port is open and what the first response of the service is.

Command Summary ​

TR7 WEB-CLI · sys-cmd telnet
# type telnet and press Tab: a free parameter
admin@TR7LBWAF01> sys-cmd telnet
<telnet-parameter-1>
 
admin@TR7LBWAF01> sys-cmd telnet <target> <port>
admin@TR7LBWAF01>  

Everything written after the word telnet is passed to the tool as it is. There is no mandatory field; the target and the port are written separated by a space.

How It Works ​

SubjectBehavior
ContextThe connection is opened from within the selected v-device and route table.
InteractionIt opens a full terminal session. Everything typed on the keyboard and keys such as Ctrl+C, Ctrl+D and Esc go to the telnet tool, not to the CLI.
ExitWith Ctrl+] the command line of the tool is reached and quit is written. When the server closes the connection, the session ends by itself.
PipeIt cannot be used: "Pipe" operator is not allowed after interactive commands.
RecordingEvery run is written to the user logs; what is written inside the session is not recorded.

Connection Results ​

The message on the screenMeaning
Connected to …The TCP connection was established; the port is open and a service is listening
Connection refusedThe target was reached but there is no service listening on that port
A long wait and a timeoutThe packet may be being dropped on the way or on the target by a firewall

Examples ​

TR7 WEB-CLI · A) The 8080 port of the backend
admin@TR7LBWAF01> sys-cmd telnet 10.20.0.30 8080
admin@TR7LBWAF01>  
TR7 WEB-CLI · B) A manual HTTP request
admin@TR7LBWAF01> sys-cmd telnet 10.20.0.30 80
# after connecting, the two lines below are written, then Enter for an empty line
GET /health HTTP/1.1
Host: app.example.com
admin@TR7LBWAF01>  
TR7 WEB-CLI · C) The greeting line of the mail server
admin@TR7LBWAF01> sys-cmd telnet 10.0.7.25 25
admin@TR7LBWAF01>  

Things to Know ​

  • It connected but the screen is empty. Many services wait for the client to speak first; this is not an error. In protocols such as HTTP the request is written manually.
  • Not suitable for a script. Because it is interactive, its output cannot be filtered or written to a file; for the port state nmap is used, and for the HTTP response curl.
  • Encrypted ports. On ports that use TLS such as 443, the connection is established but the plain text written does not get a meaningful response; for a TLS check sslscan is used.