SlideShare a Scribd company logo
1
Linux Remote Escalation
Privilege
Escalation
Meterpreter
Often, the remote shell will be created
via an automatic tool like Metasploit. In
the case of a meterpreter shell, two
commands become especially beneficial:
Use priv – loads extensive permissions
Getsystem – uses a few preconfigured
techniques in an attempt to escalate
privileges
Note that these exploits might not
always work.
2
Known CVE
Some exploits exist solely for the
purpose of privilege escalation and
might be available.
• Netfilter
• BPF
The above are two are examples of Linux
exploits for some new kernel versions
4.4.
Other exploits will need to be compiled
and then transferred to the system. To
easily search for these, we can use the
tool Searchsploit [keywords].
3
4
Searching for Exploits
Known Exploits
Looking for basic system information like OS version and kernel version is easily done. Most people do not worry about every
new update, so it is safe to assume that an old OS version will have a known bug. The bug might have been fixed in newer
versions, but because no one updated the system, a vulnerability still exists.
Below are some common search engines for exploits:
ENGINE USAGE RESULTS
msfconsole msf> search [key words] Exploits and payloads available for usage right from
the msf console itself
searchsploit searchsploit [key words] The results from the exploit-db, including
precompiled C code and documentation
exploitDB https://www.exploit-db.com/ Exploits, precompiled C code, documentations and
CVE documents
Enumeration
Gaining control of a remote system is
only the first step, then the goal
becomes getting to the highest
privileges as fast as possible.
Enumeration is the process of collecting
various information related to the
system itself:
• System version
• Environmental variables
• Running services
• Installed applications
• Scheduled jobs
• Permissions
LinEnum is a bash script available from
github that provides a decent amount of
information.
5
6
How Different Data Is Useful
DATA INSIGHT
Kernel and distribution information This information can help in the process of searching for known exploits
Previously/currently logged users Provides insight about other users that might be hackable
Group memberships Improve knowledge of the system when searching for weak permissions
Sudo executable commands Having sudo executable commands might be a way to PE
Environmental information Especially important for identifying bad PATH configurations
Automated tasks PE via automated tasks is a common attack vector
Network information Knowing the network structure may suggest more targets to exploit
Running processes with permissions Some processes may be outdated and exploitable
Binaries associated with permissions Binaries with misconfigured permissions are the reason for most PE
Plain Text
It is surprising how many people leave
critical information lying around in text
files, notes, or in documents in their
home folder.
Quickly navigating through some
common folders and searching for files
labeled “pass” or “secret” might pop a
thing or two.
There are a few useful built-in tools that
perform searches like find and grep,
which can be used to search for files or
plain text.
7
8
File Permissions
File name
-rwxr-xr-x 1 root root 10469 Aug 7 2017 savelog
Known Exploits
When looking at the permissions through the shell, each set of ‘rwx’ corresponds with one of the entities: ‘owner’, ‘group’ or
‘everybody’. The number represents the amount of hard links to the file, and the owner:group corresponds to the ownership
assignment of the file.
Below is a slightly more graphical explanation:
Date modifiedSizeOwner’s
group
Owner
Hard link
count
Everybody
Group
Owner
Special
flags
Misconfigured Permissions
The Linux architecture has a file
representation for everything. For this
reason, it is important to understand
how Linux file permissions work.
The possibility of one file having
misconfigured permission is highly likely.
Files with different permissions can be
found with verities of the find command.
For example, find -type f -writable will
find all the writable files.
9
SETUID
When set-user identification permission is set on an
executable file, a process that runs this file is granted
access based on the owner of the file, usually root,
rather than the user who is running the executable
file. This special permission allows a user to access
files and directories that are normally only available to
the owner.
When looking at the permissions of an executable,
setuid can be noticed by having ‘s’ in the place of ‘x’ at
the owner position.
SETGID
The set-group identification permission is similar to
setuid, except that the process's effective group ID is
changed to the group owner of the file, and a user is
granted access based on permissions granted to that
group.
When looking at the permissions of an executable
setuid can be noticed by having ‘s’ in the place of ‘x’ at
the group position.
10
Run As
Setuid / Setgid
Dealing with Linux permissions can be
tricky, especially when encountering
setuid or setgid.
Using this option is usually done to allow
a user to run a program without actually
having the privileges to run it.
But, in the case the user is given “write”
permission for the file, it can be altered
and cause the system to run
unprivileged commands as root.
11
Sudo Permissions on Binaries
A Linux System can have a special group
of users who are permitted to run a
limited number of commands as root.
The user-type has low privileges, with
the ability to run a listed set of
commands as if the user was root.
For no specific reason, many commands
can spawn a shell, and these commands
can be exploited when listed in the sudo
list of a user.
12
13
Shell Through Binaries
BINARY SHELL
Find Find . -exec /bin/bash /;
Awk awk 'BEGIN {system("/bin/sh")}'
Nmap Nmap --interactive (older versions)
Vi :shell
Python python -c 'import pty; pty.spawn("/bin/bash")'
Perl perl —e 'exec "/bin/bash";'
Ruby ruby: exec "/bin/sh"
Lua lua: os.execute('/bin/sh')
Sudo Permissions
Among the worst things in a system to
be given root privileges are text editors
and programming languages.
Most text editors and most
programming languages like Python,
Perl, or Ruby have built-in commands
that allow spawning a shell.
Knowing most processes inherit their
ancestors’ privileges, a shell spawned
through a root editor or a root-
privileged programming language will
cause a root shell.
14

