[======================> SWAT MAGAZINE ISSUE 27 <======================] [=============> Guide to the UNIX command line - PART 3 <==============] [==============> Written by qwaszx <==============] As promised, the next article in the series on the UNIX command line. A bit late maybe, but here anyway. Enjoy... -==[ Telnet ]==- This command is used to connect to another system, and is also one of the main ways to connect to a Unix shell account. Usage: telnet eg. telnet sdf.lonestar.org (sdf is a free shell account provider, ueful if you want to learn unix) Usually, you would telnet to port 23 (the telnet port) to access a system, but we hackers may use telnet to connect to a variety of ports when hacking (eg. port 25 for sendmail) -==[ ping ]==- Used to see if a host is alive. Usage: ping example: ping www.microsoft.com This will reply if the microsoft web server is running, which it will be unless some l33t h4x0r has took it down (in which case way to go guys! :-) ) Press CTRL-C to exit ping (or it will repeatedly ping a server forever!) To find out what options are available for ping, type in ping -? (the options vary from system to system so I won't go into them here. However, there is one option, available on a number of systems, flood ping, which repeatedly pings a host as fast as possible, and can eat up all of the hosts bandwidth (network availability) and take them down, but only if your host is faster (ie. it wont work if you are on a modem) -==[ Write ]==- Write is used to send messages to other users on the same unix system. Usage: write eg. write qwaszx ttyp0 The tty option is used when the user is logged on more than once and you want to send the message to a paerticular screen. Use the w or who command to find out which tty to use. To exit a write session, press CTRL-D or CTRL-C. Simple DoS using write: cat /dev/urandom | write [username] This will pipe random data through the write command, and consequently onto another users terminal, forcing them to log off. 90% of the time, this can be traced however, and to protect yourself from this attack, you only need to type in "mesg n" (See the mesg command below). -==[ Talk ]==- Talk allows an interactive chat session between two users who don't have to be on the same system. Usage: talk or simply: talk The other user will get a message on screen telling him to use the same command to talk to you. Once connected, anything you type will be shown on the other users screen. To end talking, press CTRL-C. -==[ Mesg ]==- Sometimes, you may not want to be disturbed by talk's and write's. The mesg commnd allows you to refuse all incoming wries and talks. Usage: mesg Mesg on its own will tell you what your current write status is. To see what other users' write permissions are, type in 'who -w'. The user will have a + next to their name if you can talk to them, or a - next to their name if you can't. -==[ Ftp ]==- Ftp is used to transfer files between hosts. Its main use with shell accounts is to upload your web page or other files. Usage: ftp example: ftp ftp.kernel.org Once this is done the client will ask you to enter in a username. Following the above example, type in anonymous and press Enter. If you are uploading files to your own shell account then you would enter in your own username. Then, you will get asked for your password. This will be the same as you use for your shell account, or if you logged in as anonymous, your email address (I usually put in any email address - moo@cowpat.com or something for anonymity) Then you will be logged into the FTP serer. Use the ls and cd commands as in a normal unix command line to navigate the directories. To transfer a file, you use the get and put commands (get to download, put to upload). eg. get readme.txt To change the current directory that you download to and upload from, type in lcd (for 'local change directory'). There is one thing to note about FTP, and that is Binary or Ascii transfer... Usually, there is a command called "binary" to make the file transfer in binary mode, and "ascii" to make it transfer in ascii mode. To decide which one to use, use this simple rule: Text File --> ASCII Program ("Binary Files") --> Binary Archive (zip, tgz etc.) --> Binary Unsure (anything else) --> Binary If you use the your files will become corrupted, so be careful. -==[ NetCat (or nc) ]==- The Hacker's Power Tool.... This very useful program will act like telnet to connect to a host, and also work with UDP ports (Something telnet can't do), and listen on ports for incoming connections. It has tonnes of options for you, and lots of uses from Trojans, to portscans, to acting as a server, to simple telnet. There is so much that netcat can do that I wont even try to document it here, and I'm going to refer you to the Readme file and man page that comes with netcat itself. NOTE: netcat is also available for windows NT for all you windoze people. Usage: nc options -==[ Wrap Up ]==- There are literally hundreds of networking programs available for unix, and this article has only shown you the basic information needed to get you started. Unix (and linux in particular) was created with networking as a priority (Linux was after all developed all over the world via the internet) Next month I intend to continue this tutorial with more unix help for you all. Until then......... --- Written by qwaszx for SWAT Magazine Send comments, suggestions, praise to Send Flames to Standard disclaimer applies - I am not reponsible for what you do with this information, and for any inaccuracies. blah.. blah.. blah......