# Certifications

# CREST

# Common Ports

<table border="1" id="bkmrk-port-service-7-echo-" style="border-collapse: collapse; width: 100%; height: 2145.38px; border-width: 1px; border-style: solid;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><thead><tr style="height: 29.7969px;"><td style="height: 29.7969px;">**Port**</td><td style="height: 29.7969px;">**Service**</td></tr></thead><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">7</td><td style="height: 29.7969px;">ECHO</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">9</td><td style="height: 29.7969px;">Discard</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">13</td><td style="height: 29.7969px;">Daytime</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">17</td><td style="height: 29.7969px;">QotD (Quote of the Day)</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">19</td><td style="height: 29.7969px;">Chargen</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">20</td><td style="height: 29.7969px;">FTP (data)</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">21</td><td style="height: 29.7969px;">FTP (control)</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">22</td><td style="height: 29.7969px;">SSH</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">23</td><td style="height: 29.7969px;">Telnet

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">43</td><td style="height: 29.7969px;">Whois

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">49</td><td style="height: 29.7969px;">TACACS+

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">53</td><td style="height: 29.7969px;">DNS

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">67</td><td style="height: 29.7969px;">DHCP

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">68</td><td style="height: 29.7969px;">DHCP

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">69</td><td style="height: 29.7969px;">TFTP

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">70</td><td style="height: 29.7969px;">Gopher

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">79</td><td style="height: 29.7969px;">Finger

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">80</td><td style="height: 29.7969px;">HTTP

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">88</td><td style="height: 29.7969px;">Kerberos

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">110</td><td style="height: 29.7969px;">POP3

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">111</td><td style="height: 29.7969px;">Sun RPC Endpoint Managr

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">112</td><td style="height: 29.7969px;">VRRR

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">119</td><td style="height: 29.7969px;">NNTP (network news protocol)

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">123</td><td style="height: 29.7969px;">NTP

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">135</td><td style="height: 29.7969px;">DCE/RPC

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">137</td><td style="height: 29.7969px;">NetBIOS (datagram)

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">138</td><td style="height: 29.7969px;">NetBIOS (session)

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">143</td><td style="height: 29.7969px;">IMAP

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">161</td><td style="height: 29.7969px;">SNMP

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">179</td><td style="height: 29.7969px;">BGP

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">194</td><td style="height: 29.7969px;">IRC

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">389</td><td style="height: 29.7969px;">LDAP

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">443</td><td style="height: 29.7969px;">HTTPS

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">445</td><td style="height: 29.7969px;">SMB/Samba

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">465</td><td style="height: 29.7969px;">SMTP over SSL/TLS

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">500</td><td style="height: 29.7969px;">ISAKMP (VPN)

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">512</td><td style="height: 29.7969px;">rexec

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">513</td><td style="height: 29.7969px;">rlogin

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">514</td><td style="height: 29.7969px;">syslog

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">514</td><td style="height: 29.7969px;">rsh

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">515</td><td style="height: 29.7969px;">LPD (Line Printer Daemon)

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">520</td><td style="height: 29.7969px;">RIP

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">523</td><td style="height: 29.7969px;">DB2

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">546</td><td style="height: 29.7969px;">DHCPv6 (client)

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">547</td><td style="height: 29.7969px;">DHCPv6 Server

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">548</td><td style="height: 29.7969px;">AFP (Apple Filing Protocol)

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">554</td><td style="height: 29.7969px;">RTSP (Real Time Streaming Protocol)

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">631</td><td style="height: 29.7969px;">IPP (Internet Printing Protocol)

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">636</td><td style="height: 29.7969px;">LDAP over SSL

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">860</td><td style="height: 29.7969px;">iSCSI

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">989</td><td style="height: 29.7969px;">FTPS (FTP over SSL) data

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">990</td><td style="height: 29.7969px;">FTPS (FTP over SSL) control

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">995</td><td style="height: 29.7969px;">POP3 over SSL

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">1194</td><td style="height: 29.7969px;">OpenVPN

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">1433</td><td style="height: 29.7969px;">MSSQL

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">1521</td><td style="height: 29.7969px;">Oracle DB

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">1702</td><td style="height: 29.7969px;">L2TP (VPN)

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">1723</td><td style="height: 29.7969px;">PPTP (VPN)

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">1812</td><td style="height: 29.7969px;">RADIUS (Authentication)

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">1813</td><td style="height: 29.7969px;">RADIUS (Accounting)

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">1900</td><td style="height: 29.7969px;">SSDP (UPnP Discovery)

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">2049</td><td style="height: 29.7969px;">NFS

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">3306</td><td style="height: 29.7969px;">MySQL

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">3389</td><td style="height: 29.7969px;">RDP

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">3478</td><td style="height: 29.7969px;">STUN

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">5432</td><td style="height: 29.7969px;">Postgres SQL

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">5900</td><td style="height: 29.7969px;">VNC

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">6000</td><td style="height: 29.7969px;">X11

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">6667</td><td style="height: 29.7969px;">IRC

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">6789</td><td style="height: 29.7969px;">DB2