More Related Content

What's hot

Introduction to unix
Introduction to unixIntroduction to unix
Introduction to unix
sudheer yathagiri
 
17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards
Denis Ristic
 
UNIX Operating System ppt
UNIX Operating System pptUNIX Operating System ppt
Unix Administration
Unix AdministrationUnix Administration
Unix Administration
Nishant Munjal
 
Unix operating system architecture with file structure
Unix operating system architecture with file structure Unix operating system architecture with file structure
Unix operating system architecture with file structure
amol_chavan
 
Linux basics
Linux basicsLinux basics
Linux basics
Geeta Vinnakota
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
Nishant Munjal
 
Unix
UnixUnix
Unix
Erm78
 
Basics of-linux
Basics of-linuxBasics of-linux
Basics of-linux
Singsys Pte Ltd
 
Unix features, posix and single unix specification
Unix features, posix and single unix specificationUnix features, posix and single unix specification
Unix features, posix and single unix specification
sudha rani
 
Unix notes
Unix notesUnix notes
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
subhsikha
 
Unix operating system
Unix operating systemUnix operating system
Unix operating systemmidhunjose4u
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
MahakKasliwal
 
Linux commands
Linux commandsLinux commands
Linux commands
Hemakumar.S
 
Linux booting process - Linux System Administration
Linux booting process - Linux System AdministrationLinux booting process - Linux System Administration
Linux booting process - Linux System Administration
Sreenatha Reddy K R
 
Linux administration classes in mumbai
Linux administration classes in mumbaiLinux administration classes in mumbai
Linux administration classes in mumbai
Vibrant Technologies & Computers
 
Operating systems unix
Operating systems   unixOperating systems   unix
Operating systems unix
Achu dhan
 

What's hot (20)

Introduction to unix
Introduction to unixIntroduction to unix
Introduction to unix
 
17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards17 Linux Basics #burningkeyboards
17 Linux Basics #burningkeyboards
 
UNIX Operating System ppt
UNIX Operating System pptUNIX Operating System ppt
UNIX Operating System ppt
 
Unix Administration
Unix AdministrationUnix Administration
Unix Administration
 
Unix operating system architecture with file structure
Unix operating system architecture with file structure Unix operating system architecture with file structure
Unix operating system architecture with file structure
 
Linux basics
Linux basicsLinux basics
Linux basics
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
Unix
UnixUnix
Unix
 
Basics of-linux
Basics of-linuxBasics of-linux
Basics of-linux
 
Unix features, posix and single unix specification
Unix features, posix and single unix specificationUnix features, posix and single unix specification
Unix features, posix and single unix specification
 
Unix notes
Unix notesUnix notes
Unix notes
 
