Return-Oriented Programming on the Arm Cortex-M4

Total Page:16

File Type:pdf, Size:1020Kb

Return-Oriented Programming on the Arm Cortex-M4 RETURN-ORIENTED PROGRAMMING ON THE ARM CORTEX-M4 Daniel Dunn and Jason Macy February 23, 2014 1 Introduction This document will outline the procedure used to exploit the stack on the Cortex-M4 as well as the theory and setup we used for this assignment. The techniques discussed in the document were used to exploit a downward grow- ing stack, however they can easily be modified for use with an upward growing stack. 2 Theory and Setup This attack hinges on the idea that one has access to the source code of the program they are attacking. Often one has the executable on their computer and can use various utilities to dump the source code. In this case Fromelf was used to disassemble the .axf file into Assembly Language. We included the majority of the microlib functions in order to give us a larger sample space to select gadgets. There are many automated gadget finders and other resources that can be useful. We found it to be much more efficient to use the find function included with many text editors because we had a good idea of what functions we needed for this task. There was also time spent making sure the Keil IDE did not optimize needed features from the source code. The linker flag --no_remove was used to keep unused code in the final project. The compiler flag --no_protect_stack used to remove stack cookies as well. This ensured our gadgets would be preserved in the final executable and any modification of the return address would go unnoticed. In the end, two adjacent commands were found that would allow us to write to memory from code space. Figure 1: This is the first gadget used. The command was originally used to restore state and return at the end of a function but was repurposed to load R4 and R5 and branch to our next gadget 1 Figure 2: This is the second gadget used. This is a simple STR command that took advantage of previously loaded registers. 3 Implementation This portion of the assignment required the most trial and error. The payload was designed to hold all vital information as well as have proper alignment to allow it to be interpreted as part of the stack. It's important to remember when popping to the program counter that it has already been incremented once the command is executed. In our case instead of popping the address 0x810 into the PC we had to use 0x811, otherwise a hard fault would result. 3.1 Procedure After reading the datasheet for the microcontroller it was found that the value 0xA4420004 had to be written into the Flash Memory Control Register(0x400FD008). This proved to be a simple task using the above gadgets. The table below out- lines the content of the payload. Gadgets Exploited Stack Overflown uname[16] AAAAAAAA Overflown passwd[16] AAAAAAAA Address of Gadget A Unexploited Stack 0x000000811 POP {r4-r6, PC} uname[16] Value to Pop into R4 0xA4420004 passwd[16] Value to Pop into R5 0x400FD008 Return Address[0x2A3] Filler to Pop into R6 AAAA Address of Gadget B to pop into PC 0x00000080F STR r4,[R5,#0X00] Table 1: The table on the left demonstrates the unaltered stack. The table on the right shows the outline used when designing a payload. Using the above outline and a hex editor we created a string of data that could be inserted in lieu of login credentials. When creating the payload it was important to remember the endianness of the board in order to orient the entries properly. The hex file was transmitted using a terminal application because many of the number combinations are not mapped to ascii characters. 2 3.2 Results Using the methods and gadgets outlined above we were able to successfully flash the memory of our microcontroller. It should be noted that the assignment statement required a reset of the board. This did not happen because once the memory was erased, the gadgets and code we used were no longer on the board. Also, once the memory was flashed it is essentially in the same state as initial startup. Below you'll find the results of the code injection. (a) (b) Figure 3: Figure 3:a shows the stack before code injection. A3 02 is the orginial return address for Auth(). Figure 3:b shows the state of the stack after injection (a) (b) Figure 4: Figure 4:a shows the state of the memory before the code injection. Figure 4:b shows the final result after injecting payload. 4 Conclusion This was a successful implementation of a code injection. Given more time and a larger code space, I don't think it would be difficult to implement more com- plex attacks using the same methods. The limiting factor would be the size of the stack. This assignment has demonstrated the importance of code structure and how it interacts with the hardware its been implemented on. With this knowledge in mind I would structure the auth function differently for a downward growing stack than I would for an upward growing stack. I would also avoid using func- tions like gets() and opt for an implementation with bounds checking. 3 Payload.hex 6161 6161 6161 6161 6161 6161 6161 6161 1108 0000 0400 42a4 08d0 0f40 6161 6161 0f08 0000 Main.c 1 2 #include "tm4c123gh6pm .h" 3 #include " uart . h" 4 5 int main ( void ) 6 f 7 int a u t h o r i z e ; 8 9 i n i t ( ) ; 10 11 while ( 1 ) 12 f 13 a u t h o r i z e = auth ( ) ; 14 15 i f (authorize == 1) 16 myprintf("Login/Password incorrect! "); 17 18 else i f (authorize == 0) 19 myprintf("Welcome to the matrix! "); 20 g 21 22 g Uart.h 1 #ifndef UART H 2 #define UART H 3 4 #define UNAME "jamacy" 5 #define PASSWD "skittlebrau" 6 7 void transmit ( char ); 8 void i n i t ( void ); 9 int auth ( void ); 10 void myprintf ( char ∗); 11 void mygets ( char∗ ); 12 char g e tc h a r ( void ); 13 void delayms ( int ); 14 void s c o r c h e d e a r t h ( void ); 15 16 #endif Uart.c 1 #include "tm4c123gh6pm .h" 2 #include " uart . h" 3 #include " s t r i n g . h" 4 5 //Bloat header files 6 #include <a s s e r t . h> 7 #include <ctype . h> 8 #include <errno . h> 4 9 #include <fenv . h> 10 #include <f l o a t . h> 11 #include <i n t t y p e s . h> 12 #include <l i m i t s . h> 13 #include <l o c a l e . h> 14 #include <math . h> 15 #include <setjmp . h> 16 #include <s i g n a l . h> 17 #include <s t d a r g . h> 18 #include <s t d b o o l . h> 19 #include <s t d d e f . h> 20 #include <s t d i n t . h> 21 #include <s t d l i b . h> 22 #include <time . h> 23 #include <wchar . h> 24 #include <wctype . h> 25 #pragma n o i n l i n e 26 27 void i n i t ( void ) 28 f 29 SYSCTL RCGCUART Rj=0x2 ; 30 SYSCTL RCGCGPIO Rj=0x2 ; 31 GPIO PORTB AHB AFSEL Rj=0x3 ; 32 GPIO PORTB AHB PCTL R=0x00000011 ; 33 GPIO PORTB DEN Rj=0x3 ; 34 35 //configure 9600 baud 36 UART1 CTL R&=0xfffffffe ; 37 UART1 IBRD R=0x68 ; 38 UART1 FBRD R=0x36 ; 39 UART1 LCRH Rj=0 x60 ; 40 UART1 CC R=0; 41 UART1 CTL Rj=0x1 ; 42 g 43 44 // vulnerable when stack is downward growing (use while loop in calling function) 45 int auth ( ) 46 f 47 char uname [ 1 6 ] ; 48 char passwd[16]; 49 50 myprintf("Login: "); 51 mygets ( uname ) ; 52 myprintf("Password: "); 53 mygets ( passwd ) ; 54 55 i f (strcmp(uname,UNAME) == 0 && strcmp(passwd ,PASSWD) == 0) 56 return 0 ; 57 else 58 return 1 ; 59 g 60 61 void myprintf ( char ∗ message ) 62 f 63 int i =0; 64 65 for ( ; i <strlen(message); i++) 66 f 67 68 while ( (UART1 FR R& 0x80) == 0 ) f/∗ If FIFO is full , wait ∗/g 69 UART1 DR R = message[i]; 5 70 71 g 72 g 73 74 void mygets ( char ∗ b u f f e r ) 75 f 76 char byte = 0 ; 77 int count = 0 ; 78 79 while ( 1 ) 80 f 81 while ( (UART1 FR R& 0x40) == 0 ) f/∗ If FIFO is empty, wait ∗/ g ; 82 byte = UART1 DR R; 83 i f (byte == 0x0D) 84 f 85 break ; 86 g 87 buffer[count] = byte; 88 count++; 89 g 90 91 b u f f e r [ count ] = ' n0 ' ; 92 93 g 94 95 //Unused code sections 96 void transmit ( char data ) 97 f 98 UART1 DR R = data ; 99 g 100 101 char g e tc h a r ( void ) 102 f 103 char data ; 104 data=UART1 DR R; 105 return data ; 106 g 107 108 void delayms ( int mult ) 109 f 110 111 NVIC ST CTRL R=0x04 ; 112 NVIC ST RELOAD R = 0xF40∗mult ; 113 NVIC ST CURRENT R= 0 ; 114 NVIC ST CTRL Rj=0x5 ; 115 116 while (NVIC ST CURRENT R); 117 118 g 119 //End of unused code sections 120 121 122 //Bloat code 123 void b l o a t ( ) 124 f 125 char a[20] ="this"; 126 int t=rand ( ) ; 127 char ∗ pItem ; 128 char key[20] = "example"; 129 int n=abs ( 2 3 ) ; 130 f l o a t b=a t o f ( a ) ; 131 int c=a t o l ( a ) ; 6 132 long long int d=atoll(a); 133 long int e=a t o l ( a ) ; 134 char strvalues[][20] = f"some","example","strings","here" g ; 135 int f o o [ 5 ] = f 1 , 2 , 3 , 4 , 5 g ; 136 int bar [ 5 ] = f 3 , 1 , 4 , 5 , 2 g ; 137 d i v t divresult; 138 139 n=l a b s (65537L) ; 140 isalnum ( n ) ; 141 i s a l p h a ( n ) ; 142 i s b l a n k ( n ) ; 143 i s c n t r l ( n ) ; 144 i s d i g i t ( n ) ; 145 i s g r a p h ( n ) ; 146 i s l o w e r ( n ) ; 147 i s p u n c t ( n ) ; 148 i s s p a c e ( n ) ; 149 i s p r i n t ( n ) ; 150 i s u p p e r ( n ) ; 151 i s x d i g i t ( n ) ; 152 n=cos ( 3 .
Recommended publications
  • Process Text Streams Using Filters
    Process Text Streams Using Filters OBJECTIVE: Candidates should should be able to apply filters to text streams. 1 Process Text Streams Using Filters KeyKEY knowledge KNOWLEDGE area(s): AREAS: Send text files and output streams through text utility filters to modify the output using standard UNIX commands found in the GNU textutils package. 2 Process Text Streams Using Filters KEY FILES,TERMS, UTILITIES cat nl tail cut paste tr expand pr unexpand fmt sed uniq head sort wc hexdump split join tac 3 cat cat the editor - used as a rudimentary text editor. cat > short-message we are curious to meet penguins in Prague Crtl+D *Ctrl+D - command is used for ending interactive input. 4 cat cat the reader More commonly used to flush text to stdout. Options: -n number each line of output -b number only non-blank output lines -A show carriage return Example cat /etc/resolv.conf ▶ search mydomain.org nameserver 127.0.0.1 5 tac tac reads back-to-front This command is the same as cat except that the text is read from the last line to the first. tac short-message ▶ penguins in Prague to meet we are curious 6 head or tail using head or tail - often used to analyze logfiles. - by default, output 10 lines of text. List 20 first lines of /var/log/messages: head -n 20 /var/log/messages head -20 /var/log/messages List 20 last lines of /etc/aliases: tail -20 /etc/aliases 7 head or tail The tail utility has an added option that allows one to list the end of a text starting at a given line.
    [Show full text]
  • A Brief Introduction to Unix-2019-AMS
    Brief Intro to Linux/Unix Brief Intro to Unix (contd) A Brief Introduction to o Brief History of Unix o Compilers, Email, Text processing o Basics of a Unix session o Image Processing Linux/Unix – AMS 2019 o The Unix File System Pete Pokrandt o Working with Files and Directories o The vi editor UW-Madison AOS Systems Administrator o Your Environment [email protected] o Common Commands Twitter @PTH1 History of Unix History of Unix History of Unix o Created in 1969 by Kenneth Thompson and Dennis o Today – two main variants, but blended o It’s been around for a long time Ritchie at AT&T o Revised in-house until first public release 1977 o System V (Sun Solaris, SGI, Dec OSF1, AIX, o It was written by computer programmers for o 1977 – UC-Berkeley – Berkeley Software Distribution (BSD) linux) computer programmers o 1983 – Sun Workstations produced a Unix Workstation o BSD (Old SunOS, linux, Mac OSX/MacOS) o Case sensitive, mostly lowercase o AT&T unix -> System V abbreviations 1 Basics of a Unix Login Session Basics of a Unix Login Session Basics of a Unix Login Session o The Shell – the command line interface, o Features provided by the shell o Logging in to a unix session where you enter commands, etc n Create an environment that meets your needs n login: username n Some common shells n Write shell scripts (batch files) n password: tImpAw$ n Define command aliases (this Is my password At work $) Bourne Shell (sh) OR n Manipulate command history IHateHaving2changeMypasswordevery3weeks!!! C Shell (csh) n Automatically complete the command
    [Show full text]
  • How the /Etc/Passwd File Relates to the Laua User
    Page 1 (2) System Foundation 9.0 laua User and Group How the /etc/passwd File Relates to the laua User Scenario Most users who need access to the Lawson environment will need to have a user account set up on the Operating System where Lawson System Foundation 9.0 has been installed. Users will need resources allocated to run their jobs and space in the directory structure to store their print files. The user account on the Operating System is what allows the allocation of resources and space. In the example presented in this session, users are associated to the Unix Operating System and setup via the /etc/passwd file. The information stored on the user account in the file is used by Lawson’s Legacy Security System, laua. This scenario will present the /etc/passwd file and highlight the important parts of the user represented in the file and how it relates to user setup. Workflow Step 1 of 3: To verify that a user has an account on the Unix Operating System where the Lawson server resides, view the /etc/passwd file on the Lawson server. To do so, you must first access a command line which can be done either through LID (Lawson Insight Desktop) or through lawterminal which is command line access through the Lawson portal. This demonstration will use LID. First access your command line. Action: Type in 'cd /etc' and press the 'Enter' key. © Copyright Lawson Learning 2008 Page 2 (2) Step 2 of 3: You can use any method you choose to view the file.
    [Show full text]
  • The AWK Programming Language
    The Programming ~" ·. Language PolyAWK- The Toolbox Language· Auru:o V. AHo BRIAN W.I<ERNIGHAN PETER J. WEINBERGER TheAWK4 Programming~ Language TheAWI(. Programming~ Language ALFRED V. AHo BRIAN w. KERNIGHAN PETER J. WEINBERGER AT& T Bell Laboratories Murray Hill, New Jersey A ADDISON-WESLEY•• PUBLISHING COMPANY Reading, Massachusetts • Menlo Park, California • New York Don Mills, Ontario • Wokingham, England • Amsterdam • Bonn Sydney • Singapore • Tokyo • Madrid • Bogota Santiago • San Juan This book is in the Addison-Wesley Series in Computer Science Michael A. Harrison Consulting Editor Library of Congress Cataloging-in-Publication Data Aho, Alfred V. The AWK programming language. Includes index. I. AWK (Computer program language) I. Kernighan, Brian W. II. Weinberger, Peter J. III. Title. QA76.73.A95A35 1988 005.13'3 87-17566 ISBN 0-201-07981-X This book was typeset in Times Roman and Courier by the authors, using an Autologic APS-5 phototypesetter and a DEC VAX 8550 running the 9th Edition of the UNIX~ operating system. -~- ATs.T Copyright c 1988 by Bell Telephone Laboratories, Incorporated. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopy­ ing, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America. Published simultaneously in Canada. UNIX is a registered trademark of AT&T. DEFGHIJ-AL-898 PREFACE Computer users spend a lot of time doing simple, mechanical data manipula­ tion - changing the format of data, checking its validity, finding items with some property, adding up numbers, printing reports, and the like.
    [Show full text]
  • Basic Unix/Linux Commands
    Unix/Linux Basic commands Learn the basics of grep, sed, awk, find, sort, uniq, cut, cat, etc We will study them using sample requirements 1. Determine all the users that are having at least two first names. Using /etc/passwd file as an input. 2. Replace all the bash shells with csh in the /etc/passwd file. Eg. /bin/bash should be replaced with /bin/csh. 3. Replace all the home directories with /home/missing in the same /etc/passwd file. 4. Count the number of lines in a file. 5. Count the number of words starting with letter b/B in /etc/passwd file. 6. Determine the most popular family name found in the /etc/passwd file. 7. Display all text file names in the current directory ordered by their name. 8. Display all the files having more than 100 bytes. 9. Display all the files that the current user has at least read permission. 10. Sort the content of the /etc/passwd file ascending/descending by the fifth column. 11. Display the first 25 lines from the /etc/passwd file. 12. Display the last 30 lines from the /etc/passwd file. 13. If a file has N lines display the lines between N/2 and N/2+10. 14. Display all the unique parent directories from the /etc/passwd file. Eg. on the sixth column we have the home directory, like: /home/scs/master/an1/gr246/abicr2020, from this we will consider the /home/scs/master/an1/gr246/ as the parent directory. 15. Display the first 10 characters from each line of /etc/passwd file.
    [Show full text]
  • Manipulating Files and Directories
    MANIPULATING FILES AND DIRECTORIES At this point, we are ready for some real work! This chapter will introduce the following commands: z cp—Copy files and directories. z mv—Move/rename files and directories. z mkdir—Create directories. z rm—Remove files and directories. z ln—Create hard and symbolic links. These five commands are among the most frequently used Linux com- mands. They are used for manipulating both files and directories. Now, to be frank, some of the tasks performed by these commands are more easily done with a graphical file manager. With a file manager, we can drag and drop a file from one directory to another, cut and paste files, delete files, and so on. So why use these old command-line programs? www.it-ebooks.info The answer is power and flexibility. While it is easy to perform simple file manipulations with a graphical file manager, complicated tasks can be easier with the command-line programs. For example, how could we copy all the HTML files from one directory to another—but only those that do not exist in the destination directory or are newer than the versions in the destination directory? Pretty hard with a file manager. Pretty easy with the command line: cp -u *.html destination Wildcards Before we begin using our commands, we need to talk about the shell fea- ture that makes these commands so powerful. Because the shell uses file- names so much, it provides special characters to help you rapidly specify groups of filenames. These special characters are called wildcards.
    [Show full text]
  • A. -D B. -L C. -1 D. -I E. -A A
    Ian! D. Allen − Fall 2012 -1- 45 minutes Ian! D. Allen − Fall 2012 -2- 45 minutes 7. [61/123] If I am in my home directory named /home/me and mt is an empty sub- Test Version: ___ Print Name: directory,what is true after this command line: touch ./foo ; mv ./mt/../foo ../me/bar Multiple Choice - 52 Questions - 15 of 15% a. the directory mt nowcontains only a file named bar 1. Read all the instructions and both sides (back and front) of all pages. b. there is a second copyofthe file named foo in the file named bar 2. Put the Test Version above into NO. OF QUESTIONS and NO. OF STUDENTS c. the command fails because path ./mt/../foo does not exist 3. Answer the questions you know, first. One Answer Only per question. d. the command fails because path ../me/bar does not exist 4. Manage your time when answering questions on this test! e. the directory mt/.. nowhas a file named bar in it 8. [63/125] In the output of ls -a,the one-character name . signifies what? 1. [49/126] If my current directory is /bin,which of these pathnames is equivalent to the file name /bin/ls? a. Acurrent file. a. ../bin/ls/. b. /root/bin/ls c. ls/. b. The current directory. d. ./bin/ls e. ../../bin/ls c. The parent directory. d. Aname that is hidden. 2. [52/125] If my current working directory is /home,and my home directory is e. Aname with an unprintable character. /home/ian,which command copies file /bin/ls into my home directory under the name me? 9.
    [Show full text]
  • Linux File System and Linux Commands
    Hands-on Keyboard: Cyber Experiments for Strategists and Policy Makers Review of the Linux File System and Linux Commands 1. Introduction Becoming adept at using the Linux OS requires gaining familiarity with the Linux file system, file permissions, and a base set of Linux commands. In this activity, you will study how the Linux file system is organized and practice utilizing common Linux commands. Objectives • Describe the purpose of the /bin, /sbin, /etc, /var/log, /home, /proc, /root, /dev, /tmp, and /lib directories. • Describe the purpose of the /etc/shadow and /etc/passwd files. • Utilize a common set of Linux commands including ls, cat, and find. • Understand and manipulate file permissions, including rwx, binary and octal formats. • Change the group and owner of a file. Materials • Windows computer with access to an account with administrative rights The Air Force Cyber College thanks the Advanced Cyber Engineering program at the Air Force Research Laboratory in Rome, NY, for providing the information to assist in educating the general Air Force on the technical aspects of cyberspace. • VirtualBox • Ubuntu OS .iso File Assumptions • The provided instructions were tested on an Ubuntu 15.10 image running on a Windows 8 physical machine. Instructions may vary for other OS. • The student has administrative access to their system and possesses the right to install programs. • The student’s computer has Internet access. 2. Directories / The / directory or root directory is the mother of all Linux directories, containing all of the other directories and files. From a terminal users can type cd/ to move to the root directory.
    [Show full text]
  • Permissions and Ownership
    Getting Started with Linux: Novell’s Guide to CompTIA’s Linux+ Objective 1 Understand User and Group Configuration Files Information on users and groups on a Linux system is kept in the following files: ■ /etc/passwd ■ /etc/shadow ■ /etc/group Whenever possible, you should not modify these files with an editor. Instead, use the Security and Users modules in YaST or the command line tools described in the next objective, “Manage User Accounts and Groups from the Command Line” on 7-12. Modifying these files with an editor can lead to errors (especially in /etc/shadow), such as a user—including the user root—no longer being able to log in. To ensure consistency of these files, you need to understand how to ■ Check /etc/passwd and /etc/shadow ■ Convert Passwords to and from Shadow /etc/passwd The file /etc/passwd stores information for each user. In the past, UNIX and Linux users were handled in a single file: /etc/passwd. The user name, the UID, the home directory, the standard shell, and the encrypted password were all stored in this file. The password was encrypted using the function crypt (man 3 crypt). In principle, the plain text password could not be deciphered from the encrypted password. 7-2 Version 2 Use the Command Line Interface to Administer the System However, there are programs (such as john) that use dictionaries to encrypt various passwords with crypt, and then compare the results with the entries in the file /etc/passwd. With the calculation power of modern computers, simple passwords can be “guessed” within minutes.
    [Show full text]
  • User Accounts User Accounts User Info /Etc/Passwd User Info /Etc
    User Accounts Even a single-user workstation (Desktop Computer) uses multiple accounts. Such a computer may have just one user account, but several system accounts help keep the computer running. Accounts enable multiple users to share a single computer without causing each other too much trouble. User Accounts The Users in a Linux system are stored in the /etc/passwd file. If you are on your own VM - somewhere near the bottom you should see yourself and joe. On a brand new install you will see many users listed. Of course if you recall, we only added ourselves and joe. So what are all these other users for? These users are added because we don’t want to give sudo power to all of our programs. So each program installed gets its own user with its own limited permissions. This is a protection for our computer. User Info /etc/passwd Examine the /etc/passwd file using cat or less . Here is what we are seeing: It is colon : separated. So each : denotes a new column. username password The x is just a place-holder. The password is not really in this file User ID (UID) Just like every computer needs a unique ip address, every user needs a unique id. User Info /etc/passwd Group ID (GID) Every user belongs to its own group, with its own group id Comment field This is the Full name, phone number, office number, etc. It is okay if it is blank. Home Directory This is the location of the users home directory - This is how we can know the full path of any users home directory - /home/smorgan vs /home/s/smorgan.
    [Show full text]
  • Unix Commands (09/04/2014)
    Unix Commands (09/04/2014) • Access control – login <login_name> – exit – passwd <login_name> – yppassswd <loginname> – su – • Login as Super user – su <login> • Login as user <login> • Root Prompt – [root@localhost ~] # • User Prompt – [bms@raxama ~] $ On Line Documentation – man <command/topic> – info <command/topic> • Working with directories – mkdir –p <subdir> ... {-p create all directories in path if not present} mkdir –p /2015/Jan/21/14 will create /2015, Jan, 21 & 14 in case any of these is absent – cd <dir> – rm -r <subdir> ... Man Pages • 1 Executable programs or shell commands • 2 System calls (functions provided by the kernel) • 3 Library calls (functions within program libraries) • 4 Special files (usually found in /dev) • 5 File formats and conventions eg /etc/passwd • 6 Games • 7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7) • 8 System administration commands (usually only for root) • 9 Kernel routines [Non standard] – man grep, {awk,sed,find,cut,sort} – man –k mysql, man –k dhcp – man crontab ,man 5 crontab – man printf, man 3 printf – man read, man 2 read – man info Runlevels used by Fedora/RHS Refer /etc/inittab • 0 - halt (Do NOT set initdefault to this) • 1 - Single user mode • 2 - Multiuser, – without NFS (The same as 3, if you do not have networking) • 3 - Full multi user mode w/o X • 4 - unused • 5 - X11 • 6 - reboot (Do NOT set init default to this) – init 6 {Reboot System} – init 0 {Halt the System} – reboot {Requires Super User} – <ctrl> <alt> <del> • in tty[2-7] mode – tty switching • <ctrl> <alt> <F1-7> • In Fedora 10 tty1 is X.
    [Show full text]
  • Basic Unix Command
    Basic Unix Command The Unix command has the following common pattern command_name options argument(s) Here we are trying to give some of the basic unix command in Unix Information Related man It is used to see the manual of the various command. It helps in selecting the correct options to get the desirable output. Just need to give man command finger Getting information about a local and remote user. Sometimes you may want to know what all user are currently logged into the Unix system then this will help passwd Changing your password for the user. If you are logged in, then enter passwd,it will change the password for the current user. From root login you can change password for any user by using passwd who Finding out who is logged on which find the source directory of the executable being used uname print name of current system. On Solaris uname -X will give the cpu and various other informations uptime Time since the last reboot File listing and directory manipulation command ls List contents of Directory(s) Syntax: ls options OPTIONS The following options are supported:-a Lists all entries, including those that begin with a dot (.), which are normally not listed. -d If an argument is a directory, lists only its name (not its contents); often used with -l to get the status of a directory. -n The same as -l, except that the owner's UID and group's GID numbers are printed, rather than the associated character strings. -r Reverses the order of sort to get reverse alphabetic or oldest first as appropriate.
    [Show full text]