Connect to telehack.com with TelnetClientExample.java

Q

How to connect to telehack.com with examples.telnet.TelnetClientExample.java program? I want to learn some Unix commands.

✍: FYIcenter.com

A

If you want try to run some commands on a Unix system, you can connect to telehack.com with examples.telnet.TelnetClientExample.java program as shown below:

C:\> java 
   -cp .;C:\local\commons-net-3.5\commons-net-3.5.jar;
   C:\local\commons-net-3.5\commons-net-examples-3.5.jar 
   examples.telnet.TelnetClientExample telehack.com

TelnetClientExample
Type AYT to send an AYT telnet command
Type OPT to print a report of status of options (0-24)
Type REGISTER to register a new SimpleOptionHandler
Type UNREGISTER to unregister an OptionHandler
Type SPY to register the spy (connect to port 3333 to spy)
Type UNSPY to stop spying the connection
Type ^[A-Z] to send the control character; use ^^ to send ^

Connected to TELEHACK port 46

It is 10:37 am on Saturday, November 19, 2016 in Mountain View, California, USA.

There are 42 local users. There are 26632 hosts on the network.

  Type HELP for a detailed command list.
  Type NEWUSER to create an account.

May the command line live forever.

Command, one of the following:
  ?           advent      areacode    basic       bf          cal
  calc        ching       clear       clock       cowsay      date
  echo        eliza       factor      figlet      finger      fnord
  geoip       help        hosts       ipaddr      joke        login
  mac         md5         morse       newuser     notes       octopus
  phoon       pig         ping        primes      privacy     qr
  rain        rand        rfc         rig         roll        rot13
  sleep       starwars    traceroute  units       uptime      usenet
  users       uumap       uupath      uuplot      weather     when
  zipcode     zork        zrun

.joke
I have only myself to blame, I suppose. - Q

.newuser
Read privacy policy? (y/n) n
... (finish registration)

.login someone
.password ******

@ls                                                                                                 
  advent.gam       againstip.txt    changelog.txt    colossus.txt                                   
  command.txt      crackdown.txt    do-well.txt      etewaf.txt                                     
  finger.txt       fnord.txt        future.txt       hammurabi.bas                                  
  johnnycode.txt   k-rad.txt        learncode.txt    leaves.txt                                     
  lem.bas          lostpig.gam      mastermind.bas   notes.txt                                      
  oregon.bas       porthack.exe     privacy.txt      rogue.gam                                      
  rootkit.exe      starwars.txt     sysmon.txt       telehack.txt                                   
  underground.txt  unix.txt         wardial.exe      wumpus.bas                                     
  xmodem.exe       zork.gam                                                                         

@?
Command, one of the following:                                                                      
  ?           areacode    basic       bf          cal         calc                                  
  call        ching       clear       clock       cowsay      date                                  
  df          dial        dir         echo        eliza       factor                                
  figlet      finger      fnord       ftp         geoip       halt                                  
  help        hosts       ipaddr      joke        kill        killuser                              
  link        lock        mac         mail        md5         more                                  
  morse       netstat     notes       octopus     ped         phoon                                 
  pig         ping        primes      privacy     ps          qr                                    
  quest       rain        rand        relay       rfc         rig                                   
  rm          roll        rot13       run         send        set                                   
  show        sleep       starwars    talk        telnet      traceroute                            
  units       uptime      users       uumap       uupath      uuplot                                
  weather     when        zipcode     zrun                                                          

@weather                                                                                            
56f clouds                                                                                          
few clouds                                                                                          
humidity: 93%                                                                                       
wind: 3.6 mph 80 degrees (E)                                                                        
sunset in 1h                                                                                                                                                                                 

@logout
Session closed.

 

Connect to Yahoo Website with TelnetClientExample.java

Connect to FreeChess.org with TelnetClientExample.java

Using commons-net.jar in Java Programs

⇑⇑ FAQ for Apache commons-net.jar

2020-04-10, 4192🔥, 1💬