什么是rbash?
先解释下什么是bash,bash是shell的一种,一种壳层与命令行界面,是Unix操作系统下传统的用户和计算机的交互界面。而rbash中,r for restricted,意思是受限制的bash,即该bash被管理员限制了部分命令,如whoami,su,cat等常用命令不能使用,从而降低被入侵的可能
rbash绕过
即使受到了限制,也有方法绕过。通常是利用系统内的软件执行外部命令来绕过,常用的有vim,find,python,git,ssh等等
利用vim进行绕过
cat 命令被禁用
vi aaa.txt
在vim里面输入
1 | :set shell=/bin/sh |
得到一个新的shell
此时还不能用全部命令,用export添加环境变量
修改后就可以使用全部命令了
方法二
使用命令
1 | BASH_CMDS[a]=/bin/sh;a |
If you like this blog or find it useful for you, you are welcome to comment on it. You are also welcome to share this blog, so that more people can participate in it. If the images used in the blog infringe your copyright, please contact the author to delete them. Thank you !