



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




I (^) TCP/IP communication first needs a server to open a port I (^) “Speaking” to the service on the other side needs knowledge about the higher-level protocol I (^) Some services announce what they are through a “banner” I (^) Internet Assigned Numbers Authority (IANA) defines list of known ports and services I (^) Same port for UDP and TCP (but service is not necessarily listening on both) I (^) List in file /etc/services I (^) It is of course not mandatory to use these ports, but it’s what clients assume
TCP/UDP port Service 21 File Transfer Protocol (FTP) 22 Secure Shell (SSH) 25 Simple Mail Transfer Protocol (SMTP) 53 Domain Name Server 80 Hypertext Transfer Protocol (HTTP) 110 Post Office Protocol (POP3) 143 Interim Mail Access Protocol (IMAP) 443 HTTP over SSL/TLS (HTTPS) 465 SMTP over SSL/TLS (SMTPS) 993 IMAP over SSL/TLS (IMAPS) 995 POP3 over SSL/TLS (POP3S)
I (^) Can use netcat to connect to any port: netcat www.google.com 80
I (^) Alternative: telnet, for example telnet www.google.com 80
I (^) Originally made to provide command-line interface to remote host I (^) Telnet server’s standard port is 23 (insecure and obsolete today) I (^) Can also be used to connect to any other port, behaves much like netcat (with small differences for line endings etc.) I (^) netcat and telnet don’t work with SSL connections I (^) Use OpenSSL’s s_client instead, e.g.:
openssl s_client -connect encrypted.google.com:
I (^) Typical thing to first figure out about a remote, unknown computer: list of open ports I (^) Port scanning means “trying all ports” I (^) Widely used tool for port scans: nmap I (^) A simple nmap arya will scan 1000 ports on arya I (^) Default scan method for non-privileged user: connect() scan: I (^) Use the OS’s connect() system call to connect to a remote port I (^) connect() succeeds: port is open I (^) connect() fails: port is closed I (^) Immediately close connection after successful connect() I (^) This scanning method does not need root privileges I (^) “Filtered” means that a firewall blocks access (more later in this lecture) I (^) Scan all ports (including high ports) through
nmap -p 1-65535 arya