Shell security ——— Be wary of the current directory. Join path~~~ ~ The old king came knocking at the door

Source: Internet
Author: User

your door often opens ~ ~ ~ Lao Wang Please come in ~ ~ (be cautious of the current directory. Join path)



Often hear people say don't put. (current directory) to join the path, in the end why, I think of many times also surf the internet for half a day, and then did not have any eggs with

The final thought, muddying ~ ~ Think of such an example, at least can see the. Directory join path will be what kind of fate !!!

So ~ ~ Speak:

First, the simulation will, the directory into the path

    1. This is the variable of the original path.


2. So now I will. Directory will be entered into path

Keep your eyes wide open @@:Be sure to put the. Directory first, because a command is searched from the path in the front, and if you can't find it, go to the back.


Second, suddenly there is a hacker chicken blood surging want to engage in things, take a look at how he

1. He used an ordinary user to create a script called "Vi" in his home directory.

The script content is simple is to delete a file: (If you change to delete the root directory, the consequences of their own to go to it)

Script content:

2. At this time root user whim, want to go to George her home VI This command to see other files


3. Now Root has entered the George home directory.


Finally look at the root directory of the test file is still there:



If you don't understand it: Add the. Directory to path, wait for the old king next door ~~~~~~~~~~


Finally, welcome to the public: Linux OPS rookie Tour



Shell security ——— Be wary of the current directory. Join path~~~ ~ The old king came knocking at the door

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.