mirror of
https://github.com/AbdullahRizwan101/CTF-Writeups
synced 2025-02-16 20:18:24 +00:00
Update stabilize shell.md
This commit is contained in:
parent
0a18888d4e
commit
e7d568d1bb
1 changed files with 21 additions and 28 deletions
|
@ -1,43 +1,36 @@
|
|||
---------------------------------
|
||||
CTF
|
||||
---------------------------------
|
||||
|
||||
# Stablilize Shell
|
||||
1) ctrl+z
|
||||
2) stty raw -echo
|
||||
3) fg (press enter x2)
|
||||
4) export TERM=xterm
|
||||
1. ctrl+z
|
||||
2. stty raw -echo
|
||||
3. fg (press enter x2)
|
||||
4. export TERM=xterm , for using `clear` command
|
||||
|
||||
# Spawn bash
|
||||
1) /usr/bin/script -qc /bin/bash 1&>/dev/null
|
||||
2) python -c 'import pty;pty.spawn("/bin/bash")'
|
||||
3) python3 -c 'import pty;pty.spawn("/bin/bash")'
|
||||
* /usr/bin/script -qc /bin/bash 1&>/dev/null
|
||||
* python -c 'import pty;pty.spawn("/bin/bash")'
|
||||
* python3 -c 'import pty;pty.spawn("/bin/bash")'
|
||||
|
||||
|
||||
# Finding Binaries
|
||||
|
||||
1) find . - perm /4000 (user id uid)
|
||||
2) find . -perm /2000 (group id guid)
|
||||
----------------------------------
|
||||
KoTH
|
||||
----------------------------------
|
||||
* find . - perm /4000 (user id uid)
|
||||
* find . -perm /2000 (group id guid)
|
||||
|
||||
strace - debugging / tamper with processes
|
||||
gbd - c/c++ debugger
|
||||
script - records terminal activites
|
||||
# King Of The Hill (KoTH)
|
||||
|
||||
w /who (check current pts ,terminal device)
|
||||
ps -t ps/pts<number> (process monitoring)
|
||||
script /dev/pts/<number>
|
||||
* strace `debugging / tamper with processes`
|
||||
* gbd `c/c++ debugger`
|
||||
* script - records terminal activites
|
||||
* w /who `check current pts ,terminal device`
|
||||
* ps -t ps/pts<number> `process monitoring`
|
||||
* script /dev/pts/<number> `montior terminal`
|
||||
* cat /dev/urandom > /dev/pts/<number> 2>/dev/null `prints arbitary text on terminal`
|
||||
|
||||
cat /dev/urandom > /dev/pts/number
|
||||
|
||||
# Closing other shell
|
||||
# Closing Shells/Sessions
|
||||
|
||||
pkill -9 -t pts/number
|
||||
|
||||
# Changing file attributes
|
||||
|
||||
chattr + i <filename> (making file immutable)
|
||||
chattr -i <filename> (making file mutable)
|
||||
lschattr <filename>
|
||||
chattr + i <filename> `making file immutable`
|
||||
chattr -i <filename> `making file mutable`
|
||||
lschattr <filename> `Checking file attributes`
|
||||
|
|
Loading…
Add table
Reference in a new issue