首页 > 其他分享 >Wargames-Bandit-Level19

Wargames-Bandit-Level19

时间:2022-12-03 15:22:55浏览次数:42  
标签:do Wargames bandit20 用户 Bandit bandit19 Level19 ID bandit

Level 19

目录

Level Goal

To gain access to the next level, you should use the setuid binary in the homedirectory. Execute it without arguments to find out how to use it. The password for this level can be found in the usual place (/etc/bandit_pass), after you have used the setuid binary.

Solution

提示执行bandit20-do程序,貌似是以bandit20的身份执行命令,先执行一下看看:

bandit19@bandit:~$ ./bandit20-do id
uid=11019(bandit19) gid=11019(bandit19) euid=11020(bandit20) groups=11019(bandit19)

这里有一个euid的概念:

实际用户ID(RUID):用于标识一个系统中用户是谁,一般是在登录之后,就被唯一确定的,就是登陆的用户的uid

有效用户ID(EUID):用于系统决定用户对系统资源的权限。也就是说当用户做任何一个操作时,最终看它有没有权限,都是在判断有效用户ID是否有权限,如果有,则OK,否则报错不能执行。在正常情况下,一个用户登录之后(我们假设是A用户),A用户的有效用户ID和实际用户ID是相同的,但是如果A用户在某些场景中想要执行一些特权操作,而上面我们说到用户的任何操作,LINUX内核都是通过检验有效用户ID来判断当前执行这个操作的用户是否具有权限,显然是特权操作,A用户没有权限,所以A用户就只能通过一定的手段来修改当前的有效用户ID使其具有执行特权操作的权限。这里说明了为什么我们需要修改有效用户ID,就是想再某一时刻能够执行一些特权操作。

保存设置用户ID(SUID):是有效用户ID副本,既然有效用户ID是副本,那么它的作用肯定是为了以后恢复有效用户ID用的。

可以看到执行bandit20-do可以以bandit20的身份执行命令,那么就很简单了,直接用bandit20-do看password即可:

bandit19@bandit:~$ ./bandit20-do ls /etc/bandit_pass/
bandit0   bandit11  bandit14  bandit17  bandit2   bandit22  bandit25  bandit28  bandit30  bandit33  bandit6  bandit9
bandit1   bandit12  bandit15  bandit18  bandit20  bandit23  bandit26  bandit29  bandit31  bandit4   bandit7
bandit10  bandit13  bandit16  bandit19  bandit21  bandit24  bandit27  bandit3   bandit32  bandit5   bandit8
bandit19@bandit:~$ ./bandit20-do cat /etc/bandit_pass/bandit20
VxCazJaVykI6W36BkBU0mJTCM8rR95XT

标签:do,Wargames,bandit20,用户,Bandit,bandit19,Level19,ID,bandit
From: https://www.cnblogs.com/dyhaohaoxuexi/p/16947749.html

相关文章

  • Wargames-Bandit-Level18
    Level18目录Level18LevelGoalSolutionLevelGoalThepasswordforthenextlevelisstoredinafilereadmeinthehomedirectory.Unfortunately,someonehas......
  • Wargames-Bandit-Level17
    Level17目录Level17LevelGoalSolutionLevelGoalThereare2filesinthehomedirectory:passwords.oldandpasswords.new.Thepasswordforthenextlevelis......
  • Wargames-Bandit-Level16
    Level16目录Level16LevelGoalSolutionLevelGoalThecredentialsforthenextlevelcanberetrievedbysubmittingthepasswordofthecurrentleveltoapor......
  • Wargames-Bandit-Level12
    Level12目录Level12LevelGoalSolutionLevelGoalThepasswordforthenextlevelisstoredinthefiledata.txt,whichisahexdumpofafilethathasbeenr......
  • Wargames-Bandit-Level11
    Level11目录Level11LevelGoalSolutionLevelGoalThepasswordforthenextlevelisstoredinthefiledata.txt,wherealllowercase(a-z)anduppercase(A-Z......
  • Wargames-Bandit-Level15
    Level15目录Level15LevelGoalSolutionLevelGoalThepasswordforthenextlevelcanberetrievedbysubmittingthepasswordofthecurrentleveltoport300......
  • Wargames-Bandit-Level14
    Level14目录Level14LevelGoalSolutionLevelGoalThepasswordforthenextlevelcanberetrievedbysubmittingthepasswordofthecurrentleveltoport300......
  • Wargames-Bandit-Level13
    Level13目录Level13LevelGoalSolutionLevelGoalThepasswordforthenextlevelisstoredin/etc/bandit_pass/bandit14andcanonlybereadbyuserbandit14......
  • Wargames-Bandit-Level5
    Level5目录Level5LevelGoalSolutionLevelGoalThepasswordforthenextlevelisstoredinafilesomewhereundertheinheredirectoryandhasallofthefo......
  • Wargames-Bandit-Level9
    Level9目录Level9LevelGoalSolutionLevelGoalThepasswordforthenextlevelisstoredinthefiledata.txtinoneofthefewhuman-readablestrings,prece......