当前位置:网站首页>Without sxid, suid & sgid will be in danger- Shangwen network xUP Nange
Without sxid, suid & sgid will be in danger- Shangwen network xUP Nange
2022-07-03 03:37:00 【Shangwen network】
Into the Q Group 11372462 Receive exclusive registration benefits !
# Said in the previous
as everyone knows ,Linux Except under the system r 、w 、x Beyond these basic permissions , also suid 、 sgid as well as sticky This is commonly known as the existence of the three brothers of special authority ; What are the functions of these three special permissions , The following is true suid 、 sgid as well as sticky Explain the role of :
- SUID jurisdiction :
It can only be applied to executable files , When the user executes the execution file , Will temporarily have the permission of the owner of the execution file .passwd The command enables SUID function , So most users are using passwd When the command changes the password , Will temporarily own passwd Order the owner root User's rights . - SGID jurisdiction :
SGID Attributes can be applied to directories or executables . When SGID When attributes are applied to a directory , The owning group of all files or subdirectories created in this directory will be the owning group of this directory . such as /upwendir The owning group of the directory is upwen, When /upwendir The directory has SGID Attribute , Any owning group of files or subdirectories created by users in this directory will upwen; When SGID When attributes are applied to an executable , Other users will temporarily have the permissions of the executable group when using the executable . - Stikcy jurisdiction :
Sticky Attributes can only be applied to directories , When the directory has Sticky Attribute all the files or subdirectories in this directory. No matter what the permissions are, only the owner of the file or subdirectory and root User can delete .
that , Although the above three permissions are called special permissions , But in fact, it also has security risks and hidden dangers , Next , Let's list bash Command by giving suid The scenario of raising rights with special permission ,Let 's go ! ! !
# once SUID/SGID The case of raising power
We build a new one upnange The average user , And through the bash Give orders to suid(chmod u+s) jurisdiction :
Next , We carry out bash -p Carry out the right raising operation , At this time upnange Users can view it at will /etc/shadow file :
# Use sXid Monitor what's going on SUID/SGID
##sXid Definition
SUID/SGID There may be security risks in the file . To reduce risk , We have been from root Has deleted s position , These programs don't absolutely need this privilege , But future and existing files may enable these without notice s position .
sXid It's a multi in one suid/sgid Monitoring program , It aims at regularly starting from cron function . Basically, it will track your s[ug]id Any changes in files and folders . If there is any new 、 No longer set 、 Or they have changed bits or other modes , Then it will report the changes in an easy to read format via email or command line .sXid The task will be performed automatically to find all on your server SUID/SGID And report them .
##sXid install
Source package installation sXid.
After installation ,sXid The corresponding program installation path is /usr/local/bin/sxid
##sXid To configure
We need to put the configuration file in /usr/local/etc/ Under the table of contents : You can modify... In the configuration file , hold EMAIL=“root” Change to the required user .
Add the following content to the planning task , In this way, you can check periodically according to the planned task Linux Systematic suid | sgid Changes to :
Conduct manual inspection after configuration
# Said at the end
This time, , We know through bash Raise the right suid&sgid scene , be based on sXid monitor Linux Systematic uid&sgid, These are what we become Linux The essential basic skills of the great God ;UP Brother Nan, help the little friends come here first , Later, through the feedback used by the big guys , Welcome to join the group 11372462, communication IT Industry development and knowledge , I feel this article is useful , You can also ask for attention CSDN, Focus on UPWEN The public, .UP Nange continues to output the purest IT Industry development and knowledge !
边栏推荐
- 递归:快速排序,归并排序和堆排序
- Pytorch multi card distributed training distributeddataparallel usage
- Convert binary stream to byte array
- Pytoch lightweight visualization tool wandb (local)
- softmax的近似之NCE详解
- FileZilla Client下載安裝
- Introduction to mongodb
- Summary of electromagnetic spectrum
- @The difference between Autowired, @qualifier, @resource
- Recursion: quick sort, merge sort and heap sort
猜你喜欢
Summary of matrix knowledge points in Chapter 2 of Linear Algebra (Jeff's self perception)
Recursion: depth first search
Download and install node, NPM and yarn
Stop using system Currenttimemillis() takes too long to count. It's too low. Stopwatch is easy to use!
别再用 System.currentTimeMillis() 统计耗时了,太 Low,StopWatch 好用到爆!
Docker install and start MySQL service
用Three.js做一个简单的3D场景
没有sXid,suid&sgid将进入险境!-尚文网络xUP楠哥
Limit of one question per day
Pat class B "1104 forever" DFS optimization idea
随机推荐
Applet get user avatar and nickname
Vs 2019 installation and configuration opencv
Limit of one question per day
Lvgl usage experience
[combinatorics] basic counting principle (addition principle | multiplication principle)
Summary of electromagnetic spectrum
[mathematical logic] propositional logic (propositional logic reasoning | formal structure of reasoning | inference law | additional law | simplification law | hypothetical reasoning | refusal | disju
动态规划:最长回文子串和子序列
FileZilla client download and installation
【AI实战】应用xgboost.XGBRegressor搭建空气质量预测模型(一)
Nce detail of softmax approximation
Why does thread crash not cause JVM crash
numpy之 警告VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences
Some preliminary preparations for QQ applet development: make an appointment for a development account, download and install developer tools, and create QQ applet
Pytorch multi card distributed training distributeddataparallel usage
403 error displayed when vs cloning
npm : 无法将“npm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
[mathematical logic] propositional logic (propositional and connective review | propositional formula | connective priority | truth table satisfiable contradiction tautology)
Use three JS make a simple 3D scene
Mongodb replication set [master-slave replication]