home *** CD-ROM | disk | FTP | other *** search
/ Hackers Handbook - Millenium Edition / Hackers Handbook.iso / library / hack99 / bunixh.txt < prev    next >
Encoding:
Text File  |  1999-04-11  |  9.3 KB  |  320 lines

  1.  
  2.  
  3.             Basic Unix Information
  4.  
  5.  
  6.             
  7.  
  8.                  Darksoul
  9.     
  10.  
  11. I am NOT responsible with what you do with this information, this is for EDUCATIONAL purposes only
  12.  
  13. so dont go out and do this, get caught, and blame it on me coz i warned you, so its your ass, not mine! :-)
  14.  
  15.  
  16.  
  17.  
  18.     Identifying a Unix OS on the net
  19.  
  20. Well, all you have to do is telnet to port 23 and it should tell you, ex:
  21.  
  22. $ telnet somewhere.com
  23. trying somewhere.com....
  24.  
  25. Redhat Linux 5.2 (Apollo) 2.0.36
  26.  
  27. username:somedude
  28. password:*****
  29.  
  30. last login oct 31 from 187.145.152.161
  31.  
  32. $
  33.  
  34. See, it is a redhat linux 5.2 with a 2.0.36 kernel, pretty up-to-date as of right now!
  35.  
  36. the $ is supposed to be the command prompt, where you type in commands.
  37.  
  38.  
  39. -----------------------------------------------------------------------------
  40.  
  41. Here are some basic Unix/Linux commands and their discriptions:
  42.  
  43. ls (lists the contents of your current directory)
  44.  
  45. ls -a (lists ALL files in current directory, including hidden ones)
  46.  
  47. ls -l (lists files in current directory along with their permissions)
  48.  
  49. rm (delete a file)
  50.  
  51. rmdir (delete a directory)
  52.  
  53. mkdir (makes a directory)
  54.  
  55. cp (copies a file ex:cp /etc/passwd $HOME)
  56.  
  57. cd (switch to another directory)
  58.  
  59. cp -R (copy a directory ex:cp -R /etc $HOME not a wise choice tho!)
  60.  
  61. mv (moves or renames a file)
  62.  
  63. startx (starts up the X windowing system)
  64.  
  65. telnet (telnet to another computer ex: telnet oemcomputer.com)
  66.  
  67. ftp (File Transfer Protocol, it is basicly a program that lets you send and 
  68. receive files from another computer)
  69.  
  70. pine (a mail program to receive and send email)
  71.  
  72. mail (another mail program)
  73.  
  74. elm (you guessed it, another mail program, cant have too many, huh?:-))
  75.  
  76. gcc (C compiler, compiles source codes written in the C lang)
  77.  
  78. g++ (C++ compiler, compiles source codes written in the C++ lang, the ++ is the 
  79. C mathimatical operator that adds one to the current varible, it is saying "Add one to whatever!" ex: C++ = C+1 so really
  80. C++ stands for taking C up to the next level, or adding one to it, C++ is the newer version of C)
  81.  
  82. su (assume identity of user)
  83.  
  84. rlogin (remote login, login remotely to other computers)
  85.  
  86. finger (get information about other users on your network or on others)
  87.  
  88. talk (talk to a user on your network or on another eg: talk root@anotherhost.com)
  89.  
  90. write (send a message to another user)
  91.  
  92. cal (calendar)
  93.  
  94. f77 (fortran, which stands for Formula Translation for all you techy's, compiler, it compiles
  95. source codes written in fortran)
  96.  
  97. irc (enter the IRC or Internet Relay Chat and talk to other people)
  98.  
  99. env (see the status of your account)
  100.  
  101. ps (see the command processes)
  102.  
  103. kill (kill the command processes ex: kill -9 -1)
  104.  
  105. touch (makes an empty file)
  106.  
  107. des (encrypt or decrypt data using Data Encryption Standard, or DES)
  108.  
  109. crypt (basicly the same thing as DES)
  110.  
  111. uuencode (encode a file in binary)
  112.  
  113. uudecode (decode a file in binary)
  114.  
  115. chmod (change a file permission)
  116.  
  117. chgrp (changes group owner, not good to mess with this too much)
  118.  
  119. sh (switch to sh)
  120.  
  121. bash (switch to bash)
  122.  
  123. csh (switch to csh)
  124.  
  125. tcsh (switch to tcsh)
  126.  
  127. python (python compiler)
  128.  
  129. showmount -e (see a sites export list)
  130.  
  131. mount (mount a file system, ex: mount /dev/cdrom /mnt)
  132.  
  133. traceroute (trace the route of an ip or hostname)
  134.  
  135. pico (text editor for beginners)
  136.  
  137. vi (text editor for advanced users)
  138.  
  139. emacs (text editor for advanced users)
  140.  
  141. ed (text editor for beginners)
  142. --------------------------------------------------------------------------
  143.  
  144.         Deleting Your Shell History File
  145.  
  146.     OK, heres the deal, you get a shell account, legal or not, but you do some
  147.  
  148. hackish things, and you dont want the root dude to see them, the best bet would be
  149.  
  150. to use sh, since they dont keep log files, but if you are forced to use another kind
  151.  
  152. of shell, delete the history file.  The files go as follows:
  153.  
  154. bash= .bash_history
  155.  
  156. tcsh= .tcsh_history
  157.  
  158. csh = .sh_history
  159.  
  160. I am not too sure about those, since i usually use bash or sh.  A better idea would be to go in
  161.  
  162. to the bash configuration file, and put in unset HISTFILE and life is easy!
  163.  
  164. I think one of the bash configuration file is .bashrc and/or .login, either way, it wouldnt hurt to put a unset HISTFILE in them
  165.  
  166.  
  167. Also, if you root the box (get root, for those of you who don't know, means to 
  168.  
  169. hack the super user, or main dude of the system, if you do that you are god on that
  170.  
  171. system, the log files are usually in /var/log or something of the sort.
  172. ---------------------------------------------------------------------------
  173.  
  174.         Unix Directories
  175.  
  176.  
  177.  The unix directories go as follows:
  178.  
  179.  
  180.  
  181.         /root
  182. -----------------------------------------------
  183.   |      |     |     |      |     |     |  
  184.  /bin  /dev  /etc  /home  /lib  /tmp  /usr
  185.  
  186. /root= the super users home directory, where he keeps config files, his files, and about 
  187.  
  188. anything else he wants to!
  189.  
  190. /bin= where all of the programs that are used everyday, like ls, is stored.
  191.  
  192. /dev= where the device drivers and devices are installed, usually the cdrom is /dev/cdrom
  193. and the floppy disk is /dev/fd0
  194.  
  195. /etc= where the system loggers, passwd and sometimes shadow files, the ppp directory is kept
  196.  
  197. /home= all of the users home directories, where the users work, ex: john works in /home/john
  198.  
  199. /lib= often in modern UNIX systems this directory is simply a link to /usr/lib
  200.  
  201. /tmp= where users temporairly store files
  202.  
  203. /usr= contains files shared by all the users
  204.  
  205.  
  206. OK, so that about does it for system directories and their contents! 
  207.  
  208. -----------------------------------------------------------------------------
  209.  
  210.         File Permissions
  211.  
  212.  
  213. Well, it is that special time when all young newbies must learn file permissions, they are not that hard, so dont worry!
  214.  
  215. d = directory
  216.  
  217. r = readable
  218.  
  219. w = writable
  220.  
  221. x = executable
  222.  
  223. lets take this example:
  224.  
  225. -rwxrwxrwx  that is a file permission!  Beautiful, aint it? :-)
  226.  
  227. the first part of any file permission is the user, second is group and third is other (everyone).
  228.  
  229. another example:
  230.  
  231. -rwxr--r--
  232.  
  233. this is readable, writable, and executable for the user, but only readable by the group, and other.
  234.  
  235. see, not so hard, is it?
  236.  
  237. if you ever see a c in a file permission, it means that it is a character special file, and a b means it is a block special file.
  238.  
  239. brw---------
  240.  
  241. this one is a block special file that is only readable by the user.  The user, by the way, is the person who owns the file, the group is the group owner of the file, and other is everyone.
  242.  
  243. ----------------------------------------------------------------------------
  244.  
  245.             rlogin
  246.  
  247. OK, you want to use rlogin?  well, i am gonna tell you how and some secrets about it also!
  248.  
  249. the shell you want to rlogin to must have a file in the users home directory called .rhosts, this file is VERY important, and I will tell you why in a moment, right now
  250.  
  251. lets just learn how to user rlogin
  252.  
  253. ok, type in rlogin -l username host.com i think that is the correct format..i am not sure i never use it much myself, i am a telnet man! :-D
  254.  
  255. If you are doing this on a shell account you hacked, or just hacked into a shell account and saw the .rhosts file, get back in there and change it! 
  256.  
  257. To ensure that you can get in without even knowing the password if the person changes it but overlooks the .rhosts file, go in and erase everything and type in a + + that is a plus space plus in the
  258.  
  259. .rhosts file, then save the file and there you have it! you can rlogin to the shell without a passwd now unless someone changes it back.
  260.  
  261. -----------------------------------------------------------------------------
  262.  
  263.               telnet
  264.  
  265. Ok, you dont want to use rlogin or cant use rlogin, telnet, your faithful friend, is always there to make
  266.  
  267. everything better.  To use telnet in a unix/linux shell, many people say to type in telnet yourhost port number example: telnet nowhere.com 23
  268.  
  269. DONT DO IT!  If you are using bash, or sh might be just a link to bash, it will log where you telneted to in the history and if the root dude at nowhere.com (the place you hacked) 
  270.  
  271. contacts your root dude and tells him, root will be snooping around and see that and bye bye Mr. Hacker!
  272.  
  273. Just type in telnet and enter
  274.  
  275. then open hostcomputer portnumber example:
  276.  
  277. telnet <enter>
  278.  
  279. open nowhere.com 23
  280.  
  281. and there you have it, just login there under your cracked account.
  282.  
  283. Note: You will want to telnet thru 2 or more hosts before going into your cracked
  284.  
  285. account so your IP will be hidden by the other hosts, they can still track you down, but it is unlikely they 
  286.  
  287. will if you didnt cause any problems, they probably wont go thru all the trouble if you go in, dont harm anything, and leave quietly.
  288.  
  289. -----------------------------------------------------------------------------
  290.  
  291.  
  292.                 FTP (File Transfer Protocol)
  293.  
  294.     ok, to use ftp, it is quite simple, type in ftp, press enter, and open and the host computer, example:
  295.  
  296. ftp <enter>
  297.  
  298. open nowhere.com
  299.  
  300. thats it for FTP!
  301.  
  302. -----------------------------------------------------------------------------
  303.  
  304. Thats about it for now, keep an eye out for other texts i will write about unix hacking ( i know this hasnt been the best unix hacking text in the world, but it wasnt ment to be,
  305.  
  306. this was just to teach you about unix, not really about hacking unix! :-) that will come later)
  307.  
  308.  
  309.  
  310. Knowledge is Power, and with power comes a responsibility.
  311.  
  312. Darksoul
  313.  
  314. http://homepages.hack-net.com/theden/darksoul/
  315.  
  316. darksouls_domain@hotmail.com
  317.  
  318. This article can be distributed as many times as you want just as long as you leave this section here (that includes my name and email addy) and please dont change anything on this text without
  319.  
  320. my permission.