HHS En02 Windows and Linux
HHS En02 Windows and Linux
Table of Contents
.'icense for /se0 Information%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + Contributors%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%+%1% Introduction and Ob"ectives%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%2 +%+% 3e4uirements and Setup%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5 +%+%1 3e4uirements%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5 +%+%+ Setup%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5 +%6% System Operation: 7I(8O7S%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%9 +%6%1 !ow to open an MS#8OS window %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%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%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%16
Contri !tors
8aniel <ern=nde> ?leda$ Internet Security @airo !ern=nde>$ 'a Salle /3' ?arcelona @aume bella$ 'a Salle /3' ?arcelona # ISECOM Aim Truett$ ISECOM *ete !er>og$ ISECOM Marta ?arcelB$ ISECOM uditors
"
2#2#2 Set!+
This is the setup in which you are going to work% It consists of your *C$ with access to the Internet$ and the ISECOM !acker !ighschool network$ which you will access through the Internet% This is the network against which you will make most of the tests% (ote that access to the ISECOM test network is restricted% In order to gain access to it$ your instructor must contact the sytem administrator$ as detailed on the www%hackerhighschool%org web site%
2%# (ow the commands and tools listed below can be entered%
tree directory c75%s5 mem rename6 ren source dest co+- source dest move source dest t-+e file more file %e2ete6 %e2 file
8isplay the structure of folders of a path in te&t#graphic format E&le: tree c:Gtools Check a disk and show a status report Show the amount of memory used and free in the system Change the name of files E&le: ren oldname newname Copy one or more files to another location E&le: copy c:GtoolsGmyfile%t&t c:Gtmp Move files and change the name of files and directories E&le: move c:Gtools c:Gtmp Type the content of one or more te&t files E&le: type c:GtoolsGmyfile%t&t 8isplay the information screen by screen E&le: more c:GtoolsGmyfile%t&t 8elete one or more files E&le: del c:GtoolsGmyfile%t&t
(ote: The words in italics are not commands$ and must be replaced by the desired values% Some of the commands can be used by typing either their long version or short versionH for e&le$ IdeleteI and IdelJI are the same command% Tools +in9 host Kerify contact with the machine .host0 The command ping sends IpacketsI using ICM* :Internet Control Message *rotocol; to another computer$ to learn whether it is accessible through the network% In addition$ it shows a statistical summary about the percentage of packets that have not been answered and the response time% The name of the machine can be used directly or its I* address% E&les: ping www%google%com ping 1D6%1-2%E2%+ Some options are: # n (: send ( packets # t: ping the specified host until stopped :press CT3'LC to end; To see more options: ping )h
tracert host
Show the route that packets follow to reach the machine .host0 The command tracert is the abbreviation of trace route$ which allows you to learn the route that a packet follows from the origin$ :your machine; to the destination machine% It can also tell you the time it takes to make each "ump% t the most$ 6, "umps will be listed% It is sometimes interesting to observe the names of the machines through which the packets travel% E&les: tracert www%google%com tracert 1D6%1-2%E2%+ Some options are: # h (: to specify ($ at the most$ "umps% # d: to not show the names of the machines%
i+confi9
To see more options: tracert 8isplay information on the active interfaces :ethernet$ ppp$ etc%; in the computer% Some options: )all: to show more details )renew name: renews connection with .name0 when automatic configuration with 8!C* is used% )release name: deactivates all matching connections when automatic configuration with 8!C* is used%
ro!te +rint
To see more options: ipconfig )M 8isplay the routing table The command route serves to define static routes$ to erase routes or simply to see the state of the routes% Some options: print: to show the list of routes% delete: to delete a route% add: to add a route%
netstat
To see more options: route)M 8isplays information on the status of the network and established connections with remote machines% Some options: #a: To sample all the connections and listening ports #n: to display addresses and port numbers in numeric form #e: to sample Ethernet statistics <or e&le: netstat # an To see more options: netstat)M
<or additional information on these commands and tools type Icommand )hI or Icommand )MJI or Ihelp commandI from a MS#8OS window% <or e&le$ for additional information on the tool netstat$ we have three possibilities: 1; netstat )h +; netstat )M 6; help netstat
$=
8isplay information on the user .user0 E&le: finger root 'ist the content of the directories E&le: ls #la Change from current directory to .directory0% If no directory name is specified it changes to the home directory$ E&le: <or the login name .mylogin0 the command Ncd changes the directory to )home)mylogin E&le: Ncd # changes to the last visited directory E&le: Ncd )tmp
c+ source dest rm file m' source dest m5%ir directory rm%ir directory fin% > 1name file ec7o string command ? file command >> file
man command
changes to the .tmp0 directory Copy files% Copy the file .source0 to the file .dest0% E&le: cp )etc)passwd )tmp 8elete files% Only the owner of the file :or root; can delete it% E&le: rm myfile Move or rename files and directories% E&le: mv oldname newname Make a directory with the name .directory0% E&le: mkdir tools 8elete the directory with the name .directory0 if it is empty% E&le: rmdir tools <ind a file with the name .file0 beginning the search in the root directory E&le: find ) #name myfile 7rite the string .string0 in the standard output E&le: echo hello 3edirect the normal screen output of the command .command0 to the file .file0 E&le: ls O myls 3edirect the normal screen output of the command .command0 to the file .file0% If the file already e&ists$ it appends the output to the end of the file% E&le: ls OO myls Show the pages of the online manual about .command0 E&le: man ls
(ote: The words in italics are not commands and must be replaced by the desired values%
$$
<or additional information on the use of these commands and tools$ type in Icommand #helpI or Iman commandI in the console window% <or e&le$ for additional information on the .ls0 command$ type in either of these two possibilities: 1; ls P#help +; man ls Tools :*lease see the 7indows section for details on these tools%; +in9 host tracero!te host ifconfi9 ro!te netstat Kerify the contact with the machine .host0 E&le: ping www%google%com Show the route that the packets follow to reach the machine .host0% E&le: tracert www%google%com 8isplay information on the active interfaces :ethernet$ ppp$ etc%; 8isplay the routing table 8isplay information on the status of the network E&le: netstat #an
Basic comman% e*!i'a2ences for Win%o0s>Lin!< This is a table showing the basic command e4uivalences between 'inu& and 7indows% Commands are e&ecuted from a shell :in 'inu&; or from a MS#8OS window :in 7indows;% 'inu& command ##help man command cp rm mv mv more$ less$ cat lpr rm #3 ls cd mkdir rmdir route traceroute PI ping ifconfig 7indows command )h$ command )M help command copy del move ren type print deltree dir cd md rd route print tracert ping ipconfig
$2
2#(# E<ercises
2#(#$ E<ercises in Win%o0s
1% Co to a MS#8OS window% +% Identify the version of MS#8OS that you are using% 7hat version have you detectedM 7hat command have you usedM% 6% Identify the date and time of the system% If they are incorrect$ modify them so that they are correct% 7hat command have you usedM -% Identify all the directories and files that are in .c:G0% 7hat command have you usedM 2% Create the directory c:GhhsGlesson,% Copy in this directory all the files with the e&tension .%sys0 that are in .c:G0% 7hat files have you foundM 7hat commands have you usedM 5% Identify the I* address of your host% 7hat command have you usedM 7hat I* address do you haveM 9% Trace the route to .www%google%com0% Identify I*s of the intermediate routers%
2.5.3 Exercise 3
Complete the following table with parallelisms between 7indows and 'inu&% <or e&le: the 'inu& command .command #help0 is e4uivalent to the 7indows
$3
##
$"
@!rt7er )ea%in9
<or an e&tensive glossary of terms visit the following /3's: http:))www%matisse%net)files)glossary%html http:))www%uic%edu)depts)accc)inform)v1,5%html http:))www%catb%org)Qesr)"argon) 7indows P for additional information on commands and tools$ type in Icommand )hI or Icommand )MJI or Ihelp commandI from a MS#8OS window% 'inu& P for additional information on commands and tools$ type in Icommand ##helpI or Iman commandI from a shell%
$(