</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">8080</td><td style="height: 29.7969px;">HTTP Altenative

</td></tr></tbody></table>

# TTL

The operating system sets the initial TTL value or application creating the IP packet. Here are some common default TTL values:

<table border="1" id="bkmrk-operating-system-ttl" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50.0596%;"></col><col style="width: 50.0596%;"></col></colgroup><thead><tr><td>**Operating System**</td><td>**TTL Value**</td></tr></thead><tbody><tr><td>**Linux/MAC OS, Android, Juniper**</td><td>64</td></tr><tr><td>**Windows 95, 98, NT**</td><td>32</td></tr><tr><td>**Windows**</td><td>128</td></tr><tr><td>**Cisco Routers**</td><td>254</td></tr><tr><td>DNS</td><td>Depends on resolver (can range from 128 to 86400)</td></tr></tbody></table>

# rlogin

- Opens ports between 512-514

<table border="1" id="bkmrk-service-port-protoco" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col></colgroup><thead><tr><td>Service</td><td>Port</td><td>Protocol</td></tr></thead><tbody><tr><td>rcp</td><td>514</td><td>TCP</td></tr><tr><td>rexec</td><td>512</td><td>TCP</td></tr><tr><td>rlogin</td><td>513</td><td>TCP</td></tr><tr><td>rsh</td><td>514</td><td>TCP</td></tr><tr><td>rstat</td><td>  
</td><td>UDP</td></tr><tr><td>ruptime</td><td>513</td><td>UDP</td></tr><tr><td>rwho</td><td>513</td><td> </td></tr></tbody></table>

Please note

- rlogin doesn't return any message when connection is successful
- rlogin and rsh use `/etc/hosts.equiv `and `$HOME/.rhosts`
- rlogin uses `rlogind`; rsh uses `rshd `as a daemon

## hosts.equiv and .rhosts format

```js
host1
host2 user_v
-host3
+@group1 -user_c
-@group2
```

<p class="callout warning">The traffic transmitted is unencrypted. The login process is without a password. This is blocked on modern systems</p>

<p class="callout warning">The traffic can be intercepted and spoofed.</p>

# Command Examples

# POP

POP protocol is session based.

<p class="callout info">Changes occur only after you type QUIT.</p>

```bash
USER [username] # type the username
PASS [password] # type the password
QUIT # log out

STAT # Total number of messages and total size
LIST # List all messages - indexed list
RETR [message index] # retrieve the message with the index id
DELE [message index] # Delete specified message
TOP [message index] [num lines] # return headers and top X lines of a message
UIDL [message index] # return unique ID
NOOP # Do nothing (no operation)
RSET # Undelete the messages if any marked for deletion
```

# SMTP

```bash
HELO[FQDN] # establish connection
MAIL FROM # specify email address of the sender
RCPT TO # specify email address of the recipient
DATA # present content of the message (body text, attachments) you must send a . (full stop) on a new line to complete the command
RSET # aborts current transacitons
VRFY # check if user or mailbox exists on the server
NOOP # Do nothing (no operation)
QUIT # Exit
```

# SNMP

Some of the utilities used for SNMP protocol

- snpget
- snmpwalk
- snmpbulkget
- snmpbulkwalk

