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

📄 unix use and security from the ground up.htm

📁 黑客培训教程
💻 HTM
📖 第 1 页 / 共 5 页
字号:
        $rm      -This deletes a file. Syntax: "rm <filename>".        Example:        $rm junk        $cp      -Copies a file. Syntax: "cp file1 file2", where file1 is the file you        wish to copy, and file2 is the name of the copy you wish to create. If         file2 already exists, it will be overwritten. You may specify pathnames        for one or both arguments.        Example:        $cp /usr/junk /usr/junk.backupstty    -Displays/sets your terminal characteristics. To display the current         settings, type "stty". To change a setting, specify one of the options        listed below.   Options:   echo         -System echoes back your input.   noecho       -System doesn't echo your input.   intr 'arg'   -Sets the break character. The format is '^c' for control-c,                 etc. '' means no break character.   erase 'arg'  -Sets the backspace character. Format is '^h' for control-h,                etc. '' means no backspace character.   kill 'arg'   -Sets the kill character (which means to ignore the last line                you typed). Format is the same as for intr and erase,                 '^[character]', with '' meaning no kill character.        Example:        $stty intr '^c' erase '^h'        $stty        stty -echo intr '^c' erase '^h' kill '^x'        lpr     -This command prints out a file on the Unix system's printer, for you         to drop by and pick up (if you dare!) The format is "lpr <filename>".        Example:        $lp junked      -This is a text file line editor. The format is "edit <filename>". The         file you wish to modify is not modified directly by the editor; it is         loaded into a buffer instead, and the changes are only made when you         issue a write command. If the file you are editing does not already         exist, it will be created as soon as issue the first write command.         When you first issue the edit command, you will be placed at the        command prompt, ":" Here is where you issue the various commands. Here        is list of some of the basic editor commands.        #       -This is any number, such as 1, 2, etc. This will move you down                 to that line of the file and display it.        d       -This deletes the line you are currently at. You will then be                moved to the previous line, which will be displayed.        a       -Begin adding lines to the file, just after the line that you                 are currently on. This command will put you in the text input                mode. Simply type in the text you wish to add. To return to the                command mode, type return to get to an empty line, and press                the break key (which is whatever character you have set as your                break key). It is important to set the break character with                 stty before you use the editor!        /       -Searches for a pattern in the file. For example, "/junk" would                search the file from your current line down for the first line                which contains the string "junk", and will move you to that                 line if it finds one.        i       -Insert. Works similar to a, except that the text is inserted                before the line you are currently on.        p       -Prints out a line or lines in the buffer. "p" by itself will                display your current line. "#p" will display the line "#".                 You may also specify a range of lines, such as "1,3p" which                will display lines 1-3. "1,$p" will print out the entire file.        w       -Write the changes in the buffer to the file.        q       -Quit the editor.        Example:        $edit myfile        Editing "myfile" [new file]        0 lines, 0 characters        :a        I am adding stupid text to myfile.        This is a test.        ^c [this is assumed as a default break character in this example]        :1,$p        I am adding stupid text to myfile.        This is a test.        :2        This is a test.        :d        I am adding stupid text to myfile.        :w        :q        $grep    -this command searches for strings of text in text files. The format is        grep [string] [file]. It will print out every line in the file that          contains the string you specified.        Options:        v       -Invert. This will print out every line that DOESN'T contain                the string you specified.        Example:        $ grep you letter        your momma!        I think you're going to get caught.        $who     -This will show the users currently logged onto the system.        Example:        $ who        root    console Mar 10  01:00        uucp    contty  Mar 30  13:00        bill    tty03   Mar 30  12:15        $        Now, to explain the above output: the first field is the username of         the account. The second field shows which terminal the account is on.        Console is, always, the system console itself. On many systems where        there is only one dialup line, the terminal for that line is usually         called contty. the tty## terminals can usually be either dialups or        local terminals. The last fields show the date and time that the user        logged on. In the example above, let's assume that the current time and        date is March 30, and the time is 1:00. Notice that the time is in 24         hour format. Now, notice that the root (superuser) account logged in on        March 10! Some systems leave the root account logged in all the time on        the console. So, if this is done on a system you are using, how can you        tell if the system operator is really online or not? Use the ps         command, explained next.ps      -This command displays information about system processes.        Options:        u       -this displays information on a specific user's processes. For                instance, to display the root account's processes:                $ ps -uroot                PID     TTY     TIME    CMD                1234    console 01:00   sh                1675    ?       00:00   cron                1687    console 13:00   who                1780    tty09   12:03   sh                Now, to explain that: The first field is the process number.                 Each and every time you start a processes, running a program,                issueing a command, etc., that process is assigned a unique                 number. The second is which terminal the process is being run                on. The third field is when the process was started. The last                field is the base name of the program or command being run.                A user's lowest process number is his login (shell) process.                Note that the lowerst process in the above example is 1234.                 This process is being run on the console tty, which means the                superuser is logged on at the system console. Note the ? as the                tty in the next entry, for the cron process. You can ignore any                processes with a question mark as the terminal. These processes                are not bewing carried out by a user; they are being carried                out by the system under that user's id. Next, note the entry                for process # 1687, on the console terminal, "who". this means                that the superuser is executing the who command...which means                he is currently actively on-line. The next entry is interest-                ing...it shows that the root user has a shell process on the                 terminal tty09! This means that someone else is logged in                under the root account, on tty09. If more than one person is                using an account, this option will display information for all                of them, unless you specify the next option...        t       -This allows you to select processes run on a specific term-                inal. For example:                $ps -t console                will show all the processes currently being run on the console.                Example:                Remember, options can usually be combined. This will show all                the root user's processes being run on the system console:                $ ps -uroot -tconsole                PID     TTY     TIME    CMD                1234    console 01:00   sh                1687    console 13:00   who                $kill    -Kills processes. Syntax: kill [-#] process#. You must know the process        number to kill it. You can, optionally, specify an option of 1-9, to        determine the power of the kill command. Certain kinds of processes,        like shell processes, require more power to kill. Kill -9 will stop any        process. You must have superuser capabilities fo kill another user's        processes (unless he's using your account).        Example:        $kill -9 1234        1234 killed.        $write   -This command is for on-line realtime user to user communications. To         communicate with a user, type "write <username>". If more than one        person is logged in under that user name, you must specify a specific        terminal you wish to speak to. When you do this, the person you wish        to communicate with will see:        Message from [your account name] tty## [<--your terminal]        Now you can type messages, and they will be displayed on that person's        terminal when you press return. When you are finished, press control-D        to quit.        Example:        $ write root        Fuck you I'm a hacker!  [This is not advised.]        ^d        $mail    -The Unix mail facilities, used to send/receive mail. To send mail,         type "mail <username>". Enter your message and press control-d to send.        To read your mail, type "mail". Your first letter will be displayed,        and then you will be given a "?" prompt.          Here are the legal commands you give at this point:         ##      -Read message number ##.        d       -Delete last message read.        +       -Go to next message.        -       -Move back one message.        m       -Send mail to user.        s       -Save last message read. You can specify the name of the file                to which it is saved, or it will be saved to the default file,                mbox.        w       -Same as s, but will save the message without the mail file                header.        x       -Exit without deleting messages that have been read.        q       -Exit, deleting messages that have been read.        p       -Print last message read again.        ?       -Lists these commands.        Examples:        To send mail:        $ mail root        Hi bill! This is a nice system.        -John        ^d        $        To read mail:        $ mail        From john Thu Mar 13 02:00:00  1986        Hi bill! This is a nice system.        -John

⌨️ 快捷键说明

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