home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / zines / phrack1 / phrack22.005 < prev    next >
Encoding:
Text File  |  2003-06-11  |  34.2 KB  |  907 lines

  1.  
  2.                                 ==Phrack Inc.==
  3.  
  4.                       Volume Two, Issue 22, File 5 of 12
  5.  
  6.          /|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|
  7.          |/                                                      |/
  8.          /|           An Indepth Guide In Hacking UNIX           /|
  9.          |/                          and                         |/
  10.          /|        The Concept Of Basic Networking Utility       /|
  11.          |/                                                      |/
  12.          /|                     By Red Knight                    /|
  13.          |/                                                      |/
  14.          /|                     Member of the                    /|
  15.          |/         Phreakers/Hackers Underground Network        |/
  16.          /|                                                      /|
  17.          |/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/|/
  18.  
  19. Brief History On UNIX
  20. ~~~~~~~~~~~~~~~~~~~~~
  21. Its because of Ken Tompson that today we are able to hack Unix.  He used to
  22. work for Bell Labs in the 1960s.  Tompson started out using the MULTICS OS
  23. which was later eliminated and Tompson was left without an operating system to
  24. work with.
  25.  
  26. Tompson had to come up with something real quick. He did some research and and
  27. in 1969 UNIX came out, which was a single user and it did not have many
  28. capabilities.  A combined effort with others enabled him to rewrite the version
  29. in C and add some good features.  This version was released in 1973 and was
  30. made available to the public.  This was the first begining of UNIX in its
  31. presently known form.  The more refined version of UNIX, today know as UNIX
  32. system V developed by Berkley University has unique capabilities.
  33.  
  34. Various types of UNIXes are CPIX, Berkeley Ver 4.1, Berkeley 4.2, FOS, Genix,
  35. HP-UX, IS/I, OSx, PC-IX, PERPOS, Sys3, Ultrix, Zeus, Xenix, UNITY, VENIX, UTS,
  36. Unisys, Unip lus+, UNOS, Idris, QNIX, Coherent, Cromix, System III, System 7,
  37. Sixth edition.
  38.  
  39. The Article Itself
  40. ~~~~~~~~~~~~~~~~~~
  41. I believe that hacking into any system requires knowledge of the operating
  42. system itself.  Basically what I will try to do is make you more familiar with
  43. UNIX operation and its useful commands that will be advantageous to you as a
  44. hacker.  This article contains indepth explainations.  I have used the  UNIX
  45. System V to write this article.
  46.  
  47.  
  48. Error Messages:  (UNIX System V)
  49. ~~~~~~~~~~~~~~
  50. Login Incorrect - An invalid ID and/or password was entered.  This means
  51.                   nothing.  In UNIX there is no way guessing valid user IDs.
  52.                   You may come across this one when trying to get in.
  53.  
  54. No More Logins  - This happens when the system will not accept anymore logins.
  55.                   The system could be going down.
  56.  
  57. Unknown Id      - This happens if an invalid id is entered using (su) command.
  58.  
  59. Unexpected Eof In File - The file being stripped or the file has been damaged.
  60.  
  61. Your Password Has Expired - This is quite rare although there are situations
  62.                             where it can happen.  Reading the etc/passwd will
  63.                             show you at how many intervals it changes.
  64.  
  65. You May Not Change The Password - The password has not yet aged enough.  The
  66.                                   administrator set the quotas for the users.
  67.  
  68. Unknown Group (Group's Name) - Occurs when chgrp is executed, group does not
  69.                                exist.
  70. Sorry - Indicated that you have typed in an invalid super user password
  71.         (execution of the su).
  72.  
  73. Permission Denied! - Indicated you must be the owner or a super user to change
  74.                      password.
  75.  
  76. Sorry <( Of Weeks) Since Last Change - This will happen when password has has
  77.                                         not aged enough and you tried to change
  78.                                         it (password).
  79.  
  80. (Directory Name):  No Permission - You are trying to remove a directory which
  81.                                    you have no permission to.
  82.  
  83. (File Name) Not Removed - Trying to delete a file owned by another user that
  84.                           you do not have write permission for.
  85.  
  86. (Dirname) Not Removed - Ownership of the dir is not your that your trying to
  87.                         delete.
  88.  
  89. (Dirname) Not Empty - The directory contains files so you must have to delete
  90.                       the files before execcant open [file name] - defined
  91.                       wrong path, file name or you have no read permission.
  92.  
  93. Cp:  (File Name) And (File Name) Are Identical - Self explanatory.
  94.  
  95. Cannot Locate Parent Directory - Occurs when using mv.
  96.  
  97. (File name) Not Found - File which your trying to move does not exist.
  98.  
  99. You Have Mail - Self explanatory.
  100.  
  101.  
  102. Basic Networking Utility Error Messages
  103. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  104. Cu:  Not found         - Networking not installed.
  105. Login Failed           - Invalid id/pw or wrong number specified.
  106. Dial Failed            - The systen never answered due to a wrong number.
  107. UUCP Completely Failed - Did not specify file after -s.
  108. Wrong Time to Call     - You called at the time at a time not specified in the
  109.                          Systems file.
  110. System not in systems  - You called a remote not in the systems file.
  111.  
  112.  
  113. Logon Format
  114. ~~~~~~~~~~~~
  115. The first thing you must do is switch to lower case.  To identifing a UNIX,
  116. this is what you will see;
  117.  
  118. AT&T Unix System V 3.0 (eg of a system identifier)
  119.  
  120. login:
  121.  or
  122. Login:
  123.  
  124. Any of these is a UNIX.  Here is where you will have to guess at a user valid
  125. id.  Here are some that I have come across; glr, glt, radgo, rml, chester, cat,
  126. lom, cora, hlto, hwill, edcasey, and also some containing numbers; smith1,
  127. mitu6, or special characters in it; bremer$, jfox.  Login names have to be 3
  128. to 8 chracters in length, lowercase, and must start with a letter.  In some
  129. XENIX systems one may login as "guest"
  130.  
  131. User Level Accounts (Lower Case)
  132. ~~~~~~~~~~~~~~~~~~~
  133. In Unix there are what is called.  These accounts can be used at the "login:"
  134. prompt.  Here is a list:
  135.  
  136. sys      bin     trouble      daemon     uucp     nuucp      rje     lp     adm
  137.  
  138.  
  139. Super-User Accounts
  140. ~~~~~~~~~~~~~~~~~~~
  141. There is also a super-user login which make UNIX worth hacking.  The accounts
  142. are used for a specific job.  In large systems these logins are assingned to
  143. users who have a responsibilty to maintain subsystems.
  144.  
  145. They are as follows (all lower case);
  146.  
  147. root       -  This is a must the system comes configured with it. It has no
  148.               restriction.  It has power over every other account.
  149. unmountsys -  Unmounts files
  150. setup      -  System set up
  151. makefsys   -  Makes a new file
  152. sysadm     -  Allows useful S.A commands (doesn't need root login)
  153. powerdown  -  Powering system down
  154. mountfsys  -  Mounts files
  155. checkfsys  -  Checks file
  156.  
  157. These accounts will definitly have passwords assigned to them.  These accounts
  158. are also commands used by the system administrator.  After the login prompt you
  159. will receive a password prompt:
  160.  
  161. password:
  162.   or
  163. Password:
  164.  
  165. Enter the password (it will not echo).  The password rule is as follows; Each
  166. password has to contain at least 6 characters and maximum of 8 characters.  Two
  167. of which are to be alphabetic letters and at least one being a number or a
  168. special character.  The alphabetic digits could be in upper case or lower
  169. case.  Here are some of the passwords that I have seen; Ansuya1, PLAT00N6,
  170. uFo/78, ShAsHi.., Div417co.
  171.  
  172. The passwords for the super user accounts will be difficult to hack try the
  173. accounts interchangebly; login:sysadm password:makefsys, or rje1, sysop,
  174. sysop1, bin4, or they might contain letters, numbers, or special chracters in
  175. them.  It could be anything.  The user passwords are changed by an aging
  176. proccess at successive intervals.  The users are forced to changed it.  The
  177. super-user will pick a password that will not need changing for a long period
  178. of time.
  179.  
  180.  
  181. You Have Made It!
  182. ~~~~~~~~~~~~~~~~~
  183. The hard part is over and hopefully you have hacked a super-user account.
  184. Remember Control-d stops a process and also logs you off.  The next thing you
  185. will probably see is the system news.  Ex;
  186.  
  187. login:john
  188. password:hacker1
  189.  
  190. System news
  191.  
  192. There will be no networking offered to the users till
  193. August 15, due to hardware problems.
  194. (Just An Example)
  195.  
  196. $
  197.  
  198. $ (this is the Unix prompt) - Waiting for a command to be entered.
  199.  - Means your logged in as root (Very Good).
  200.  
  201. A Word About The XENIX System III (Run On The Tandy 6000)
  202. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  203. The largest weakness in the XENIX System III occurs after the installation
  204. of the Profile-16 or more commonly know as the Filepro-16.  I have seen the
  205. Filepro-16 installed in many systems.  The installation process creates an
  206. entry in the password file for a user named \fBprofile\fR, an account that who
  207. owns and administors the database.  The great thing about it is that when the
  208. account is created, no password is assigned to it.  The database contains
  209. executable to maintain it.  The database creation programs perform a
  210. \fBsetuid\fR to boot up the \fBoot\fR  thereby giving a person the whole C
  211. Shell to gain Super User privilege same as root.  Intresting huh!
  212.  
  213. (* Note:  First the article will inform you of how the Unix is made up.)
  214.  
  215.  
  216. The Unix is made if three components - The Shell, The Kernal, File System.
  217.  
  218. The Kernal
  219. ~~~~~~~~~~
  220. You could say that the kernal is the heart of the Unix operating system. The
  221. kernal is a low level language lower than the shell which maintains processes.
  222. The kernal handles memory usage, maintains file system the sofware and hardware
  223. devices.
  224.  
  225. The Shell
  226. ~~~~~~~~~
  227. The shell a higher level language.  The shell had two important uses, to act as
  228. command interpreture for example using commands like cat or who.  The shell is
  229. at work figuring out whether you have entered a command correctly or not.  The
  230. second most important reason for the shell is its ability to be used as
  231. programing language.  Suppose your performing some tasks repeatedly over and
  232. over again, you can program the shell to do this for you.
  233.  
  234.             (Note:  This article will not cover shell programming.)
  235.             (       Instead B.N.N will be covered.                )
  236.  
  237.  
  238. The File System
  239. ~~~~~~~~~~~~~~~
  240. The file system in Unix is divided into 3 catagories:  Directories, ordinary
  241. files and special files (d,-).
  242.  
  243. Basic Stucture:
  244.  
  245. (/)-this is abreviation for the root dirctory.
  246.  
  247.   root level                      root
  248.                                   (/)                                  system
  249. -------------------------------------|---------------------------------- level
  250. |      |        |         |                  |        |       |        |
  251. /unix  /etc     /dev      /tmp               /lib     /usr    /usr2    /bin
  252.        |                                         _____|_____
  253. login passwd                                     |    |    |
  254. level                                            /john  /cathy
  255.                               ________________________|_______________
  256.                              |        |     |      |        |        |
  257.                          .profile   /mail  /pers  /games   /bin     /michelle
  258. *.profile - in case you                    |    __|______  |      __|_______
  259. wish to change your environment, but    capital |        | data   | |       |
  260. after you log off, it sets it to              othello  starwars letter letter1
  261. default.
  262.  
  263. /unix - This is the kernal.
  264. /etc  - Contains system administrators files,Most are not available to the
  265.         regular user (this dirrctory contains the /passwd file).
  266.  
  267.     Here are some files under /etc directory:
  268.     /etc/passwd
  269.     /etc/utmp
  270.     /etc/adm/sulog
  271.     /etc/motd
  272.     /etc/group
  273.     /etc/conf
  274.     /etc/profile
  275.  
  276. /dev - contains files for physical devices such as printer and the disk drives
  277. /tmp - temporary file directory
  278. /lib - dirctory that contains programs for high level languages
  279. /usr - this directory contains dirctories for each user on the system
  280. /bin - contain executable programs (commands)
  281.  
  282. The root also contains:
  283. /bck - used to mount a back up file system.
  284. /install - Used to install and remove utilities
  285. /lost+found - This is where all the removed files go, this dir is used by fsck
  286. /save -A utility used to save data
  287. /mnt - Used for temporary mounting
  288.  
  289. **Now the fun part scouting around**
  290.  
  291. Local Commands (Explained In Details)
  292. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  293. At the unix prompt type the pwd command.  It will show you the current working
  294. directory you are in.
  295.  
  296. $ pwd
  297. $ /usr/admin - assuming that you have hacked into a super user account
  298.                check fsys
  299. $
  300.  
  301. This gives you the full login directory.  The / before tell you the location of
  302. the root directory.
  303.  
  304. Or
  305.  
  306. (REFER TO THE DIAGRAM ABOVE)
  307. $ pwd
  308. $ /usr/john
  309. $
  310. Assuming you have hacked into John's account.
  311.  
  312. Lets say you wanted to move down to the Michelle directory that contains
  313. letters.  You would type in;
  314.  
  315. $ cd michelle or cd usr/john/michelle
  316. $ pwd
  317. $ /usr/john/michelle
  318. $
  319.  
  320. Going back one directory up type in:
  321. $ cd ..
  322. or going to your parent directory just type in "cd"
  323.  
  324. Listing file directories assuming you have just logged in:
  325. $ ls /usr/john
  326. mail
  327. pers
  328. games
  329. bin
  330. michelle
  331. This wont give you the .profile file.  To view it type
  332. $ cd
  333. $ ls -a
  334. :
  335. :
  336. .profile
  337.  
  338. To list file names in Michelle's directory type in:
  339. $ ls michelle (that if your in the johns directory)
  340. $ ls /usr/john/michelle(parent dir)
  341.  
  342. ls -l
  343. ~~~~~
  344. The ls -l is an an important command in unix.This command displays the whole
  345. directory in long format :Run this in parent directory.
  346. $ ls -l
  347. total 60
  348. -rwxr-x---    5 john      bluebox    10 april 9  7:04  mail
  349. drwx------    7 john      bluebox    30 april 2  4:09  pers
  350.      :            :         :         :     :      :    :
  351.      :            :         :         :     :      :    :
  352. -rwxr-x---     6 cathy    bluebox    13 april 1  13:00 partys
  353.      :            :         :         :     :      :    :
  354. $
  355.  
  356. The total 60 tells one the ammount of disk space used in a directory.  The
  357. -rwxr-x--- is read in triples of 3.  The first chracter eg (-, d, b, c) means
  358. as follows:  - is an ordinary file, d is a directory, b is block file, c is a
  359. character file.
  360.  
  361. The r stands for read permission, w is write permission, x is execute. The
  362. first column is read in 3 triples as stated above.  The first group of 3 (in
  363. -rwxr-x---) after the "-" specifies the permission for the owner of the file,
  364. the second triple are for the groups (the fourth column) and the last triple
  365. are the permissions for all other users.  Therefore, the -rwxr-x--- is read as
  366. follows.
  367.  
  368. The owner, John, has permission to read, write, and execute anything in the bin
  369. directory but the group has no write permission to it and the rest of the users
  370. have no permission at all.  The format of one of the lines in the above output
  371. is as follows:
  372.  
  373. file type-permissions, links, user's name, group, bytes taken, date, time when
  374. last renued, directory, or file name.
  375.  
  376.                *** You will be able to read, execute Cathy's ***
  377.                *** file named partly due to the same group.  ***
  378.  
  379. Chmod
  380. ~~~~~
  381. The chmod command changes permission of a directory or a file.  Format is
  382. chmod who+, -, =r , w, x
  383.  
  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 two ways to doing
  393. this.  First go to the michelle directory then type in:
  394.  
  395. $ cat letter
  396. line one ...\
  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 all
  410.          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
  424. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  425. man [command] or [c/r] -will give you a list of commands explainations
  426. help - available on some UNIX systems
  427. mkdir [dir name(s)] - makes a directory
  428. rmdir [dir name(s)] - removes directory.You wont be able to remove the
  429.                       directory if it contains files in them
  430. rm [file name(s)] - removes files. rm * will erase all files in the current
  431.                     dir.  Be carefull you!  Some options are:
  432.                     [-f unconditional removal] [-i Prompts user for y or n]
  433.  
  434. ps [-a all processes except group leaders] [-e all processes] [-f the whole
  435.    list]  - This command reports processes you are running eg:
  436.  
  437.    $ps
  438.    PID   TTY  TIME   COMMAND
  439.    200   tty09 14:20  ps
  440.  
  441.    The systems reports (PID - process idenetification number which is a number
  442.    from 1-30,000 assigned to UNIX processes)
  443.    It also reports the TTY,TIME and the COMMAND being executed at the time.
  444.    To stop a process enter :
  445.  
  446.    $kill [PID] (this case its 200)
  447.    200 terminated
  448.    $
  449.  
  450. grep (argument) - searches for an file that contains the argument
  451. mv (file names(s)) ( dir name ) - renames a file or moves it to another
  452.                                   directory
  453. cp [file name] [file name] - makes a copy of a file
  454. write [login name ] - to write to other logged in users.  Sort of a chat
  455. mesg [-n] [-y] - doesn't allow others to send you messages using the write
  456.                  command.  Wall used by system adm overrides it.
  457. $ [file name] - to execute any file
  458. wc [file name] - Counts words, characters,lines in a file
  459. stty [modes] - Set terminal I/O for the current devices
  460. sort [filename] - Sorts and merges files many options
  461. spell [file name] > [file name] - The second file is where the misspelt words
  462.                                   are entered
  463. date [+%m%d%y*] [+%H%%M%S] - Displays date acoording to options
  464. at [-r] [-l] [job] - Does a specified job at a specified time.  The -r Removes
  465.                      all previously scheduled jobs.The -l reports the job  and
  466.                      status of all jobs scheduled
  467. write [login] [tty] - Sends message to the login name.  Chat!
  468.  
  469.  
  470. Su [login name]
  471. ~~~~~~~~~~~~~~~
  472. The su command allows one to switch user to a super user to a user.  Very
  473. important could be used to switch to super user accounts.
  474. Usage:
  475.  
  476. $ su sysadm
  477. password:
  478.  
  479. This su command will be monitored in /usr/adm/sulog and this file of all files
  480. is carefully monitered by the system administrator.Suppose you hacked in john's
  481. account and then switched to the sysadm account (ABOVE) your /usr/adm/su log
  482. entry would look like:
  483.  
  484. SU  04/19/88  21:00 + tty 12 john-sysadm
  485.  
  486. Therfore the S.A(system administrator) would know that john swithed to sysadm
  487. account on 4/19/88 at 21:00 hours
  488.  
  489.  
  490. Searching For Valid Login Names:
  491. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  492. Type in-
  493. $ who  ( command informs the user of other users on the system)
  494. cathy  tty1  april 19  2:30
  495. john   tty2  april 19  2:19
  496. dipal  tty3  april 19  2:31
  497. :
  498. :
  499. tty is the user's terminal, date, time each logged on.  mary, dr.m are valid
  500. logins.
  501.  
  502. Files worth concatenating(cat)
  503.  
  504.  
  505. /etc/passwd file
  506. ~~~~~~~~~~~~~~~~
  507. The etc/passwd is a vital file to cat.  For it contains login names of all
  508. users including super user accounts and there passwords.  In the newer SVR3
  509. releases they are tighting their security by moving the encrypted passwords
  510. from /etc/passwd to /etc/shadow making it only readable by root.
  511. This is optional of course.
  512.  
  513. $ cat /etc/passwd
  514. root:D943/sys34:0:1:0000:/:
  515. sysadm:k54doPerate:0:0:administration:usr/admin:/bin/rsh
  516. checkfsys:Locked;:0:0:check file system:/usr/admin:/bin/rsh
  517. :
  518. other super user accs.
  519. :
  520. john:hacker1:34:3:john scezerend:/usr/john:
  521. :
  522. other users
  523. :
  524. $
  525.  
  526. If you have reached this far capture this file as soon as possible.  This is a
  527. typical output etc/passwd file.  The entries are seperated by a ":".  There
  528. made be up to 7 fields in each line.
  529. Eg.sysadm account.
  530.  
  531. The first is the login name in this case sysadm.The second field contains the
  532. password.  The third field contains the user id."0 is the root."  Then comes
  533. the group id then the account which contains the user full name etc.  The sixth
  534. field is the login directory defines the full path name of the the paticular
  535. account and the last is the program to be executed.  Now one can switch to
  536. other super user account using su command descibed above.  The password entry
  537. in the field of the checkfsys account in the above example is "Locked;". This
  538. doesn't mean thats its a password but the account checkfsys cannot be accessed
  539. remotely.  The ";" acts as an unused encryption character.  A space is also
  540. used for the same purpose.  You will find this in many UNIX systems that are
  541. small systems where the system administrator handles all maintaince.
  542.  
  543. If the shawdowing is active the /etc/passwd would look like this:
  544.  
  545. root:x:0:1:0000:/:
  546. sysadm:x:0:0:administration:/usr/admin:/bin/rsh
  547.  
  548. The password filed is substituted by "x".
  549.  
  550. The /etc/shawdow file only readable by root will look similar to this:
  551.  
  552. root:D943/sys34:5288::
  553. :
  554. super user accounts
  555. :
  556. Cathy:masai1:5055:7:120
  557. :
  558. all other users
  559. :
  560.  
  561. The first field contains users id:  The second contains the password (The pw
  562. will be NONE if logining in remotely is deactivated):  The third contains a
  563. code of when the password was last changed:  The fourth and the fifth contains
  564. the minimum and the maximum numbers of days for pw changes (its rare that you
  565. will find this in the super user logins due to there hard to guess passwords)
  566.  
  567.  
  568. /etc/options
  569. ~~~~~~~~~~~~
  570. The etc/options file informs one the utilities available in the system.
  571. -rwxr-xr-x   1 root  sys   40 april  1:00  Basic Networking utility
  572.  
  573.  
  574. /etc/group
  575. ~~~~~~~~~~
  576. The file has each group on the system.  Each line will have 4 entries separated
  577. by a ":".   Example of concatenated /etc/group:
  578.  
  579. root::0:root
  580. adm::2:adm,root
  581. bluebox::70:
  582.  
  583. Group name:password:group id:login names
  584. ** It very unlikely that groups will have passwords assigned to them **
  585. The id "0" is assigned to /
  586.  
  587.  
  588. Sending And Recieving Messages
  589. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  590. Two programs are used to manage this.  They are mail & mailx.  The difference
  591. between them is that mailx is more fancier thereby giving you many choices like
  592. replying message, using editors, etc.
  593.  
  594.  
  595. Sending
  596. ~~~~~~~
  597. The basic format for using this command is:
  598.  
  599. $mail [login(s)]
  600. (now one would enter the text after finishing enter "." a period on the next
  601. blank line)
  602. $
  603.  
  604. This command is also used to send mail to remote systems.  Suppose you wanted
  605. to send mail to john on a remote called ATT01 you would type in:
  606.  
  607. $mail ATT01!john
  608.  
  609. Mail can be sent to several users, just by entering more login name after
  610. issuing the mail command
  611.  
  612. Using mailx is the same format:(This I'll describe very briefly) $mailx john
  613. subject:(this lets you enter the subject)
  614. (line 1)
  615. (line 2)
  616. (After you finish enter (~.) not the brackets of course, more commands are
  617. available like ~p, ~r, ~v, ~m, ~h, ~b, etc.).
  618.  
  619.  
  620. Receiving
  621. ~~~~~~~~~
  622. After you log on to the system you will the account may have mail waiting.
  623. You will be notified "you have mail."
  624. To read this enter:
  625. $mail
  626. (line 1)
  627. (line 2)
  628. (line 3)
  629. ?
  630. $
  631.  
  632. After the message you will be prompted with a question mark.  Here you have a
  633. choice to delete it by entering d, saving it to view it later s, or just press
  634. enter to view the next message.
  635.  
  636.               (DON'T BE A SAVANT AND DELETE THE POOR GUY'S MAIL)
  637.  
  638.  
  639. Super User Commands
  640. ~~~~~~~~~~~~~~~~~~~
  641. $sysadm adduser - will take you through a routine to add a user (may not last
  642.                   long)
  643.  
  644. Enter this:
  645.  
  646. $ sysadm adduser
  647. password:
  648. (this is what you will see)
  649.  /--------------------------------------------------------------------------\
  650.   Process running succommmand `adduser`
  651.   USER MANAGMENT
  652.  
  653.   Anytime you want to quit, type "q".
  654.   If you are not sure how to answer any prompt, type "?" for help
  655.  
  656.   If a default appears in the question, press <RETURN> for the default.
  657.  
  658.   Enter users full name [?,q]: (enter the name you want)
  659.   Enter users login ID [?,q]:(the id you want to use)
  660.   Enter users ID number (default 50000) [?,q) [?,q]:( press return )
  661.   Enter group ID number or group name:(any name from /etc/group)
  662.   Enter users login home directory:(enter /usr/name)
  663.  
  664.   This is the information for the new login:
  665.   Users name: (name)
  666.   login ID:(id)
  667.   users ID:50000
  668.   group ID or name:
  669.   home directory:/usr/name
  670.   Do you want to install, edit, skip [i, e, s, q]? (enter your choice if "i"
  671.   then)
  672.  Login installed
  673.  Do you want to give the user a password?[y,n] (its better to enter one)
  674.  New password:
  675.  Re-enter password:
  676.  
  677.  Do you want to add another login?
  678. \----------------------------------------------------------------------------/
  679.  
  680. This is the proccess to add a user.  Since you hacked into a super user account
  681. you can make a super user account by doing the following by entering 0 as an
  682. user and a group ID and enter the home directory as /usr/admin.  This will give
  683. you as much access as the account sysadm.
  684.  
  685. **Caution** - Do not use login names like Hacker, Cracker,Phreak etc.  This is
  686. a total give away.
  687.  
  688. The process of adding a user wont last very long the S.A will know when he
  689. checks out the /etc/passwd file
  690.  
  691. $sysadm moduser - This utility allows one to modify users.  DO NOT ABUSE!!
  692. !
  693.  
  694. Password:
  695.  
  696. This is what you'll see:
  697.  
  698. /----------------------------------------------------------------------------\
  699. MODIFYING USER'S LOGIN
  700.  
  701. 1)chgloginid  (This is to change the login ID)
  702. 2)chgpassword (Changing password)
  703. 3)chgshell (Changing directory DEFAULT = /bin/sh)
  704.  
  705. ENTER A NUMBER,NAME,INITIAL PART OF OF NAME,OR ? OR <NUMBER>? FOR HELP, Q TO
  706. QUIT ?
  707. \----------------------------------------------------------------------------/
  708.  
  709. Try every one of them out.Do not change someones password.It creates a havoc.
  710. If you do decide to change it.Please write the original one down somewhere
  711. and change back.Try not to leave to many traces after you had your fun.  In
  712. choice number 1 you will be asked for the login and then the new one.  In
  713. choice number 2 you will asked for the login and then supplied by it correct
  714. password and enter a new one.  In choice 3 this is used to a pchange the login
  715. shell ** Use full **  The above utilites can be used separatly for eg (To
  716. change a password one could enter: $sysadm chgpasswd not chapassword, The rest
  717. are same)
  718.  
  719. $sysadm deluser - This is an obviously to delete a user password:
  720.  
  721. This will be the screen output:
  722. /---------------------------------------------------------------------------\
  723. Running subcommand 'deluser' from menu 'usermgmt'
  724. USER MANAGEMENT
  725.  
  726. This fuction completely removes the user,their mail file,home directory and all
  727. files below their home directory from the machine.
  728.  
  729. Enter login ID you wish to remove[q]:      (eg.cathy)
  730. 'cathy' belongs to 'Cathy Franklin'
  731. whose home directory is /usr/cathy
  732. Do you want to remove this login ID 'cathy' ? [y,n,?,q] :
  733.  
  734. /usr/cathy and all files under it have been deleted.
  735.  
  736. Enter login ID you wish to remove [q]:
  737. \--------------------------------------------------------------------------/
  738. This command deletes everthing owned by the user.Again this would be stupid to
  739. use.
  740.  
  741.  
  742. Other Super User Commands
  743. ~~~~~~~~~~~~~~~~~~~~~~~~~
  744. wall [text] control-d  - to send an anouncement to users logged in (will
  745.                          override mesg -n command).  Execute only from /
  746. /etc/newgrp - is used to become a member of a group
  747.  
  748. sysadm [program name]
  749.         delgroup - delets groups
  750.         diskuse - Shows free space etc.
  751.         whoson - self explanatory
  752.         lsgroup - Lists group
  753.         mklineset -hunts various sequences
  754.  
  755.  
  756.                         Basic Networking Unility (BNU)
  757.                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  758.  
  759. The BNU is a unique feature in UNIX.Some systems may not have this installed.
  760. What BNU does is allow other remote UNIXes communicate with yours without
  761. logging off the present one.BNU also allowes file transfer between computers.
  762. Most UNIX systems V will have this feature installed.
  763.  
  764. The user program like cu,uux etc are located in the /usr/bin directory
  765.  
  766. Basic Networking Files
  767. ~~~~~~~~~~~~~~~~~~~~~~
  768. /usr/lib/uucp/[file name]
  769.  [file name]
  770.  systems - cu command to establishes link.Contains info on remote computers
  771.            name, time it can be reached, login Id, password, telephone numbers
  772.  devices - inter connected with systems files (Automatic call unit same in two
  773.            entries) also contains baud rate, port tty1, etc.
  774.  
  775.  dialers - where asscii converation must be made before file tranfers etc.
  776.  dialcodes - contains abreiviations for phone numbers that can be used in
  777.              systems file
  778.  
  779. other files are sysfiles, permissions, poll, devconfig
  780.  
  781. Logining On To Remote And Sending+Receiving Files
  782. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  783.  cu - This command allows one to log on to the local as well as the remote Unix
  784.       (or a non unix)without haveing to hang up so you can transfer files.
  785.       Usage:[options]
  786.  
  787.   $ cu [-s baud rate][-o odd parity][-e even parity][-l name of comm line]
  788.        telephone number | systemname
  789.  
  790.   To view system names that you can communicate with use the 'unname' command:
  791.   Eg. of output of names:
  792.  
  793.   ATT01
  794.   ATT02
  795.   ATT03
  796.   ATT04
  797.  
  798.  
  799. $ cu -s300 3=9872344 (9872344 is the tel)
  800.  connected
  801.  login:
  802.  password:
  803.  
  804. Local Strings
  805. ~~~~~~~~~~~~~
  806. <~.> - will log you off the remote terminal, but not the local
  807. <control-d> - puts you back on the remote unix local (the directory which you
  808.               are in)
  809. "%put [file name] - reverse of above
  810.  
  811. Ct
  812. ~~
  813. ct allows local to connect to remote.Initiates a getty on a remote terminal.
  814. Usefull when using a remote terminal.BNU has call back feature that allows the
  815. user on the remote who can execute a call back meaning the local can call the
  816. remote.[   ] are options
  817.  
  818. $ ct [-h prevent automatic hang up][-s bps rate][-wt set a time to call back
  819.      abbrieviated t mins] telephone number
  820.  
  821. Uux
  822. ~~~
  823. To execute commands on a remote (unix to unix)
  824. usage:[  ] are options
  825.  
  826. $ uux [- use standard output][-n prevent mail notification][-p also use
  827.       standard output] command-string
  828.  
  829. UUCP
  830. ~~~~
  831. UUCP copies files from ones computer to the home directory of a user in remote
  832. system.  This also works when copying files from one directory to another in
  833. the remote.  The remote user will be notified by mail.  This command becomes
  834. use full when copying files from a remote to your local system.  The UUCP
  835. requires the uucico daemon will call up the remote and will perform file login
  836. sequence, file transfer, and notify the user by mail.  Daemons are programs
  837. runining in the background.  The 3 daemons in a Unix are uucico, uusched,
  838. uuxqt.
  839.  
  840. Daemons Explained:  [nows a good time to explain the 3 daemons]
  841. ~~~~~~~~~~~~~~~~~
  842. Uuxqt - Remote execution.  This daemon is executed by uudemon.hour started by
  843.         cron.UUXQT searchs in the spool directory for executable file named
  844.         X.file sent from the remote system.  When it finds a file X .file where
  845.         it obtains process which are to be executed.  The next step is to find
  846.         weather the processes are available at the time.The if available it
  847.         checks permission and if everthing is o.k it proceeds the background
  848.         proccess.
  849.  
  850. Uucico - This Daemon is very immportant for it is responsible in establishing
  851.          a connection to the remote also checks permission, performs login
  852.          procedures,transfers + executes files and also notifies the user by
  853.          mail.  This daemon is called upon by uucp,uuto,uux commands.
  854.  
  855. Uusched - This is executed by the shell script called uudemon.hour.  This
  856.           daemons acts as a randomizer before the UUCICO daemon is called.
  857.  
  858.  
  859. Usage:
  860.  
  861. $ uucp [options] [first full path name!] file [destination path!] file example:
  862.  
  863. $ uucp -m -s bbss hackers unix2!/usr/todd/hackers
  864.  
  865. What this would do is send the file hackers from your computer to the remotes
  866. /usr/todd/hackers making hackers of course as file.  Todd would mail that a
  867. file has been sent to him.  The Unix2 is the name of the remote.  Options for
  868. UUCP:  (Don't forget to type in remotes name Unix2 in case)
  869. -c  dont copy files to spool directory
  870. -C  copy to spool
  871. -s[file name] - this file will contain the file status(above is bbss)
  872. -r  Dont start the comm program(uucico) yet
  873. -j  print job number(for above eg.unix2e9o3)
  874. -m  send mail when file file is complete
  875.  
  876. Now suppose you wanted to receive file called kenya which is in the
  877. usr/ dan/usa to your home directory /usr/john assuming that the local systems
  878. name is ATT01 and you are currently working in /usr/dan/usa,you would type in:
  879.  
  880. $uucp kenya ATT01!/usr/john/kenya
  881.  
  882. Uuto
  883. ~~~~
  884. The uuto command allows one to send file to remote user and can also be used to
  885. send files locally.
  886.  
  887. Usage:
  888.  
  889. $ uuto [file name] [system!login name]( omit systen name if local)
  890.  
  891.  
  892. Conclusion
  893. ~~~~~~~~~~
  894. Theres always more one can say about the UNIX, but its time to stop.  I hope
  895. you have enjoyed the article.  I apologize for the length.  I hope I made the
  896. UNIX operating system more familiar.  The contents of the article are all
  897. accurate to my knowledge.  Hacking into any system is illegal so try to use
  898. remote dial-ups to the job.  Remember do not abuse any systems you hack into
  899. for a true hacker doesn't like to wreck, but to learn.
  900.  
  901.    Watch for my new article on using PANAMAC airline computers coming soon.
  902.  
  903.                                   Red Knight
  904.                                     P/HUN!
  905.                                   <<T.S.A.N>>
  906. =========================================================================
  907.