2020-09-22 16:39:22 +00:00
|
|
|
# Linux
|
|
|
|
### Stablilize Shell
|
2020-09-10 20:03:04 +00:00
|
|
|
1. ctrl+z
|
|
|
|
2. stty raw -echo
|
|
|
|
3. fg (press enter x2)
|
|
|
|
4. export TERM=xterm , for using `clear` command
|
2020-09-10 19:58:17 +00:00
|
|
|
|
2020-09-22 16:39:22 +00:00
|
|
|
### Spawn bash
|
2020-09-10 20:03:04 +00:00
|
|
|
* /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")'
|
2020-09-10 19:58:17 +00:00
|
|
|
|
2020-09-22 16:39:22 +00:00
|
|
|
### Finding Binaries
|
2020-09-10 19:58:17 +00:00
|
|
|
|
2020-09-10 20:03:04 +00:00
|
|
|
* find . - perm /4000 (user id uid)
|
|
|
|
* find . -perm /2000 (group id guid)
|
2020-09-10 19:58:17 +00:00
|
|
|
|
2020-09-22 16:39:22 +00:00
|
|
|
### Changing file attributes
|
2020-09-10 19:58:17 +00:00
|
|
|
|
2020-09-10 20:05:19 +00:00
|
|
|
chattr + i filename `making file immutable`<br/>
|
|
|
|
chattr -i filename `making file mutable`<br/>
|
2020-09-10 20:04:22 +00:00
|
|
|
lschattr filename `Checking file attributes`
|
2020-09-22 16:34:15 +00:00
|
|
|
|
|
|
|
# Windows Shell
|
|
|
|
|
|
|
|
### Adding User
|
|
|
|
net user "USER_NAME" "PASS" /add
|
|
|
|
### Changing User's password
|
|
|
|
net user "USER_NAME" "NEWPASS"
|
|
|
|
### Adding User to Administrators
|
|
|
|
net localgroup administrators "USER_NAME" /add
|
2020-09-22 16:39:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
# King Of The Hill (KoTH)
|
|
|
|
#### Monitoring and Closing Shell
|
|
|
|
* 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/pts-number 2>/dev/null `prints arbitary text on terminal`
|
|
|
|
* pkill -9 -t pts/pts-number
|