Tutorial 2
Tutorial 2Tutorial 2
Tutorial 2
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
 
Unix operating system
Unix operating systemUnix operating system
Unix operating system
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux booting process - Linux System Administration
Linux booting process - Linux System AdministrationLinux booting process - Linux System Administration
Linux booting process - Linux System Administration
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Linux administration classes in mumbai
Linux administration classes in mumbaiLinux administration classes in mumbai
Linux administration classes in mumbai
 
Operating systems unix
Operating systems   unixOperating systems   unix
Operating systems unix
 

Similar to Linux remote

Exploitation and distribution of setuid and setgid binaries on Linux systems
Exploitation and distribution of setuid and setgid binaries on Linux systemsExploitation and distribution of setuid and setgid binaries on Linux systems
Exploitation and distribution of setuid and setgid binaries on Linux systems
Zero Science Lab
 
Linux security
Linux securityLinux security
Linux security
trilokchandra prakash
 
Poking The Filesystem For Fun And Profit
Poking The Filesystem For Fun And ProfitPoking The Filesystem For Fun And Profit
Poking The Filesystem For Fun And Profit
ssusera432ea1
 
prateekporwal
prateekporwalprateekporwal
prateekporwal
prateekporwal
 
Hiding files.pptx
Hiding files.pptxHiding files.pptx
Hiding files.pptx
KashifHussain647755
 
How to Audit Linux - Gene Kartavtsev, ISACA MN
How to Audit Linux - Gene Kartavtsev, ISACA MNHow to Audit Linux - Gene Kartavtsev, ISACA MN
How to Audit Linux - Gene Kartavtsev, ISACA MN
Gene Kartavtsev
 
Linux Interview Questions and Answers.pdf
Linux Interview Questions and Answers.pdfLinux Interview Questions and Answers.pdf
Linux Interview Questions and Answers.pdf
SudhanshiBakre1
 
Unix Security
Unix SecurityUnix Security
Unix Security
replay21
 
Linux 4 you
Linux 4 youLinux 4 you
Linux 4 you
Shashwat Shriparv
 
Linux privilege escalation
Linux privilege escalationLinux privilege escalation
Linux privilege escalation
SongchaiDuangpan
 
Linux fundamentals
Linux fundamentalsLinux fundamentals
Linux fundamentalsRaghu nath
 
SELinux Basic Usage
SELinux Basic UsageSELinux Basic Usage
SELinux Basic Usage
Dmytro Minochkin
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
cclay3
 
Linux host review
Linux host reviewLinux host review
Linux host review
rglaal
 

Similar to Linux remote (20)

Exploitation and distribution of setuid and setgid binaries on Linux systems
Exploitation and distribution of setuid and setgid binaries on Linux systemsExploitation and distribution of setuid and setgid binaries on Linux systems
Exploitation and distribution of setuid and setgid binaries on Linux systems
 
Linux security
Linux securityLinux security
Linux security
 
Poking The Filesystem For Fun And Profit
Poking The Filesystem For Fun And ProfitPoking The Filesystem For Fun And Profit
Poking The Filesystem For Fun And Profit
 
prateekporwal
prateekporwalprateekporwal
prateekporwal
 
Host security
Host securityHost security
Host security
 
Host security
Host securityHost security
Host security
 
Ch1 linux basics
Ch1 linux basicsCh1 linux basics
Ch1 linux basics
 
Hiding files.pptx
Hiding files.pptxHiding files.pptx
Hiding files.pptx
 
How to Audit Linux - Gene Kartavtsev, ISACA MN
How to Audit Linux - Gene Kartavtsev, ISACA MNHow to Audit Linux - Gene Kartavtsev, ISACA MN
How to Audit Linux - Gene Kartavtsev, ISACA MN
 
Linux Interview Questions and Answers.pdf
Linux Interview Questions and Answers.pdfLinux Interview Questions and Answers.pdf
Linux Interview Questions and Answers.pdf
 
Unix Security
Unix SecurityUnix Security
Unix Security
 
Linux 4 you
Linux 4 youLinux 4 you
Linux 4 you
 