# SIP

```bash
INVITE # invite a user to a call
ACK # acknowledgment is used to facilitate reliable message exchange for INVITEs.
BYE # Terminates a connection#
CANCEL # Terminates a request, or search for a user.
OPTIONS # solicits information about a server’s capabilities
REGISTER # registers a user’s current location
INFO # used for mid-session signalling
```

# Telnet

```bash
-d #debug
-a #automatic login
-n tracefile # opens tracefile
-l user #specify user
-e escape char # specify escape char
-E # no character is recognised as escape character
-x # activate encryption

#Modes
character # Disables LINEMODE
line # enables LINEMODE
send abort # abort process
environ define variable value # assign a value to a variable
```

# ICMP Responses

The below is not an extensive list. The rest of the responses are either deprecated or experimental

<table border="1" id="bkmrk-type-value-0-echo-re" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50%;"></col><col style="width: 50%;"></col></colgroup><thead><tr><td>Type</td><td>Value</td></tr></thead><tbody><tr><td>0</td><td>Echo reply</td></tr><tr><td>3</td><td>Destination Unreachable</td></tr><tr><td>5</td><td>Redirect</td></tr><tr><td>8</td><td>Echo</td></tr><tr><td>9</td><td>Router Advertisement

</td></tr><tr><td>10</td><td>Router Solicitation</td></tr><tr><td>11</td><td>Time Exceeded</td></tr><tr><td>12</td><td>Parameter Problem</td></tr><tr><td>13</td><td>Timestamp</td></tr><tr><td>14</td><td>Timestamp Reply</td></tr><tr><td>40</td><td>Photuris</td></tr><tr><td>42</td><td>Extended Echo Requests</td></tr><tr><td>43</td><td>Extended Echo Reply</td></tr></tbody></table>

# Misc

# Encryption/Hashing

## Block Ciphers

- ECB - Electronic Code Block
- CBC - Cipher Block Chaining
- OFB - Output Feedback
- CTR - Counter

## Common Encryption algorithms

<table border="1" id="bkmrk-name-bits-key-length" style="border-collapse: collapse; width: 100%; height: 238.375px;"><colgroup><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col><col style="width: 33.3333%;"></col></colgroup><thead><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Name</td><td style="height: 29.7969px;">Bits</td><td style="height: 29.7969px;">Key length</td></tr></thead><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">DES</td><td style="height: 29.7969px;">64</td><td style="height: 29.7969px;">56</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">3DES</td><td style="height: 29.7969px;">168</td><td style="height: 29.7969px;">112</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">IDEA</td><td style="height: 29.7969px;">128</td><td style="height: 29.7969px;">  
</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">RC4</td><td style="height: 29.7969px;">128</td><td style="height: 29.7969px;">40</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">RC5</td><td style="height: 29.7969px;">2048</td><td style="height: 29.7969px;">0</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">AES</td><td style="height: 29.7969px;">256</td><td style="height: 29.7969px;">  
</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">RSA</td><td style="height: 29.7969px;">2048</td><td style="height: 29.7969px;">  
</td></tr></tbody></table>

## Linux Password Hashes

- 1 - MD5
- 2ay - Blowfish
- 5 - SHA256
- 6 - SHA512

## DNS

<table border="1" id="bkmrk-record-type-data-a-i" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 50.0596%;"></col><col style="width: 50.0596%;"></col></colgroup><tbody><tr><td>Record Type</td><td>Data</td></tr><tr><td>A</td><td>IPv4

</td></tr><tr><td>AAAA</td><td>IPv6</td></tr><tr><td>CNAME</td><td>canonical name</td></tr><tr><td>ANAME</td><td>  
</td></tr><tr><td>SOA</td><td>Start of Authority</td></tr><tr><td>NS</td><td>Name Server</td></tr><tr><td>MX</td><td>Mail Exchange</td></tr><tr><td>TXT</td><td>Text record for various (SPF, DMARC, etc)</td></tr><tr><td>PTR</td><td>Pointer record</td></tr></tbody></table>

<p class="callout info">Zone transfers happen over TCP 53. DNS queries over 53</p>