Member-only story
Bypass Restricted shell | Privilege Escalation Techniques [EJpt exam]
This article helps you to bypass restricted shell basically this methods comes around Privilege Escalation and also helps in EJpt exam.

Hi Horbio this side , and welcome back to my new article . This article is based upon Privilege Escalation that is very helpful for you. Today you will learn how to get root access on Linux machines. There are lot of methods to bypass the restricted shell. We will learn about all possible methods. This article is based on my research so make sure you appreciate my efforts by giving claps and drop comments.
Introduction :
Restricted shell is used to setup controlled environment than the standard shell which means if bash started with rbash , or -r option the shell becomes restricted.
Restrictions with in rbash :
- cd commands
- PATH
- ENV
- Importing function
- specifying file name Containing argument ‘/’
- Specifying file name Containing argument ‘-’
- Redirecting Output using ‘>’ , “>>”, ‘>/”, “>&” , ‘&>’
- Turing off restriction using ‘set +r’ or ‘set + o’
Methods to bypass rbash:
- Bypass rbash using Editors
- vi (editor)
- ed (editor)
2. Bypass rbash using one linear
- Python
- perl
- Awk
3. Bypass rbash through Reverse shell
4. Bypass rbash using system binaries
- more
- man
- less
5. Bypass rbash using Expect
6. Bypass rbash through SSH
Bypass rbash using Editors :
- using vi editor :
vi
:set shell=/bin/sh
:shell
now if you will try to access any thing.
2. using ed editor :
ed
!'/bin/sh'