Linux privilege escalation
Linux privilege escalationLinux privilege escalation
Linux privilege escalation
 
Linux fundamentals
Linux fundamentalsLinux fundamentals
Linux fundamentals
 
How to build an admin guy
How to build an admin guyHow to build an admin guy
How to build an admin guy
 
SELinux Basic Usage
SELinux Basic UsageSELinux Basic Usage
SELinux Basic Usage
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
Linux host review
Linux host reviewLinux host review
Linux host review
 
Linux
Linux Linux
Linux
 
Ppt linux
Ppt linuxPpt linux
Ppt linux
 

More from yarden hanan

Introduction to malware analysis & reverse engineering
Introduction to malware analysis & reverse engineeringIntroduction to malware analysis & reverse engineering
Introduction to malware analysis & reverse engineering
yarden hanan
 
SSL Pinning
SSL PinningSSL Pinning
SSL Pinning
yarden hanan
 
Mobile SF
Mobile SFMobile SF
Mobile SF
yarden hanan
 
iOS Jail break
iOS Jail breakiOS Jail break
iOS Jail break
yarden hanan
 
Ios vs android
Ios vs androidIos vs android
Ios vs android
yarden hanan
 
Android Package tool
Android Package toolAndroid Package tool
Android Package tool
yarden hanan
 
Android package
Android packageAndroid package
Android package
yarden hanan
 
Introduction to malware analysis & reverse engineering
Introduction to malware analysis & reverse engineeringIntroduction to malware analysis & reverse engineering
Introduction to malware analysis & reverse engineering
yarden hanan
 
Introduction To Malware Analysis & Reverse Engineering
Introduction To Malware Analysis & Reverse EngineeringIntroduction To Malware Analysis & Reverse Engineering
Introduction To Malware Analysis & Reverse Engineering
yarden hanan
 
File windows local
File windows localFile windows local
File windows local
yarden hanan
 

More from yarden hanan (11)

Introduction to malware analysis & reverse engineering
Introduction to malware analysis & reverse engineeringIntroduction to malware analysis & reverse engineering
Introduction to malware analysis & reverse engineering
 
SSL Pinning
SSL PinningSSL Pinning
SSL Pinning
 
Mobile SF
Mobile SFMobile SF
Mobile SF
 
iOS Jail break
iOS Jail breakiOS Jail break
iOS Jail break
 
Ios vs android
Ios vs androidIos vs android
Ios vs android
 
Android Package tool
Android Package toolAndroid Package tool
Android Package tool
 
Android package
Android packageAndroid package
Android package
 
Adb
AdbAdb
Adb
 
Introduction to malware analysis & reverse engineering
Introduction to malware analysis & reverse engineeringIntroduction to malware analysis & reverse engineering
Introduction to malware analysis & reverse engineering
 
Introduction To Malware Analysis & Reverse Engineering
Introduction To Malware Analysis & Reverse EngineeringIntroduction To Malware Analysis & Reverse Engineering
Introduction To Malware Analysis & Reverse Engineering
 
File windows local
File windows localFile windows local
File windows local
 

Recently uploaded

'Guidance and counselling- role of Psychologist in Guidance and Counselling.
'Guidance and counselling- role of Psychologist in Guidance and Counselling.'Guidance and counselling- role of Psychologist in Guidance and Counselling.
'Guidance and counselling- role of Psychologist in Guidance and Counselling.
PaviBangera
 
The Impact of Artificial Intelligence on Modern Society.pdf
The Impact of Artificial Intelligence on Modern Society.pdfThe Impact of Artificial Intelligence on Modern Society.pdf
The Impact of Artificial Intelligence on Modern Society.pdf
ssuser3e63fc
 
一比一原版(QU毕业证)皇后大学毕业证如何办理
一比一原版(QU毕业证)皇后大学毕业证如何办理一比一原版(QU毕业证)皇后大学毕业证如何办理
一比一原版(QU毕业证)皇后大学毕业证如何办理
yuhofha
 
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
foismail170
 
Exploring Career Paths in Cybersecurity for Technical Communicators
Exploring Career Paths in Cybersecurity for Technical CommunicatorsExploring Career Paths in Cybersecurity for Technical Communicators
Exploring Career Paths in Cybersecurity for Technical Communicators
Ben Woelk, CISSP, CPTC
 
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdfDOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
Pushpendra Kumar
 
Personal Brand Exploration Comedy Jxnelle.
Personal Brand Exploration Comedy Jxnelle.Personal Brand Exploration Comedy Jxnelle.
Personal Brand Exploration Comedy Jxnelle.
alexthomas971
 
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
yuhofha
 
一比一原版(YU毕业证)约克大学毕业证如何办理
一比一原版(YU毕业证)约克大学毕业证如何办理一比一原版(YU毕业证)约克大学毕业证如何办理
一比一原版(YU毕业证)约克大学毕业证如何办理
yuhofha
 
New Explore Careers and College Majors 2024.pdf
New Explore Careers and College Majors 2024.pdfNew Explore Careers and College Majors 2024.pdf
New Explore Careers and College Majors 2024.pdf
Dr. Mary Askew
 
皇冠体育- 皇冠体育官方网站- CROWN SPORTS| 立即访问【ac123.net】
皇冠体育- 皇冠体育官方网站- CROWN SPORTS| 立即访问【ac123.net】皇冠体育- 皇冠体育官方网站- CROWN SPORTS| 立即访问【ac123.net】
皇冠体育- 皇冠体育官方网站- CROWN SPORTS| 立即访问【ac123.net】
larisashrestha558
 
Brand Identity For A Sportscaster Project and Portfolio I
Brand Identity For A Sportscaster Project and Portfolio IBrand Identity For A Sportscaster Project and Portfolio I
Brand Identity For A Sportscaster Project and Portfolio I
thomasaolson2000
 
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
pxyhy
 
Digital Marketing Training In Bangalore
Digital  Marketing Training In BangaloreDigital  Marketing Training In Bangalore
Digital Marketing Training In Bangalore
nidm599
 
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaaInteractive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
23211a7274
 
Full Sail_Morales_Michael_SMM_2024-05.pptx
Full Sail_Morales_Michael_SMM_2024-05.pptxFull Sail_Morales_Michael_SMM_2024-05.pptx
Full Sail_Morales_Michael_SMM_2024-05.pptx
mmorales2173
 
How to create an effective K-POC tutorial
How to create an effective K-POC tutorialHow to create an effective K-POC tutorial
How to create an effective K-POC tutorial
vencislavkaaa
 
Personal Brand exploration KE.pdf for assignment
Personal Brand exploration KE.pdf for assignmentPersonal Brand exploration KE.pdf for assignment
Personal Brand exploration KE.pdf for assignment
ragingokie
 
lab.123456789123456789123456789123456789
lab.123456789123456789123456789123456789lab.123456789123456789123456789123456789
lab.123456789123456789123456789123456789
Ghh
 
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdfRECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
AlessandroMartins454470
 

Recently uploaded (20)

'Guidance and counselling- role of Psychologist in Guidance and Counselling.
'Guidance and counselling- role of Psychologist in Guidance and Counselling.'Guidance and counselling- role of Psychologist in Guidance and Counselling.
'Guidance and counselling- role of Psychologist in Guidance and Counselling.
 
The Impact of Artificial Intelligence on Modern Society.pdf
The Impact of Artificial Intelligence on Modern Society.pdfThe Impact of Artificial Intelligence on Modern Society.pdf
The Impact of Artificial Intelligence on Modern Society.pdf
 
一比一原版(QU毕业证)皇后大学毕业证如何办理
一比一原版(QU毕业证)皇后大学毕业证如何办理一比一原版(QU毕业证)皇后大学毕业证如何办理
一比一原版(QU毕业证)皇后大学毕业证如何办理
 
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
太阳城娱乐-太阳城娱乐推荐-太阳城娱乐官方网站| 立即访问【ac123.net】
 
Exploring Career Paths in Cybersecurity for Technical Communicators
Exploring Career Paths in Cybersecurity for Technical CommunicatorsExploring Career Paths in Cybersecurity for Technical Communicators
Exploring Career Paths in Cybersecurity for Technical Communicators
 
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdfDOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
DOC-20240602-WA0001..pdf DOC-20240602-WA0001..pdf
 
Personal Brand Exploration Comedy Jxnelle.
Personal Brand Exploration Comedy Jxnelle.Personal Brand Exploration Comedy Jxnelle.
Personal Brand Exploration Comedy Jxnelle.
 
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
一比一原版(TMU毕业证)多伦多都会大学毕业证如何办理
 
一比一原版(YU毕业证)约克大学毕业证如何办理
一比一原版(YU毕业证)约克大学毕业证如何办理一比一原版(YU毕业证)约克大学毕业证如何办理
一比一原版(YU毕业证)约克大学毕业证如何办理
 
New Explore Careers and College Majors 2024.pdf
New Explore Careers and College Majors 2024.pdfNew Explore Careers and College Majors 2024.pdf
New Explore Careers and College Majors 2024.pdf
 
皇冠体育- 皇冠体育官方网站- CROWN SPORTS| 立即访问【ac123.net】
皇冠体育- 皇冠体育官方网站- CROWN SPORTS| 立即访问【ac123.net】皇冠体育- 皇冠体育官方网站- CROWN SPORTS| 立即访问【ac123.net】
皇冠体育- 皇冠体育官方网站- CROWN SPORTS| 立即访问【ac123.net】
 
Brand Identity For A Sportscaster Project and Portfolio I
Brand Identity For A Sportscaster Project and Portfolio IBrand Identity For A Sportscaster Project and Portfolio I
Brand Identity For A Sportscaster Project and Portfolio I
 
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
一比一原版(UVic毕业证)维多利亚大学毕业证如何办理
 
Digital Marketing Training In Bangalore
Digital  Marketing Training In BangaloreDigital  Marketing Training In Bangalore
Digital Marketing Training In Bangalore
 
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaaInteractive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
Interactive Dictionary AIDS-B.pptx aaaaaaaaaaaaaaaaaaaaaaaaaa
 
Full Sail_Morales_Michael_SMM_2024-05.pptx
Full Sail_Morales_Michael_SMM_2024-05.pptxFull Sail_Morales_Michael_SMM_2024-05.pptx
Full Sail_Morales_Michael_SMM_2024-05.pptx
 
How to create an effective K-POC tutorial
How to create an effective K-POC tutorialHow to create an effective K-POC tutorial
How to create an effective K-POC tutorial
 
Personal Brand exploration KE.pdf for assignment
Personal Brand exploration KE.pdf for assignmentPersonal Brand exploration KE.pdf for assignment
Personal Brand exploration KE.pdf for assignment
 
lab.123456789123456789123456789123456789
lab.123456789123456789123456789123456789lab.123456789123456789123456789123456789
lab.123456789123456789123456789123456789
 
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdfRECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
RECOGNITION AWARD 13 - TO ALESSANDRO MARTINS.pdf
 

