home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / zines / n_z / phun2.006 < prev    next >
Encoding:
Text File  |  2003-06-11  |  39.9 KB  |  1,071 lines

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