⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 an indepth guide in hacking unix and the concept of basic net.txt

📁 黑客培训教程
💻 TXT
📖 第 1 页 / 共 3 页
字号:
-rwxr-x--- is read in triples of 3.The first chracter eg(-,d,b,c)-means asfollows: - is an ordinary file ,d is a directory,b is block file,c is achracter file.The r stands for read permission,w is write permission,x is execute.The firstcolum is read in 3 triples as stated above.The first group of 3 (in -rwxr-x---)after the "-" specifies the permission for the owner of the file,the secondtriple are for the groups (the fourth colum) and the last triple are the      permissions for all other users.Therefore the -rwxr-x--- is read as follows.The owner john has permission to read,write and execute anything in the bindirectory but the group has no write permission to it and the rest of the usershave no permission at all.The format of one of the lines in the above outputis as follows:file type-permissions,links,usersname,group,bytes taken,date,time when lastrenued,directory or file name.**You will be able to read,execute cathys file named party due to the samegroup***chmod                    -----             The chmod command changes permission of a directory or a file.Format ischmod who+,-,=r,w,xThe who is substituted by u-user,g-group,o-other users,a-all.The + means add permission,- means remove permission,= - assign.  Example :If you wanted all other users to read the file name mail ,type:   $ chmod o+r mail cat         ---          Now suppose you wanted to read the file letter .There are teo ways to doingthis.First go to the michelle directory then type in:$ cat letterline one ...\line two ... }the output of letterline three../$   orIf you are in the parent directory type in:$ cat /usr/john/michelle/letterand you will have the same output.Some cat options are  -s,-u,-v,-e,-tSpecial Chracters in Unix:-------------------------*  - matches any number of single characters eg. ls john* will list     all files that begin with john[...] - matchs any one of the chracter in the [ ]? - matches any single chracterruns a process in the backgroung leaving your terminal free$ - Values used for variables also $n - null argument> - redirectes output< - redirects input to come from a file>> - redirects command to be added to the end of a file| - pipe output (eg:who|wc-l tells us how many users are online)"..." - Turn of meaning of special chracters excluding $,``...` - allows command output in to be used in a command line'...' - turns of special meaning of all chracterscontinuation of local commands...[     ] -contains the options used------------------------------- passwd------Password changing seems to be a big thing among the savants.Anyway to changethe password one would use the 'passwd' command as shown below:   $passwd   Changing password for john   Old password:                                 New password:                                 Retype new password:   $  This will only work when the password has aged enoughps--Its sometimes necessary to see what command procesess you are running,thiscommand lets you see that.ps [-a all processes except group leaders] [-e all processes] [-f the whole   list]                                                              $ps   PID   TTY  TIME   COMMAND   200   tty09 14:20  ps   The systems reports (PID - process idenetification number which is a #   from 1-30,000 assigned to UNIX processes)   It also reports the TTY,TIME and the COMMAND being executed at the time.   To stop a process enter :       $kill [PID] (this case its 200)   200 terminated   $grep----This comand is important when seaching for a word or words in large files.grep [argument] [file name] - searchs for an file that contains the argument                              for example:   $ grep phone cathy    phone   michelle  (718)5551234    phone   cindy   (718)5553456    What this did was to find the argument 'phone' in the file cathy.If the    argument consists of two or more words then  it must be enclosed in single    quotes.mv--mv [file names(s)] [ dir name ] - renames a file or moves it to another                                       directory eg.         $mv letter letters    $   This renames the file letter to letters thereby deleting letter                  or if you want to move files then   $mv /usr/john/pers/capital /usr/john/michelle/capital   $      This moves the file capital to the directory named michellediff----diff [file name] [ file name] - show diffrence between two files.Output of this                                will have something like 4,5c4,5 then the it                                will display both sets of files on the screen                                The 4,5c4,5 means that you must change "c"                                lines 4 to 5 in one file to line 4 to 5 in                                   another.      Option for using this command are :       -b  -  it ignores blank spaces       -h  - compares it quickly       -s  - reports files that are the same       -S[file] - this is when you want to compare a directory starting at a                  specific file              There is also a command to compare 3 files which is :           diff3 [options] [file1] [file2] [file3]cp--cp [file name] [file name] - makes a copy of a file   $ cp letter letters   $   The file letters is a dupilcate copy of letter.In this case the original   is not erased like in the mv command.... more UNIX commands:--------------------man [command] or [c/r] -will give you a list of commands explainationshelp - available on some UNIX systems                  mkdir [dir name(s)] - makes a directory      rmdir [dir name(s)] - removes directory.You wont be able to remove the                      directory if it contains files in themrm [file name(s)] - removes files. rm * will erase all files in the current                    dir.Be carefull you!!.Some options are :                                    [-f unconditional removal] [-i Prompts user for y or n]                        write [login name ] - to write to other logged in users.Sort of a chatmesg [-n] [-y] - doesn't allow others to send you messages using the write                 command.Wall used by system adm overrides it.$ [file name] - to execute any filewc [file name] - Counts words,chracters,lines in a filestty [modes] - Set terminal I/O for the current devicessort [filename] - Sorts and merges files many optionsspell [file name] > [file name] - The second file is where the misspelt words                                  are entereddate [+%m%d%y*] [+%H%%M%S] - Displays date acoording to optionsat [-r] [-l] [job] - Does a specified job at a specified time.The -r Removes                      all previously scheduled jobs.The -l reports the job #                     and status of all jobs scheduledwrite [login] [tty] - Sends message to the login name.Chat!su [login name]---------------The su command allows one to switch user to a super user to a user.Veryimportant could be used to switch to super user accounts.Usage:                                                $ su sysadmpassword:This su command will be monitored in /usr/adm/sulog and this file of all filesis carefully monitered by the system administrator.Suppose you hacked in johnsaccount and then switched to the sysadm account (ABOVE) your /usr/adm/sulogentry would look like:SU  04/19/88  21:00 + tty 12 john-sysadmTherfore the S.A(system administrator) would know that john swithed to sysadmaccount on 4/19/88 at 21:00 hoursSearching for valid login names:   -------------------------------Type in-$ who  ( command informs the user of other users on the system)cathy  tty1  april 19  2:30john   tty2  april 19  2:19dipal  tty3  april 19  2:31::tty is the users terminal,date,time each logged on.dipal,john are validlogins.   Files worth concatenating(cat)/etc/passwd file:                    -----------------                     The etc/passwd is a vital file to cat.For it contains login names of allusers including super user accounts and there passwords.In the newer          SVR3 releases they are tighting their security by moving the encryptedpasswords from /etc/passwd to /etc/shadow making it only readable by root.This is optional offcourse.$ cat /etc/passwdroot:D943/sys34:0:1:0000:/:sysadm:k54doPerate:0:0:administration:usr/admin:/bin/rshcheckfsys:Locked;:0:0:check file system:/usr/admin:/bin/rsh:other super user accs.:john:chips11:34:3:john scezerend:/usr/john::other users:$If you have reached this far capture this file as soon as posible.This is a typical output etc/passwd file.The entries are seperatedby a ":".There made be up to 7 fields in each line.Eg.sysadm account.The first is the login name in this case sysadm.The second field contains thepassword.The third field contains the user id."0 is the root".Then comes thegroup id then the account which contains the user full name etc .The sixthfield is the login directory defines the full path name of the the particlar account and the last is the program to be executed.          Now one can switch to other super user account using su command descibed above.The password entry in the field of the checkfsys account in the above exampleis "Locked;". This doesn't mean thats its a password but the accountcheckfsys cannot be accessed remotely.The ";" acts as an unused encryptionchracter.A space is also used for the same purpose.You will find this in manyUNIX systems that are small systems where the system administrator handlesall maintaince.  Password aging:  ---------------If password aging is active the user is forced to change the password at    regular intervals.One may be able to tell just by looking at the /etc/passwdfile when the password is allowed to be changed and when it is compulsory tochange it.For example the entry:john:chips11,43:34:3:John Scezerend:/usr/john:The password contains an extension of (,43) which mean that john can change hasto change the password atleast evert 6 weeks and can keep it for atleast 3week.The format used is [password],Mmww.The M is the maxiumum number of weekspassword has to be change and m is the minimum interval password can be changedand the ww is indicates when the password was last changed.    Aging chart:---------|-----------Character|# of weeks    .    |  0    /    |  1 0-9     | 2-11 A-Z     | 12-37 a-z     | 38-63---------|-----------From the above anyone can determine the number of weeks one can chnage the    password.         The (ww) is automatically added as to when the password was last changed .   IF SHAWDOWING IS ACTIVE:------------------------If the shawdowing is active the /etc/passwd would look like this:root:x:0:1:0000:/:sysadm:x:0:0:administration:/usr/admin:/bin/rshThe password filed is substituted by "x".The /etc/shawdow file only readable by root will look similar tothis:root:D943/sys34:5288:::super user accounts:Cathy:masai1:5055:7:120:all other users:  The first field contains users id:the second contains the password(The pw willbe NONE if logining in remotely is deactivated):the third contains a code ofwhen the password was last changed:the fourth and the fifth contains the minimum and the maximum numbers of days for pw changes(Its rare that you willfind this in the super user logins due to there hard to guess passwords)  /etc/options directory-----------------------The etc/options dir will consists of utilities available in the system.Example:                  -rwxr-xr-x   1 root  sys   40 april  1:00  uucp.name                uucp standing for BNU/etc/group-----------The file has each group on the system.Each line will have 4 entries separatedby a ":" . Example of concatenated /etc/group:root::0:rootadm::2:adm,rootbluebox::70:Group name:password:group id:login names** It very unlikely that groups will have passwords assigned to them **The id "0" is assigned to /Sending and recieving messages:-------------------------------Two programs are used to manage this.They are mail & mailx.The differencebetween them is that mailx is more fancier thereby giving you many choiceslike replying message ,using editors etc.Sending:--------  The basic format for using this command is:$mail [login(s)](now one would enter the textafter finishing enter "." a periodon the next blank line)$This command is also used to send mail to remote systems.Suppose you wantedto send mail to john on a remote called ATT01you would type in:$mail ATT01!john

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -