slides null puliya linux basics

25
LINUX PULIYA

Upload: anant-shrivastava

Post on 08-Jan-2017

602 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Slides null puliya linux basics

LINUX PULIYA

Page 2: Slides null puliya linux basics

ANANT SHRIVASTAVAInformation Security ConsultantAdmin - Dev - Securitynull + OWASP + G4H

and @anantshriTrainer : Blackhat, RuxCon, NullCon, g0s, c0c0nSpeaker : Nullcon, c0c0n, ClubHack, RootConf

http://anantshri.info

       

Android Tamer Code Vigilant

Page 3: Slides null puliya linux basics

WHAT ARE WE COVERING1. Understanding *nix2. File System Basics3. Understanding I/O4. Basic Commands5. How to Exit VIM6. Shell Script basics7. Automation

Page 4: Slides null puliya linux basics

NIX1. Family of OS ranging from Unix, Linux, *BSD (FreeBSD, OpenBSD etc)2. Follow same standards in terms of file systems, directory layout etc

Page 5: Slides null puliya linux basics

LINUX1. Free as in free speech not free beer2. Everyone can create there own Distro3. Hanna Montanna Linux

and more

Page 6: Slides null puliya linux basics

LINUX DISTRIBUTIONS1. Various Linux Distributions2. Debian Based (apt-get / dpkg)3. RedHat based (yum / rpm)4. LTS or not

Page 7: Slides null puliya linux basics

FILE SYSTEM BASICS1. Everything is a file2. File System Layout3. Standard File system layout

1. / as highest level2. /etc for all configuration3. /home : users home folder

Page 8: Slides null puliya linux basics
Page 9: Slides null puliya linux basics

FILE SYSTEM TYPESext2

Maximum file size = 16 GB to 2 TBFile system size = 2 TB to 32 TB

ext31. Journaling (Linux Kernel 2.4.15)2. Maximum file size = 16 GB to 2 TB3. File system size = 2 TB to 32 TBext41. Starting from Linux Kernel 2.6.19 ext42. Maximum file size = 16 GB to 16 TB3. File system size = 1 EB

1. 1 EB = 1024 PB2. 1 PB = 1024 TB

Page 10: Slides null puliya linux basics

MORE FILE SYSTEM BASIC1. File System Permissions

-rwxrwxrwx

2. Suid bits

-rwsrwxrwx

3. sgid bit

-rwxrwsrwx

4. sticky bit

-rwxrwxrwt

5. First bit can be l,c,b,d,-

Page 11: Slides null puliya linux basics

SUDO1. id 0 is omnipotent2. its suggested not to use root access3. So how do we do high privilege actions

Page 12: Slides null puliya linux basics

STANDARD I/O1. Input (<)2. Output (>)3. Error (2>)

Page 13: Slides null puliya linux basics

USEFUL COMMANDS1. ls, cd, mkdir2. cut3. grep4. sed5. sort6. uniq7. xargs8. find9. tr

10. ps11. screen12. netstat -lntp13. file

Page 14: Slides null puliya linux basics

EDITOR1. Vim2. Nano3. EMACS

Page 15: Slides null puliya linux basics

INSTALLING SOFTWARES1. Debian apt-get install

2. Redhat yum install

3. python pip install

4. ruby gem install

5. npm / nodejs npm install

Page 16: Slides null puliya linux basics

MORE USEFUL COMMANDS1. python -m SimpleHTTPServer Port2. !!3. cd ~4. cd -5. mtr6. mount and format7. setting environment Variables

Page 17: Slides null puliya linux basics

CRONTAB1. Automate periodic execution

* * * * * * CMD | | | | | | | | | | | +-- Year (range: 1900-3000) | | | | +---- Day of the Week (range: 1-7, 1 standing for Monday) | | | +------ Month of the Year (range: 1-12) | | +-------- Day of the Month (range: 1-31) | +---------- Hour (range: 0-23) +------------ Minute (range: 0-59)

Page 18: Slides null puliya linux basics

CONFIGURING SERVICESSSH

Configuration file : /etc/ssh/sshd_config

Page 19: Slides null puliya linux basics

USING SSH1. SSH Authentication

1. Password2. SSH Key

2. How to Configure SSH Login via Key3. ~/.ssh/authorized_keys

Page 20: Slides null puliya linux basics

SHELL SCRIPT BASICS1. Shebang2. $1 $2, $* $@ $03. read4. echo5. cat6. Conditions7. Loop8. Expansion {}

Page 21: Slides null puliya linux basics

WRITING CUSTOM SCRIPTS1. Write a shell script to calculate simple interest2. Write a shell script to check whether no is even or odd3. Print prime numbers from 1 to 5000

Page 22: Slides null puliya linux basics

OVERLOAD COMMANDS1. alias2. Why alias and why not3. find location add path before everything else and then overload

Page 23: Slides null puliya linux basics

EXAMPLE

Page 24: Slides null puliya linux basics

QUESTIONS

Page 25: Slides null puliya linux basics

THANK YOU