Linux remote

  • 2. Meterpreter Often, the remote shell will be created via an automatic tool like Metasploit. In the case of a meterpreter shell, two commands become especially beneficial: Use priv – loads extensive permissions Getsystem – uses a few preconfigured techniques in an attempt to escalate privileges Note that these exploits might not always work. 2
  • 3. Known CVE Some exploits exist solely for the purpose of privilege escalation and might be available. • Netfilter • BPF The above are two are examples of Linux exploits for some new kernel versions 4.4. Other exploits will need to be compiled and then transferred to the system. To easily search for these, we can use the tool Searchsploit [keywords]. 3
  • 4. 4 Searching for Exploits Known Exploits Looking for basic system information like OS version and kernel version is easily done. Most people do not worry about every new update, so it is safe to assume that an old OS version will have a known bug. The bug might have been fixed in newer versions, but because no one updated the system, a vulnerability still exists. Below are some common search engines for exploits: ENGINE USAGE RESULTS msfconsole msf> search [key words] Exploits and payloads available for usage right from the msf console itself searchsploit searchsploit [key words] The results from the exploit-db, including precompiled C code and documentation exploitDB https://www.exploit-db.com/ Exploits, precompiled C code, documentations and CVE documents
  • 5. Enumeration Gaining control of a remote system is only the first step, then the goal becomes getting to the highest privileges as fast as possible. Enumeration is the process of collecting various information related to the system itself: • System version • Environmental variables • Running services • Installed applications • Scheduled jobs • Permissions LinEnum is a bash script available from github that provides a decent amount of information. 5
  • 6. 6 How Different Data Is Useful DATA INSIGHT Kernel and distribution information This information can help in the process of searching for known exploits Previously/currently logged users Provides insight about other users that might be hackable Group memberships Improve knowledge of the system when searching for weak permissions Sudo executable commands Having sudo executable commands might be a way to PE Environmental information Especially important for identifying bad PATH configurations Automated tasks PE via automated tasks is a common attack vector Network information Knowing the network structure may suggest more targets to exploit Running processes with permissions Some processes may be outdated and exploitable Binaries associated with permissions Binaries with misconfigured permissions are the reason for most PE
  • 7. Plain Text It is surprising how many people leave critical information lying around in text files, notes, or in documents in their home folder. Quickly navigating through some common folders and searching for files labeled “pass” or “secret” might pop a thing or two. There are a few useful built-in tools that perform searches like find and grep, which can be used to search for files or plain text. 7
  • 8. 8 File Permissions File name -rwxr-xr-x 1 root root 10469 Aug 7 2017 savelog Known Exploits When looking at the permissions through the shell, each set of ‘rwx’ corresponds with one of the entities: ‘owner’, ‘group’ or ‘everybody’. The number represents the amount of hard links to the file, and the owner:group corresponds to the ownership assignment of the file. Below is a slightly more graphical explanation: Date modifiedSizeOwner’s group Owner Hard link count Everybody Group Owner Special flags
  • 9. Misconfigured Permissions The Linux architecture has a file representation for everything. For this reason, it is important to understand how Linux file permissions work. The possibility of one file having misconfigured permission is highly likely. Files with different permissions can be found with verities of the find command. For example, find -type f -writable will find all the writable files. 9
  • 10. SETUID When set-user identification permission is set on an executable file, a process that runs this file is granted access based on the owner of the file, usually root, rather than the user who is running the executable file. This special permission allows a user to access files and directories that are normally only available to the owner. When looking at the permissions of an executable, setuid can be noticed by having ‘s’ in the place of ‘x’ at the owner position. SETGID The set-group identification permission is similar to setuid, except that the process's effective group ID is changed to the group owner of the file, and a user is granted access based on permissions granted to that group. When looking at the permissions of an executable setuid can be noticed by having ‘s’ in the place of ‘x’ at the group position. 10 Run As
  • 11. Setuid / Setgid Dealing with Linux permissions can be tricky, especially when encountering setuid or setgid. Using this option is usually done to allow a user to run a program without actually having the privileges to run it. But, in the case the user is given “write” permission for the file, it can be altered and cause the system to run unprivileged commands as root. 11
  • 12. Sudo Permissions on Binaries A Linux System can have a special group of users who are permitted to run a limited number of commands as root. The user-type has low privileges, with the ability to run a listed set of commands as if the user was root. For no specific reason, many commands can spawn a shell, and these commands can be exploited when listed in the sudo list of a user. 12
  • 13. 13 Shell Through Binaries BINARY SHELL Find Find . -exec /bin/bash /; Awk awk 'BEGIN {system("/bin/sh")}' Nmap Nmap --interactive (older versions) Vi :shell Python python -c 'import pty; pty.spawn("/bin/bash")' Perl perl —e 'exec "/bin/bash";' Ruby ruby: exec "/bin/sh" Lua lua: os.execute('/bin/sh')
  • 14. Sudo Permissions Among the worst things in a system to be given root privileges are text editors and programming languages. Most text editors and most programming languages like Python, Perl, or Ruby have built-in commands that allow spawning a shell. Knowing most processes inherit their ancestors’ privileges, a shell spawned through a root editor or a root- privileged programming language will cause a root shell. 14