home *** CD-ROM | disk | FTP | other *** search
/ Hacker Chronicles 1 / HACKER1.ISO / hack / bestunix.txt < prev    next >
Text File  |  1992-03-04  |  7KB  |  183 lines

  1.  
  2.              ***  My  Favourite  UNIX  Commands  ***
  3.           *** A List Of Some OF The Most Useful UNIX **
  4.      *** Hacking Commands, and Some Hints On Their Usage ***
  5.          ***  Written By ZeeBee Australia Inc. 1990 ***
  6.  
  7.      Ok UNIX freaks, here is a little list of helpful UNIX 
  8. commands and procedures which can be of much assistance in 
  9. gaining the fullest potential from any UNIX system.  
  10.  
  11. ---------------------------------------------------------------
  12.  
  13.      It is fun and often usefull to create a file that is owned 
  14. by someone else.  On most systems with slack security ie 99% of 
  15. all UNIX systems, this is quite easily done.  The chown command 
  16. will change any of your files to make someone else the owner. 
  17. Format is as follows:
  18.  
  19. chown ownername filelist
  20.  
  21.  Where ownername is the new owner, and filelist is the list of 
  22. files to change.  You must own the file which your are goin to 
  23. change, unless you are a superuser....then u can change ANYTHING!
  24.      chgrp is a similar command which will change the group 
  25. ownership on a file.  If you are going to do both a chown and a 
  26. chgrp on a file, then make sure you do the chgrp first!  Once the 
  27. file is owned by someone else, you cant change nything about it!
  28.  
  29. ---------------------------------------------------------------
  30.  
  31.      Sometimes just seeing who is on the system is a challenge in 
  32. itself.  The best way is to write your own version of who in C, 
  33. but if you can't do that then this may be of some help to you:
  34.  
  35.      who   followed by on or more of the following flags:
  36.  
  37.           -b Displays time sys as last booted.
  38.           -H Precedes output with header.
  39.           -l Lists lines waiting for users to logon.
  40.           -q displays number of users logged on.
  41.           -t displays time sys clock was last changed.
  42.           -T displays the state field (a + indicates it is 
  43. possible to send to terminal, a - means u cannot)
  44.           -u Give a complete listing of those logged on.
  45.  
  46.    **who -HTu is about the best choice for the average user**
  47.  
  48. ##by the way, the list of users logged on is kept in the file 
  49. /etc/utmp.  If you want to write your own personalised version of 
  50. who in C, you now know where to look!###
  51.  
  52. --------------------------------------------------------------- 
  53.  
  54.      When a users state field (see -T flag option for who 
  55. command) says that a user has their message function on, this 
  56. actually means that it is possible to get stuff onto their 
  57. screen.
  58.      Basically, every terminal on the system has a file 
  59. corresponding to it.  These files can be found in the /dev 
  60. directory.  You can to anything to these files, so long as you 
  61. have access -eg you can read them, and write to them, but you 
  62. will notice that they never change in size.  They are called 
  63. character specific files, and are really the link between the 
  64. system and the terminals.  Whatever you put in these files will 
  65. go staright to the terminal it corresponds to.
  66.      Unfortunately, on most systems, when the user logs in, the 
  67. "mesg n" command is issued which turns off write access to that 
  68. terminal, BUT- if you can start cating to that terminal before 
  69. system issues the mesg n command, then you will continue to be 
  70. able to get stuff up on that terminal! This has many varied uses.
  71.  
  72.      Check out the terminal, or terminal software being used.  
  73. Often you will be able to remotely program another users 
  74. terminal, simply by 'cating' a string to a users screen.  You 
  75. might be able to set up a buffer, capturing all that is typed, or 
  76. you may be able to send the terminal into a frenzy- (sometimes a 
  77. user will walk away without realizing that they are sill 
  78. effectively logged on, leaving you with access to their 
  79. account!).  Some terminal types also have this great command 
  80. called transmit screen. It transmits everything on the screen, 
  81. just as if the user had typed it !
  82.      So just say I wanted to log off a user, then I would send a 
  83. clear screen command (usually ctrl l), followed by "exit" 
  84. followed by a carriage return, followed by the transmit screen 
  85. code.  Using ths technique you can wipe peoples directories or 
  86. anything.  My favourite is to set open access on all their files 
  87. and directories so I can peruse them for deletion etc at my own 
  88. leisure).            
  89.  
  90. ---------------------------------------------------------------
  91.  
  92.      If you ever briefly get access to another persons account 
  93. eg. they leave the room to go to toilet or whatever, then simply 
  94. type the following:
  95.  
  96. chmod 777 $HOME
  97. chmod 777 $MAIL
  98.  
  99.      Then clear the screen so they dont see what you just typed.
  100.  
  101.      Now you can go look at their directory, and their mail, and 
  102. you can even put mail in their mail file. (just use the same 
  103. format as any mail that is already there!). Next time they log in 
  104. the system will automatically inform them they have new mail!
  105.  
  106. ---------------------------------------------------------------
  107.  
  108.      Another way to send fake mail to people is to use the mail 
  109. server.  This method produces mail that is slightly different to 
  110. normal, so anyone who uses UNIX a bit may be suspiscious when 
  111. they receive it, but it will fool the average dumb fuck user!
  112.  
  113. type telnet
  114.  
  115. the following prompt will appear:
  116.  
  117. telnet>
  118.  
  119. now type :
  120.  
  121. open localhost 25
  122.  
  123. some crap will come up about the mail server..now type:
  124.  
  125. mail from: xxxxxx     Put any name you want.
  126.  
  127. some more bullshit will come up. Now type:
  128.  
  129. rcpt to: xxxxxx  Put the name of the person to receive mail here.
  130.  
  131. now type:
  132.  
  133. data
  134.  
  135. now you can type the letter...end it with a "."
  136. type quit to exit once you are done.
  137.  
  138. -------------------------------------------------------------
  139.  
  140.      Heres one for any experimenters out there...
  141. It is possible to create files which simply cannot be deleted 
  142. from the standard shell.  To do this you will have to physically 
  143. CREATE THE FILE USING A C PROGRAM or SCRIPT FILE, and you will 
  144. have to use a sequence of control characters which cannot be 
  145. typed from the shell.  Try things like Ctrl-h (this is the 
  146. code for the delete key).  Just a file with the name Ctrl-h would 
  147. not be deleteable from the shell, unless you used wildcards. So, 
  148. make it a nice long series of characters, so that to delete the 
  149. file, the user has no choice but to individually copy all his 
  150. files elsewhere, then delete everything in his directory, and 
  151. then copy all his files back.....this is one of my 
  152. favourites..gets em every time!
  153.      
  154.      The following script file is an example which will create a 
  155. file with the name Ctrl-h.  You MUST tyoe this file in using the 
  156. vi editor or similar.
  157. *****If you are not very good with vi, type "man vi" and print the 
  158. help file...it even contains stuff that I find useful now and 
  159. then.*****
  160.  
  161. type the following in vi...
  162.  
  163. echo'' > 'a^h'
  164.  
  165.   ***NOTE...to get the ^h (this really means ctrl-h) from vi type:
  166.  
  167. Ctrl v
  168. Ctrl h 
  169.  
  170.   The Ctrl v instrcts vi to take the next character as a ascii 
  171. character, and not to interpret it.
  172.      change the access on the file you just created and now 
  173. execute it.  It will create a file which looks like it is called 
  174. a, but try to delete it !..use wildcards if you really want to 
  175. delete it. 
  176.  
  177. ----------------------------------------------------------------
  178.  
  179. Watch for more in the ZeeBee UNIX (ab)usage series.
  180.  
  181. Downloaded From P-80 Systems 304-744-2253
  182.  
  183.