

			Basic Unix Information


			

			     Darksoul
	

I am NOT responsible with what you do with this information, this is for EDUCATIONAL purposes only

so dont go out and do this, get caught, and blame it on me coz i warned you, so its your ass, not mine! :-)




	Identifying a Unix OS on the net

Well, all you have to do is telnet to port 23 and it should tell you, ex:

$ telnet somewhere.com
trying somewhere.com....

Redhat Linux 5.2 (Apollo) 2.0.36

username:somedude
password:*****

last login oct 31 from 187.145.152.161

$

See, it is a redhat linux 5.2 with a 2.0.36 kernel, pretty up-to-date as of right now!

the $ is supposed to be the command prompt, where you type in commands.


-----------------------------------------------------------------------------

Here are some basic Unix/Linux commands and their discriptions:

ls (lists the contents of your current directory)

ls -a (lists ALL files in current directory, including hidden ones)

ls -l (lists files in current directory along with their permissions)

rm (delete a file)

rmdir (delete a directory)

mkdir (makes a directory)

cp (copies a file ex:cp /etc/passwd $HOME)

cd (switch to another directory)

cp -R (copy a directory ex:cp -R /etc $HOME not a wise choice tho!)

mv (moves or renames a file)

startx (starts up the X windowing system)

telnet (telnet to another computer ex: telnet oemcomputer.com)

ftp (File Transfer Protocol, it is basicly a program that lets you send and 
receive files from another computer)

pine (a mail program to receive and send email)

mail (another mail program)

elm (you guessed it, another mail program, cant have too many, huh?:-))

gcc (C compiler, compiles source codes written in the C lang)

g++ (C++ compiler, compiles source codes written in the C++ lang, the ++ is the 
C mathimatical operator that adds one to the current varible, it is saying "Add one to whatever!" ex: C++ = C+1 so really
C++ stands for taking C up to the next level, or adding one to it, C++ is the newer version of C)

su (assume identity of user)

rlogin (remote login, login remotely to other computers)

finger (get information about other users on your network or on others)

talk (talk to a user on your network or on another eg: talk root@anotherhost.com)

write (send a message to another user)

cal (calendar)

f77 (fortran, which stands for Formula Translation for all you techy's, compiler, it compiles
source codes written in fortran)

irc (enter the IRC or Internet Relay Chat and talk to other people)

env (see the status of your account)

ps (see the command processes)

kill (kill the command processes ex: kill -9 -1)

touch (makes an empty file)

des (encrypt or decrypt data using Data Encryption Standard, or DES)

crypt (basicly the same thing as DES)

uuencode (encode a file in binary)

uudecode (decode a file in binary)

chmod (change a file permission)

chgrp (changes group owner, not good to mess with this too much)

sh (switch to sh)

bash (switch to bash)

csh (switch to csh)

tcsh (switch to tcsh)

python (python compiler)

showmount -e (see a sites export list)

mount (mount a file system, ex: mount /dev/cdrom /mnt)

traceroute (trace the route of an ip or hostname)

pico (text editor for beginners)

vi (text editor for advanced users)

emacs (text editor for advanced users)

ed (text editor for beginners)
--------------------------------------------------------------------------

		Deleting Your Shell History File

	OK, heres the deal, you get a shell account, legal or not, but you do some

hackish things, and you dont want the root dude to see them, the best bet would be

to use sh, since they dont keep log files, but if you are forced to use another kind

of shell, delete the history file.  The files go as follows:

bash= .bash_history

tcsh= .tcsh_history

csh = .sh_history

I am not too sure about those, since i usually use bash or sh.  A better idea would be to go in

to the bash configuration file, and put in unset HISTFILE and life is easy!

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


Also, if you root the box (get root, for those of you who don't know, means to 

hack the super user, or main dude of the system, if you do that you are god on that

system, the log files are usually in /var/log or something of the sort.
---------------------------------------------------------------------------

		Unix Directories


 The unix directories go as follows:



		/root
-----------------------------------------------
  |      |     |     |      |     |     |  
 /bin  /dev  /etc  /home  /lib  /tmp  /usr

/root= the super users home directory, where he keeps config files, his files, and about 

anything else he wants to!

/bin= where all of the programs that are used everyday, like ls, is stored.

/dev= where the device drivers and devices are installed, usually the cdrom is /dev/cdrom
and the floppy disk is /dev/fd0

/etc= where the system loggers, passwd and sometimes shadow files, the ppp directory is kept

/home= all of the users home directories, where the users work, ex: john works in /home/john

/lib= often in modern UNIX systems this directory is simply a link to /usr/lib

/tmp= where users temporairly store files

/usr= contains files shared by all the users
 

OK, so that about does it for system directories and their contents! 

-----------------------------------------------------------------------------

		File Permissions


Well, it is that special time when all young newbies must learn file permissions, they are not that hard, so dont worry!

d = directory

r = readable

w = writable

x = executable

lets take this example:

-rwxrwxrwx  that is a file permission!  Beautiful, aint it? :-)

the first part of any file permission is the user, second is group and third is other (everyone).

another example:

-rwxr--r--

this is readable, writable, and executable for the user, but only readable by the group, and other.

see, not so hard, is it?

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.

brw---------

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.

----------------------------------------------------------------------------

			rlogin

OK, you want to use rlogin?  well, i am gonna tell you how and some secrets about it also!

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

lets just learn how to user rlogin

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

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! 

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

.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.

-----------------------------------------------------------------------------

			  telnet

Ok, you dont want to use rlogin or cant use rlogin, telnet, your faithful friend, is always there to make

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

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) 

contacts your root dude and tells him, root will be snooping around and see that and bye bye Mr. Hacker!

Just type in telnet and enter

then open hostcomputer portnumber example:

telnet <enter>

open nowhere.com 23

and there you have it, just login there under your cracked account.

Note: You will want to telnet thru 2 or more hosts before going into your cracked

account so your IP will be hidden by the other hosts, they can still track you down, but it is unlikely they 

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.

-----------------------------------------------------------------------------


				FTP (File Transfer Protocol)

	ok, to use ftp, it is quite simple, type in ftp, press enter, and open and the host computer, example:

ftp <enter>

open nowhere.com

thats it for FTP!

-----------------------------------------------------------------------------

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,

this was just to teach you about unix, not really about hacking unix! :-) that will come later)



Knowledge is Power, and with power comes a responsibility.

Darksoul

http://homepages.hack-net.com/theden/darksoul/

darksouls_domain@hotmail.com

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

my permission. 