home *** CD-ROM | disk | FTP | other *** search
/ Hackers Toolkit v2.0 / Hackers_Toolkit_v2.0.iso / HTML / archive / Texts / hacking / hackunix.txt < prev    next >
Text File  |  1999-11-04  |  41KB  |  1,073 lines

  1.      /|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\/|\
  2.      \|/                                                      \|/
  3.      /|\                                                      /|\
  4.      \|/        An Indepth Guide in Hacking UNIX and the      \|/ 
  5.      /|\           concept of Basic Networking Utility        /|\
  6.      \|/        ----------------------------------------      \|/
  7.      /|\                   By:Red Knight                      /|\
  8.      \|/        Phreakers/Hackers Underground Network         \|/
  9.      /|\                                                      /|\
  10.      \|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/\|/
  11.  
  12. Brief history on UNIX
  13. ----------------------
  14. Its because of Ken Tompson that today were able to Hack Unix.He used to work
  15. for Bell Labs in the 60s.Tompson started out using the MULTICS OS which was
  16. later eliminated and Tompson was left without an operating system to work with.
  17. Tompson had to come up with something real quick.He did some research and
  18. and in 1969 UNIX came out,which was a single user and it didn't have
  19. many capabilities.A combined effort with others he rewrote the version
  20. in C and added some good features.This version was out in 1973 and was
  21. available to the public.This was the first begining of UNIX as its known      
  22. presently.The more refined version of UNIX,today know as UNIX system V      
  23. developed by Berkley University has unique capabilities.
  24. Various types of UNIXes are CPIX,Berkeley Ver 4.1,Berkeley 4.2,FOS,Genix,HP-UX,
  25. IS/I,OSx,PC-IX,PERPOS,Sys3,Ultrix,Zeus,Xenix,UNITY,VENIX,UTS,Unisys,Uniplus+,
  26. UNOS,Idris,QNIX,Coherent,Cromix,System III,System 7,Sixth edition.
  27.  
  28. The article it self:
  29. --------------------
  30. I believe that hacking into any system requires knowledge of the Operating
  31. system itself.Basically what I will try to do is make you more familiar with
  32. UNIX  operation ,its usefull commands that will be advantageous to you as a  
  33. hacker.This article contains in depth explainations.                      
  34.  
  35. Error Messages that one may came across:[UNIX system V]
  36. ----------------------------------------
  37. Login incorrect - An ivalid ID and/or pw was entered.This means nothing.
  38.                   In UNIX there is no way guessing valid user IDs.You may     
  39.                   come across this one when trying to get in.
  40. No more logins - will happens when the system wont accept anymore logins
  41.                  could be going down            
  42. Unknown Id - will happen if an ivalid id is entered using (su) command
  43. Unexpected eof in file - The file being stripped file has been damaged
  44. Your password has expired - This is quiet rare although there have been cases
  45.                             where it happened.Reading the etc/passwd will
  46.                             show you at how many intervals it changes.
  47. You may not change the password - The password has not yet aged enough.The
  48.                                   Administrator set the quotas for the users
  49. Unknown group [groups name] - occurs when chgrp is executed ,group doesn't
  50.                               exist
  51. Sorry - Indicated that you have typed in an invalid super user password(execu-
  52.         tion of the su)
  53. Permission denied!- Indicated you must be the owner or a super user to change
  54.                     password.
  55. Sorry <[# of weeks] since last change - This will happen when password has    
  56.                                         has not aged enough and you tried to
  57.                                         change it(passwd)
  58. [directory name]:no permission - You are trying to remove a directory which
  59.                                  you have no permission to.
  60. [file name] not removed - trying to delete a file owned by another user
  61.                           that you dont have write pemision for. 
  62. [dirname] not removed - ownership of the dir is not your that your trying to  
  63.                         delete. 
  64. [dirname] not empty - the directory contains files so you must have to delete
  65.                       the files before executing the rmdir 
  66. [command] not found - you have entered an ivalid command not know to UNIX
  67. cant execute pwd - some thing wrong with the system cant execute pwd command
  68. cannot chdir to .. -   (.. one level up) permision is required to execute pwd
  69.                        above the current directory
  70. cant open [file name] - defined wrong path,file name or you have no read
  71.                         permission
  72. cp:[file name] and [file name] are identical - self explanatory  
  73. cannot locate parent directory - occurs when using mv
  74. [file name] not found - file which your trying to move doesn't exsist
  75. You have mail - Self explanatory
  76.  
  77. Basic Networking Utility error messages
  78. ---------------------------------------
  79. cu:not found - networking not installed
  80. login failed - invalid id/pw or wrong # specified
  81. dial failed - the systen never answered due to a wrong #
  82. uucp completely failed - did not specify file after -s
  83. wrong time to call - you called at the time at a time not specified in the
  84.                      Systems file
  85. system not in systems - you called a remote not in the systems file
  86.  
  87. Logon format : first thing one must do is switch to lower case
  88. --------------
  89. Identifing a UNIX.Here is what you'll see:
  90. Some times there will be no system identifer
  91.                              
  92. AT&T UNIX SysVR3.0 (eg of a system identifier)
  93.  
  94. login:
  95.  or
  96. Login:
  97.  
  98. Any of these is a UNIX.Here is where you will have to guess at a user valid
  99. id.Here are some that I have come across eg( glr,glt,radgo,rml,chester,cat,
  100. lom,cora,hlto,hwill,edcasey and also some containing numbers smith1,mitu6 or
  101. special characters in it like bremer$,j#fox.Login names have to be 3 to 8
  102. chracters in lenght lowercase and must start with a letter.In some XENIX
  103. systems one may login as "guest"
  104.  
  105. User level accounts:(lower case)
  106. -------------------- 
  107. In Unix they have whats called accounts .These
  108. accounts can be used at the "login:" prompt.
  109. Here is a list:
  110.  
  111. sys
  112. bin
  113. trouble
  114. daemon
  115. uucp
  116. nuucp  
  117. rje
  118. lp
  119. adm
  120. listen - if starlan is installed
  121.  
  122. Super-user accounts:
  123. --------------------
  124. And then there are super-user login which make UNIX worth hacking.   
  125. The accounts are used for a specific job. In large systems these logins
  126. are assingned to users who have a responsibilty to maintain subsystems.
  127.  
  128. They are as follows :(all lower case)
  129.  
  130. root       -  this is a must the system comes configured with it.It has no
  131.               restriction.Has power over every other account.
  132. unmountsys -  unmounts files
  133. setup      -  system set up
  134. makefsys   -  makes a new file
  135. sysadm     -  allows useful S.A commands(doesn't need root login)
  136. powerdown  -  powering system down
  137. mountfsys  -  mounts files
  138. checkfsys  -  checks file
  139.  
  140. These accounts will definitly have passwords assigned to them.These
  141. accounts are also commands used by the system administrator.
  142.  
  143. Here are some examples of accounts I have seen:
  144.  
  145. cron         uuhelp     usenet
  146. anonuccp     news       network
  147. bellboy      lp         vector
  148. guest        games      ninja
  149. vote         warble     sysinfo
  150.  
  151.  
  152.  
  153. After the login prompt you will receive a password prompt:
  154.  
  155. password:
  156.   or
  157. Password:
  158.     
  159. Enter the password (it wont echo).The password rule is as follows:Each pw
  160. has to contain at least 6 characters and maximum has to be 8 .Two of which are
  161. to be alphabetic letters and at least one being a number or a special character
  162. The alphabetic digits could be in upper case or lower case.Here are some of the
  163. passwords that I have seen (eg.Ansuya1,PLAT00N6,uFo/78,ShAsHi..,Div417co)
  164.  
  165. The passwords for the super user accounts will be difficult to hack
  166. try  the accounts interchangebly eg.login:sysadm password:makefsys or rje1,
  167. sysop,sysop1,bin4 or they might contain letter,numbers,special chracters in
  168. them.It could be anything.The user passwords are changed by an aging proccess
  169. at successive intervals.The users are forced to changed it.The super-user
  170. will pick a password that wont need changing for a long period of time.
  171.  
  172. You have made it! 
  173. ----------------- 
  174. The hard part is over and hopefully you have hacked a super-user account.
  175. Remember Control-d stops a process and also logs you off.
  176. The next thing you'll probably see is the system news
  177. eg.
  178.  
  179. login:john 
  180. password:hacker1        
  181. System news                 
  182. There will be no networking offered to the users till
  183. august 15,due to hardware problems.             
  184. (just an example)
  185.  
  186. $
  187.  
  188. $ is the Unix prompt -waiting for a command to be entered.I will use this
  189.                       throught the article to show outouts etc..(Its not
  190.                       part of the command)
  191. # - means your logged in as root(very good)
  192.  
  193. A word about the XENIX System III:(run on the tandy 6000)
  194. ---------------------------------                  
  195. The largest weakness in the XENIX System III occurs after the installation
  196. of the Profile-16 or more commonly know as the filepro-16.I have seen the     
  197. filepro-16 installed in many systems.          
  198. The installation process creates an entry in the password file for a user  
  199. named \fBprofile\fR ,an account that who owns and administors the database.
  200. The great thing about it is that when the account is created ,no password is
  201. assigned to it.The database contains executable to maintain it.The database
  202. creation programs perform a \fBsetuid\fR to boot up the \fBoot\fR  there by 
  203. giving a person the whole C Shell to gain Super User privilege same as root.
  204. Intresting huh!
  205.                      
  206.  
  207. * Note: First the article will inform you of how the Unix is made up
  208.  
  209. The Unix is made if three components-The shell,the kernal,file system.
  210.  
  211. The kernal:
  212. -----------
  213. You could say that the kernal is the heart of the Unix operating system.
  214. The kernal is a low level language lower than the shell which maintains
  215. processes .The kernal handles memory usage ,maintains file system
  216. the sofware and hardware devices.
  217.  
  218. The shell:
  219. ----------
  220. The shell a higher level language. The shell had two important uses,
  221. to act as command interpreture for example using commands like cat,who,       
  222. ls the the shell is at work figuring out whether you have entered a command
  223. correctly or not.The second most important reason for the shell is its ability
  224. to be used as programing language.Suppose your performing some tasks      
  225. repeatedly over and over again,You can program the shell to do this for you.
  226.          
  227. The file system:   
  228. ---------------
  229. The file system in Unix is divede into 3 catagories:Directories,ordinary files
  230. and special files.(d,-)
  231.           
  232. Basic stucture:        
  233. (/)-this is abreviation for the root dirctory.
  234.   root level                      root
  235.                                   (/)                                  system
  236. -------------------------------------|----------------------------------level
  237. |      |        |         |                  |        |       |        |
  238. /unix   /etc    /dev      /tmp               /lib     /usr    /usr2    /bin
  239.         |                                        _____|_____
  240. login passwd                                     |    |    |
  241. level                                            /john  /cathy    
  242.                              ________________________|_______________
  243.                             |        |     |      |        |        |
  244.                         .profile   /mail  /pers  /games   /bin     /michelle
  245. *.profile - in case                        |    __|______  |      __|_______
  246.  you wich to change your enviroment     capital |        | data   |         |
  247. but after you log off.It sets to              othello  starwars letter letter1
  248. default.                                     
  249.  
  250. the /unix-is the kernal
  251. /etc - contains system administrators files,Most are not available to the
  252.        regular user.(this directory contains the /passwd file)
  253.  
  254.     Here are some files under /etc directory:
  255.     /etc/passwd
  256.     /etc/utmp
  257.     /etc/adm/sulog
  258.     /etc/motd
  259.     /etc/group
  260.     /etc/conf
  261.     /etc/profile
  262.   
  263. /dev - contains files for physical devices such as printer and the disk drives
  264. /tmp - temporary file directory
  265. /lib - dirctory that contains programs for high level languages
  266. /usr - this directory contains dirctories for each user on the system
  267.  
  268.      Eg. of a list of files under /usr
  269.     /usr/tmp
  270.     /usr/lib
  271.     /usr/docs
  272.     /usr/news
  273.     /usr/spool 
  274.     /usr/spool/lp
  275.     /usr/lib/uucp
  276.  
  277. /bin - contain executable programs (commands)
  278.  
  279. The root also contains:                                                       
  280. /bck - used to mount a back up file system.
  281. /install - Used to install and remove utilities
  282. /lost+found - This is where all the removed files go,This dir is used by fsck
  283.               (1M)
  284. /save -A utility used to save data
  285. /mnt - Used for temporary mounting
  286.  
  287. **Now the fun part scouting around**
  288.  
  289.                  Local commands (Explained in details)
  290.                  -------------------------------------
  291. At the unix prompt type the pwd command-it will show you the current working
  292. directory you are in.
  293.  
  294. $ pwd
  295. $ /usr/admin - assuming that you have hacked into a super user acc checkfsys
  296. $
  297.  
  298. This gives you the full login directory.The / before tell you the location
  299. of the root directory                     
  300.  
  301. or
  302.  
  303. (REFER TO THE DIAGRAM ABOVE)
  304. $ pwd
  305. $ /usr/john   
  306. $
  307. Assuming you have hacked into johns acc.
  308.  
  309. Now lets say you wanted to move down to the michelle directory( you own this)
  310. that contains letters.You would type in
  311.  
  312. $ cd michelle or cd usr/john/michelle
  313. $ pwd
  314. $ /usr/john/michelle
  315. $
  316.  
  317. Going back one directory up type in:
  318. $ cd ..
  319. or going to your parent directory just type in "cd"
  320.       
  321. Listing file directories assuming you are in the parent directory:
  322.  
  323. $ ls /usr/john
  324. mail
  325. pers
  326. games        
  327. bin
  328. michelle
  329. This wont give you the .profile file .To view it type
  330. $ cd
  331. $ ls -a
  332. :
  333. :
  334. .profile
  335.  
  336. To list file names in michelles directory type in:
  337. $ ls michelle (that if your in the johns directory)
  338. $ ls /usr/john/michelle(parent dir)
  339.  
  340. ls -l            
  341. -----             
  342. The ls -l is an an important command in unix.This command displays the whole
  343. directory in long format :Run this in parent directory
  344.  
  345. $ ls -l
  346. total 60
  347. -rwxr-x---    5 john      bluebox    10 april 9  7:04  mail
  348. drwx------    7 john      bluebox    30 april 2  4:09  pers
  349.      :            :         :         :     :      :    :
  350.      :            :         :         :     :      :    :
  351. -rwxr-x---     6 cathy    bluebox    13 april 1  13:00 partys
  352.      :            :         :         :     :      :    :
  353. $
  354.    
  355. The total 60 tells one the ammount of disk space used in a directory.The     
  356. -rwxr-x--- is read in triples of 3.The first chracter eg(-,d,b,c)-means as
  357. follows: - is an ordinary file ,d is a directory,b is block file,c is a
  358. chracter file.
  359. The r stands for read permission,w is write permission,x is execute.The first
  360. colum is read in 3 triples as stated above.The first group of 3 (in -rwxr-x---)
  361. after the "-" specifies the permission for the owner of the file,the second
  362. triple are for the groups (the fourth colum) and the last triple are the      
  363. permissions for all other users.Therefore the -rwxr-x--- is read as follows.
  364. The owner john has permission to read,write and execute anything in the bin
  365. directory but the group has no write permission to it and the rest of the users
  366. have no permission at all.The format of one of the lines in the above output
  367. is as follows:
  368.  
  369. file type-permissions,links,usersname,group,bytes taken,date,time when last
  370. renued,directory or file name.
  371. **You will be able to read,execute cathys file named party due to the same
  372. group***
  373.  
  374. chmod                    
  375. -----             
  376. The chmod command changes permission of a directory or a file.Format is
  377. chmod who+,-,=r,w,x
  378. The who is substituted by u-user,g-group,o-other users,a-all.
  379. The + means add permission,- means remove permission,= - assign.  
  380. Example :If you wanted all other users to read the file name mail ,type:   
  381.  
  382. $ chmod o+r mail
  383.  
  384. cat         
  385. ---          
  386. Now suppose you wanted to read the file letter .There are teo ways to doing
  387. this.First go to the michelle directory then type in:
  388.  
  389. $ cat letter
  390. line one ...\
  391. line two ... }the output of letter
  392. line three../
  393. $
  394.    or
  395. If you are in the parent directory type in:
  396. $ cat /usr/john/michelle/letter
  397. and you will have the same output.
  398.  
  399. Some cat options are  -s,-u,-v,-e,-t
  400.  
  401. Special Chracters in Unix:
  402. -------------------------
  403. *  - matches any number of single characters eg. ls john* will list
  404.      all files that begin with john
  405. [...] - matchs any one of the chracter in the [ ]
  406. ? - matches any single chracter
  407. runs a process in the backgroung leaving your terminal free
  408. $ - Values used for variables also $n - null argument
  409. > - redirectes output
  410. < - redirects input to come from a file
  411. >> - redirects command to be added to the end of a file
  412. | - pipe output (eg:who|wc-l tells us how many users are online)
  413. "..." - Turn of meaning of special chracters excluding $,`
  414. `...` - allows command output in to be used in a command line
  415. '...' - turns of special meaning of all chracters
  416.  
  417. continuation of local commands...[     ] -contains the options used
  418. ------------------------------- 
  419. passwd
  420. ------
  421. Password changing seems to be a big thing among the savants.Anyway to change
  422. the password one would use the 'passwd' command as shown below:
  423.  
  424.    $passwd
  425.    Changing password for john
  426.    Old password:                              
  427.    New password:                              
  428.    Retype new password:
  429.    $
  430.   
  431. This will only work when the password has aged enough
  432.  
  433. ps
  434. --
  435. Its sometimes necessary to see what command procesess you are running,this
  436. command lets you see that.
  437. ps [-a all processes except group leaders] [-e all processes] [-f the whole
  438.    list]                                                           
  439.  
  440.    $ps
  441.    PID   TTY  TIME   COMMAND
  442.    200   tty09 14:20  ps
  443.  
  444.    The systems reports (PID - process idenetification number which is a #
  445.    from 1-30,000 assigned to UNIX processes)
  446.    It also reports the TTY,TIME and the COMMAND being executed at the time.
  447.    To stop a process enter :    
  448.  
  449.    $kill [PID] (this case its 200)
  450.    200 terminated
  451.    $
  452.  
  453. grep
  454. ----
  455. This comand is important when seaching for a word or words in large files.
  456.  
  457. grep [argument] [file name] - searchs for an file that contains the argument
  458.                               for example:
  459.    $ grep phone cathy
  460.     phone   michelle  (718)5551234
  461.     phone   cindy   (718)5553456
  462.  
  463.     What this did was to find the argument 'phone' in the file cathy.If the
  464.     argument consists of two or more words then  it must be enclosed in single
  465.     quotes.
  466.  
  467.  
  468. mv
  469. --
  470. mv [file names(s)] [ dir name ] - renames a file or moves it to another     
  471.                                   directory eg.      
  472.    $mv letter letters 
  473.    $
  474.    This renames the file letter to letters thereby deleting letter
  475.                   or if you want to move files then
  476.    $mv /usr/john/pers/capital /usr/john/michelle/capital
  477.    $   
  478.    This moves the file capital to the directory named michelle
  479.  
  480. diff
  481. ----
  482. diff [file name] [ file name] - show diffrence between two files.Output of this
  483.                                 will have something like 4,5c4,5 then the it
  484.                                 will display both sets of files on the screen
  485.                                 The 4,5c4,5 means that you must change "c"
  486.                                 lines 4 to 5 in one file to line 4 to 5 in   
  487.                                 another.
  488.       Option for using this command are :
  489.        -b  -  it ignores blank spaces
  490.        -h  - compares it quickly
  491.        -s  - reports files that are the same
  492.        -S[file] - this is when you want to compare a directory starting at a
  493.                   specific file
  494.        
  495.  
  496.        There is also a command to compare 3 files which is :   
  497.  
  498.        diff3 [options] [file1] [file2] [file3]
  499.  
  500. cp
  501. --
  502. cp [file name] [file name] - makes a copy of a file
  503.  
  504.    $ cp letter letters
  505.    $
  506.    The file letters is a dupilcate copy of letter.In this case the original
  507.    is not erased like in the mv command
  508.  
  509.  
  510.  
  511. .... more UNIX commands:
  512. --------------------
  513.  
  514. man [command] or [c/r] -will give you a list of commands explainations
  515.  
  516. help - available on some UNIX systems
  517.                   
  518. mkdir [dir name(s)] - makes a directory      
  519.  
  520. rmdir [dir name(s)] - removes directory.You wont be able to remove the
  521.                       directory if it contains files in them
  522.  
  523. rm [file name(s)] - removes files. rm * will erase all files in the current
  524.                     dir.Be carefull you!!.Some options are :                
  525.                     [-f unconditional removal] [-i Prompts user for y or n]
  526.                         
  527. write [login name ] - to write to other logged in users.Sort of a chat
  528.  
  529. mesg [-n] [-y] - doesn't allow others to send you messages using the write
  530.                  command.Wall used by system adm overrides it.
  531.  
  532. $ [file name] - to execute any file
  533.  
  534. wc [file name] - Counts words,chracters,lines in a file
  535.  
  536. stty [modes] - Set terminal I/O for the current devices
  537.  
  538. sort [filename] - Sorts and merges files many options
  539.  
  540. spell [file name] > [file name] - The second file is where the misspelt words
  541.                                   are entered
  542.  
  543. date [+%m%d%y*] [+%H%%M%S] - Displays date acoording to options
  544.  
  545. at [-r] [-l] [job] - Does a specified job at a specified time.The -r Removes 
  546.                      all previously scheduled jobs.The -l reports the job #
  547.                      and status of all jobs scheduled
  548.  
  549. write [login] [tty] - Sends message to the login name.Chat!
  550.  
  551.  
  552.  
  553. su [login name]
  554. ---------------
  555. The su command allows one to switch user to a super user to a user.Very
  556. important could be used to switch to super user accounts.
  557. Usage:                                                
  558.  
  559. $ su sysadm
  560. password:
  561.  
  562. This su command will be monitored in /usr/adm/sulog and this file of all files
  563. is carefully monitered by the system administrator.Suppose you hacked in johns
  564. account and then switched to the sysadm account (ABOVE) your /usr/adm/sulog
  565. entry would look like:
  566.  
  567. SU  04/19/88  21:00 + tty 12 john-sysadm
  568.  
  569. Therfore the S.A(system administrator) would know that john swithed to sysadm
  570. account on 4/19/88 at 21:00 hours
  571.  
  572. Searching for valid login names:   
  573. -------------------------------
  574. Type in-
  575. $ who  ( command informs the user of other users on the system)
  576. cathy  tty1  april 19  2:30
  577. john   tty2  april 19  2:19
  578. dipal  tty3  april 19  2:31
  579. :
  580. :
  581. tty is the users terminal,date,time each logged on.dipal,john are valid
  582. logins.   
  583.  
  584. Files worth concatenating(cat)
  585. /etc/passwd file:                    
  586. -----------------                     
  587. The etc/passwd is a vital file to cat.For it contains login names of all
  588. users including super user accounts and there passwords.In the newer          
  589. SVR3 releases they are tighting their security by moving the encrypted
  590. passwords from /etc/passwd to /etc/shadow making it only readable by root.
  591. This is optional offcourse.
  592.  
  593. $ cat /etc/passwd
  594. root:D943/sys34:0:1:0000:/:
  595. sysadm:k54doPerate:0:0:administration:usr/admin:/bin/rsh
  596. checkfsys:Locked;:0:0:check file system:/usr/admin:/bin/rsh
  597. :
  598. other super user accs.
  599. :
  600. john:chips11:34:3:john scezerend:/usr/john:
  601. :
  602. other users
  603. :
  604. $
  605. If you have reached this far capture this file as soon as posible.
  606. This is a typical output etc/passwd file.The entries are seperated
  607. by a ":".There made be up to 7 fields in each line.
  608. Eg.sysadm account.
  609. The first is the login name in this case sysadm.The second field contains the
  610. password.The third field contains the user id."0 is the root".Then comes the
  611. group id then the account which contains the user full name etc .The sixth
  612. field is the login directory defines the full path name of the the particlar 
  613. account and the last is the program to be executed.          
  614. Now one can switch to other super user account using su command descibed above.
  615. The password entry in the field of the checkfsys account in the above example
  616. is "Locked;". This doesn't mean thats its a password but the account
  617. checkfsys cannot be accessed remotely.The ";" acts as an unused encryption
  618. chracter.A space is also used for the same purpose.You will find this in many
  619. UNIX systems that are small systems where the system administrator handles
  620. all maintaince.  
  621.  
  622. Password aging:  
  623. ---------------
  624. If password aging is active the user is forced to change the password at    
  625. regular intervals.One may be able to tell just by looking at the /etc/passwd
  626. file when the password is allowed to be changed and when it is compulsory to
  627. change it.
  628. For example the entry:
  629.  
  630. john:chips11,43:34:3:John Scezerend:/usr/john:
  631.  
  632. The password contains an extension of (,43) which mean that john can change has
  633. to change the password atleast evert 6 weeks and can keep it for atleast 3
  634. week.The format used is [password],Mmww.The M is the maxiumum number of weeks
  635. password has to be change and m is the minimum interval password can be changed
  636. and the ww is indicates when the password was last changed.
  637.  
  638.     Aging chart:
  639. ---------|-----------
  640. Character|# of weeks
  641.     .    |  0
  642.     /    |  1
  643.  0-9     | 2-11
  644.  A-Z     | 12-37
  645.  a-z     | 38-63
  646. ---------|-----------
  647.  
  648. From the above anyone can determine the number of weeks one can chnage the    
  649. password.         
  650.  
  651. The (ww) is automatically added as to when the password was last changed .   
  652.  
  653. IF SHAWDOWING IS ACTIVE:
  654. ------------------------
  655.  
  656. If the shawdowing is active the /etc/passwd would look like this:
  657.  
  658. root:x:0:1:0000:/:
  659. sysadm:x:0:0:administration:/usr/admin:/bin/rsh
  660.  
  661. The password filed is substituted by "x".
  662.  
  663. The /etc/shawdow file only readable by root will look similar to
  664. this:
  665.  
  666. root:D943/sys34:5288::
  667. :
  668. super user accounts
  669. :
  670. Cathy:masai1:5055:7:120
  671. :
  672. all other users
  673. :  
  674.  
  675. The first field contains users id:the second contains the password(The pw will
  676. be NONE if logining in remotely is deactivated):the third contains a code of
  677. when the password was last changed:the fourth and the fifth contains the 
  678. minimum and the maximum numbers of days for pw changes(Its rare that you will
  679. find this in the super user logins due to there hard to guess passwords)
  680.  
  681.   
  682. /etc/options directory
  683. -----------------------
  684. The etc/options dir will consists of utilities available in the system.
  685. Example:                  
  686. -rwxr-xr-x   1 root  sys   40 april  1:00  uucp.name                
  687. uucp standing for BNU
  688.  
  689. /etc/group
  690. -----------
  691. The file has each group on the system.Each line will have 4 entries separated
  692. by a ":" . Example of concatenated /etc/group:
  693.  
  694. root::0:root
  695. adm::2:adm,root
  696. bluebox::70:
  697.  
  698. Group name:password:group id:login names
  699. ** It very unlikely that groups will have passwords assigned to them **
  700. The id "0" is assigned to /
  701.  
  702. Sending and recieving messages:
  703. -------------------------------
  704. Two programs are used to manage this.They are mail & mailx.The difference
  705. between them is that mailx is more fancier thereby giving you many choices
  706. like replying message ,using editors etc.
  707. Sending:
  708. --------  
  709. The basic format for using this command is:
  710.  
  711. $mail [login(s)]
  712. (now one would enter the text
  713. after finishing enter "." a period
  714. on the next blank line)
  715. $
  716. This command is also used to send mail to remote systems.Suppose you wanted
  717. to send mail to john on a remote called ATT01
  718. you would type in:
  719.  
  720. $mail ATT01!john
  721.  
  722. Mail can be sent to several users,just by entering more login name after
  723. issuing the mail command
  724.  
  725. Using mailx is the same format:(This I'll describe very briefly)
  726. $mailx john
  727. subject:(this lets you enter the subject)
  728. (line #1)
  729. (line #2)
  730. (After you finish enter (~.) not the brackets offcourse ,more commands are
  731. available like ~p,~r,~v,~m,~h,~b etc.)
  732.  
  733. Receiving:
  734. ----------
  735. After you log on to the system you will the account may have mail waiting.
  736. You will be notified "you have mail".   
  737. To read this enter:       
  738. $mail
  739. (line #1)
  740. (line #2)
  741. (line #3)
  742. ?       
  743. $
  744. After the message you will be prompted with a question mark.Here you have a
  745. choice to delete it by entering d,saving it to view it later s,or just press
  746. enter to view the next message.
  747. (DONT BE A SAVANT AND DELETE THE POOR GUYS MAIL)
  748.  
  749. Super user commands:
  750. --------------------
  751. $sysadm adduser - will take you through a routine to add a user
  752.                  (may not last long)
  753.  
  754. Enter this:
  755.  
  756. $ sysadm adduser
  757. password:
  758. (this is what you will see)
  759. /--------------------------------------------------------------------------\
  760.   Process running succommmand `adduser`     
  761.   USER MANAGMENT
  762.  
  763.   Anytime you want to quit, type "q".
  764.   If you are not sure how to answer any prompt, type "?" for help
  765.  
  766.   If a default appears in the question,press <RETURN> for the default.
  767.  
  768.   Enter users full name [?,q]: (enter the name you want)                
  769.   Enter users login ID [?,q]:(the id you want to use)
  770.   Enter users ID number (default 50000) [?,q) [?,q]:( press return )
  771.   Enter group ID number or group name:(any name from /etc/group)
  772.   Enter users login home directory:(enter /usr/name)
  773.     
  774.   This is the information for the new login:
  775.   Users name: (name)
  776.   login ID:(id)
  777.   users ID:50000
  778.   group ID or name:     
  779.   home directory:/usr/name
  780.  Do you want to install,edit,skip [i,e,s,q]? (enter your choice if "i" then)
  781.  Login installed
  782.  Do you want to give the user a password?[y,n] (its better to enter one)
  783.  New password:
  784.  Re-enter password:   
  785.  
  786.  Do you want to add another login?
  787. \----------------------------------------------------------------------------/
  788.  
  789. This is the proccess to add a user.Since you hacked into a super user account
  790. you can make a super user account by doing the following by entering 0 as an
  791. user and a group ID and enter the home directory as /usr/admin.This will give
  792. you as much access as the account sysadm
  793. **Caution** - Do not use login names like Hacker,Cracker,Phreak etc .This is
  794. a total give away.                                                           
  795. The process of adding a user wont last very long the S.A will know when he
  796. checks out the /etc/passwd file
  797.  
  798. $sysadm moduser - This utility allows one to modify users.DO NOT ABUSE!!!
  799. Password:
  800.  
  801. This is what you'll see:
  802.  
  803. /----------------------------------------------------------------------------\
  804. MODIFYING USER'S LOGIN
  805.  
  806. 1)chgloginid  (This is to change the login ID)
  807. 2)chgpassword (Changing password)
  808. 3)chgshell (Changing directory DEFAULT = /bin/sh)
  809.  
  810. ENTER A NUMBER,NAME,INITIAL PART OF OF NAME,OR ? OR <NUMBER>? FOR HELP,
  811. Q TO QUIT ?
  812. \----------------------------------------------------------------------------/
  813.  
  814. Try every one of them out.Do not change someones password.It creates a havoc.
  815. If you do decide to change it.Please write the original one down somewhere
  816. and change back.Try not to leave to many traces after you had your fun.
  817. In choice number 1 you will be asked for the login and then the new one.
  818. In choice number 2 you will asked for the login and then supplied by it correct
  819. password and enter a new one.
  820. In choice 3 this is used to a pchange the login shell ** Use full **
  821. The above utilites can be used separatly for eg( To change a password one
  822. coulfd enter: $sysadm chgpasswd not chapassword ,The rest are same)
  823.  
  824. $sysadm deluser - This is an obviously to delete a user
  825. password: 
  826.    
  827. This will be the screen output:
  828. /---------------------------------------------------------------------------\
  829. Running subcommand 'deluser' from menu 'usermgmt'
  830. USER MANAGEMENT  
  831. This fuction completely removes the user,their mail file,home directory
  832. and all files below their home directory from the machine.
  833.  
  834. Enter login ID you wish to remove[q]:      (eg.cathy)
  835. 'cathy' belongs to 'Cathy Franklin'
  836. whose home directory is /usr/cathy
  837. Do you want to remove this login ID 'cathy' ? [y,n,?,q] : 
  838.  
  839. /usr/cathy and all files under it have been deleted.
  840.  
  841. Enter login ID you wish to remove [q]:
  842. \--------------------------------------------------------------------------/ 
  843. This command deletes everthing owned by the user.Dont use it even if you have
  844. access to it.
  845.  
  846.  
  847.  
  848. other super user commands:
  849. --------------------------
  850. wall [text] control-d  - to send an anouncement to users logged in(will
  851.                           override mesg -n command).Execute only from /     
  852. /etc/newgrp - is used to become a member of a group
  853.  
  854. sysadm [program name]
  855.         delgroup - delets groups
  856.         whoson - self explanatory
  857.         lsgroup - Lists group
  858.         mklineset -hunts various sequences
  859.         lsuser -lists all the users & their logins names
  860.  
  861. Other commands may require file system to be mounted.
  862.   
  863.  
  864.                        Basic Networking utility(BNU)
  865.                        -----------------------------
  866.  
  867. The BNU is a unique feature in UNIX.Some systems may not have this installed.
  868. What BNU does is allow other remote UNIXes communicate with yours without
  869. logging off the present one.BNU also allowes file transfer between computers.
  870. Most UNIX systems V will have this feature installed.
  871.  
  872. The user program like cu,uux etc are located in the /usr/bin directory
  873.  
  874. Basic Networking Files:
  875. -----------------------
  876. /usr/lib/uucp/[file name] 
  877.  [file name]
  878.  systems - cu command to establishes link.Contains info on remote computers
  879.            name,time it can be reached,login Id,password,telephone numbers
  880.  devices - inter connected with systems files(Automatic call unit same in two
  881.            entries)also cantains baud rate,port tty1 etc.
  882.                 
  883.  dialers - where asscii converation must be made before file tranfers etc.
  884.  dialcodes - contains abreiviations for phone numbers that can be used in
  885.              systems file
  886.  
  887.  other files are sysfiles,permissions,poll,devconfig
  888.  
  889. B.N.U Aministrative files:
  890. --------------------------
  891. There are 5 admnistrative files present.These are files are created in the
  892. /usr/spool directory .These A.Files are responsible for various BNU procceses
  893. like kepping records data ,files tranfers bettwenn remote and local and also
  894. usefull to lock devices.
  895.  
  896. TM - This file used to hold temporary data .When tranfering the files from a  
  897.      remote to local the /usr/spool/uucp/[name of the remote computer ] creates
  898.      this in the format of as of below:
  899.        
  900.      TM[Process Identification Number].[ddd]
  901.  
  902.      The ddd is the a 3 digit number (sequential) starting with "0"
  903.      Here a typical eg: TM322.012
  904.      Then this file is moved into the path defined by the C.sysnxxx file
  905.  
  906. X.[Execute files] - Created in the /usr/spool before you execute the commands
  907.                     in remote.
  908.                     The format used to name this file is X.sysnxxx
  909.                     where sys stand for the remote name and n is the priority
  910.                     level the xxxx is a sequence assingned by the uucp.These
  911.                     files always contain the Name of the file ,Comuter & file
  912.                     name to recieve,Persons login & computer name and the
  913.                     command string.
  914.  
  915. LCK - The lock file created in the /usr/spool/locks directory.The is used when
  916.       devices are being used.Prevent usage of the same calling device.
  917.       
  918.      Format used: LCK.str wher the str is a device name.The Lock file contains
  919.      the PID needed to lock
  920.  
  921. C.sysnxxx - created in the usr/spool directory.These are the work files.Used  
  922.             when work is in line,remote execeutions.Format is same as the     
  923.             X.sysnxxxx.The works files contain the full path name of the file
  924.             to be sent,path name of the destination (TM Transfers),Remote login
  925.             name to be notified after the file transmision is complete,Users
  926.             login name and the name of the programs used eg.uucp,uupick etc.
  927.           
  928. D - The data files.Format used is  D.systmxxxxyyy.These files are created when
  929.     specified in a command to copy to the spool directory.Eg. By the usage of
  930.     uucp -C this will be true.       
  931.     The systm is the remote name,xxxx is the the 4 digits seq assingned by
  932.     the uucp.The yyy is a sub sequence number.
  933.  
  934. Logining on to remote and sending+receiving files
  935. -------------------------------------------------
  936.  cu - This command allows one to log on to the local as well as the remote
  937.       Unix (or a non unix)without haveing to hang up so you can transfer files.
  938.       Usage:[options]
  939.  
  940.   $ cu [-s baud rate][-o odd parity][-e even parity][-l name of comm line]
  941.        telephone number | systemname
  942.  
  943.   To view system names that you can communicate with use the 'unname' command:
  944.   Eg. of output of names:
  945.  
  946.   ATT01
  947.   ATT02
  948.   ATT03
  949.   ATT04
  950.  
  951.  
  952. $ cu -s300 3=9872344 (9872344 is the tel#)
  953.  connected
  954.  login:
  955.  password:
  956.  
  957. local strings:
  958. --------------
  959. <~.> - will log you off the remote terminal but not the local
  960. ~! - out you on the local withiout disconnecting the line from remote
  961. <control-d> - puts you back on the remote unix
  962. ~%take [file name] - takes a copy of the file name and copies it to the
  963.                      local(the directory which you are in)
  964. "%put [file name] - reverse of above
  965. ~$[command] - allows the execution of a command to the local from remote
  966.  
  967. ct         
  968. --         
  969. ct allows local to connect to remote.Initiates a getty on a remote terminal.
  970. Usefull when using a remote terminal.BNU has call back feature that allows
  971. the user on the remote who can execute a call back meaning the local can call
  972. the remote.[   ] are options
  973.  
  974. $ ct [-h prevent automatic hang up][-s bps rate][-wt set a time to call back
  975.      abbrieviated t mins] telephone number
  976.  
  977. uux          
  978. ---        
  979. To execute commands on a remote (unix to unix)       
  980. usage:[  ] are options
  981.  
  982. $ uux [- use standard output][-n prevent mail notification][-p also use
  983.       standard output] command-string                        
  984.  
  985. uucp                              
  986. ----             
  987. uucp copies files from ones computer to the home directory
  988. of a user in remote system.This also works when copying files from one
  989. directory to another in the remote.The remote user will be notified by mail.
  990. This command becomes use full when copying files from a remote to your local
  991. system.
  992. The uucp requires the uucico daemon will call up the remote and will perform
  993. file login sequence,file transfer and notify the user by mail.
  994. Daemons are programs runining in the background.The 3 daemons in a Unix are
  995. uucico,uusched,uuxqt.
  996.  
  997.  Daemons Explained:[nows a good time to explain the 3 daemons]
  998.  ------------------
  999.  
  1000.  uuxqt - Remote execution.This daemon is executed by uudemon.hour started by
  1001.          cron.UUXQT searchs in the spool directory for executable file
  1002.          named X.file sent from the remote system.When it finds a file X.file
  1003.          where it obtains process which are to be executed.The next step is 
  1004.          to find weather the processes are available at the time.The if     
  1005.          available it checks permission and if everthing is o.k it proceeds
  1006.          the background proccess.
  1007.  
  1008.  uucico - This Daemon is very immportant for it is responsible in establishing
  1009.           a connection to the remote also checks permission,performs login
  1010.           procedures,transfers + executes files and also notifies the user
  1011.           by mail.This daemon is called upon by uucp,uuto,uux commands.
  1012.  
  1013.  uusched - This is executed by the shell script called uudemon.hour
  1014.            This daemons acts as a randomizer before the UUCICO daemon is
  1015.            called.
  1016.  
  1017.  
  1018. Usage of uucp command:
  1019.  
  1020. $ uucp [options] [first full path name!] file [destination path!] file
  1021. example:
  1022. $ uucp -m -s bbss hackers unix2!/usr/todd/hackers
  1023.  
  1024. What this would do is send the file hackers from your computer to the remotes
  1025. /usr/todd/hackers making hackers offcourse as file.todd would mail that
  1026. a file has been sent to him.The unix2 is the name of the remote.
  1027. Options for uucp:(Dont forget to type in remotes name unix2 in case)         
  1028. -c  dont copy files to spool directory
  1029. -C  copy to spool
  1030. -s[file name] - this file will contain the file status(above is bbss)
  1031. -r  Dont start the comm program(uucico) yet
  1032. -j  print job number(for above eg.unix2e9o3)
  1033. -m  send mail when file file is complete
  1034.  
  1035. Now suppose you wanted to receive file called kenya which is in the usr/dan/usa
  1036.  to your home directory /usr/john assuming that the local systems name is
  1037. ATT01 and you are currently working in /usr/dan/usa,you would type in:
  1038.  
  1039. $uucp kenya ATT01!/usr/john/kenya
  1040.  
  1041. uuto         
  1042. ----          
  1043. The uuto command allows one to send file to remote user and can also be used
  1044. to send files locally.
  1045. Usage:
  1046. $ uuto [file name] [system!login name]( omit systen name if local)
  1047.  
  1048.  
  1049.  
  1050. Conclusion:
  1051. -----------
  1052. Theres always more one can say about the UNIX but its time to stop.
  1053. I hope you have enjoyed the article.I apologize for the lenght. I hope I
  1054. made the UNIX operating system more familiar.
  1055. Remember do not abuse any systems you hack into for a true hacker doesn't like
  1056. to reck but to learn.
  1057. I can be reached at (718)358/9209 - Hackers Den88 [2600 BBS #5]
  1058.  
  1059. Watch for my new article on using PANAMAC airline computers coming soon.
  1060.  
  1061.  
  1062.                            Red Knight
  1063.                              P/HUN!  
  1064.                            <<T.S.A.N>>
  1065.  
  1066. Leached off SSC (713) 497-2312
  1067.  
  1068. [13] [UNIX system specifics (all versions)]
  1069. (98) Minutes Remaining
  1070. (G-Files Menu) Command <?-Help>: [
  1071.  
  1072. X-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-X
  1073.