InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Follow publication

Bypass Restricted shell | Privilege Escalation Techniques [EJpt exam]

Mr Horbio
InfoSec Write-ups
Published in
2 min read4 days ago

--

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:

  1. 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 :

  1. 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'

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

--

--

Published in InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Written by Mr Horbio

Here u get bug bounty tips and techniques , grow you learning and earn from this world to survive here🌎

No responses yet

Write a response