Zero to Hero Flashcards
List out all files in a directory that aren’t all shown in standard ls
ls -la
Copies file into new directory
cp new.txt Desktop/new.txt
move file into new directory
mv new.txt Desktop/new.txt
locate a file
updatedb (to update the command)
locate new.txt
What does this mean?
-rw-r–r–
File owner: read and write
Group Owner: read
All other permissions: read
What does {chmod +x new.txt} do?
It gives all user levels executable permission
-rw-r–r–
—>
-rwxr-xr-x
How can I add a user
adduser bob
how to see all users on the machine?
cat /etc/passwd/
How to see the hash for each user
cat /etc/shadow/
How can I switch users on the machine at the CLI?
su bob
How can I switch back to root user?
su -
How to view recent activity via CLI
cat auth.log
How can I print out my information
ifconfig
How can I limit a ping to 1 packet
ping -c 1 {IP address}
what does arp -a do?
It associates IP addresses with MAC addresses
What does netstat -ano do?
Shows you all the ports that are open and what is connected to those ports
What does route do?
??
How do you check the history of all commands you have run?
history
How can you check the previous times you have run the ping command?
history | grep ping
How would you write the following text “hello world” into a new file named newFile.txt?
echo “hello world” > newFile.txt
How can you add more text to a file without overwriting the existing text?
echo “hello world again”»_space; newFile.txt
what does the {touch} command do?
Allows you to create a new file i.e. touch hello.txt
How could you get rid of a program i.e. impacket?
apt purge impacket
How could you find your IP address?
ifconfig
How do you start a service?
service apache2 start
service ssh start
service postgresql start
How do you configure your services to start automatically when rebooting your computer?
systemctl enable ssh
systemctl enable postgresql
How do you configure your services to start automatically when rebooting your computer?
systemctl enable ssh
systemctl enable postgresql
How could you write the information from a single packet ping into a new text file?
ping -c 1 {IP address} > ip.txt
From this:
PING 192.168.1.254 56(8) bytes of data.
64 bytes from 192.168.1.254: icmp_sequ=1 ttl=128 time=0.594
How can you extract out the IP address?
ping -c -1 192.168.1.254 | grep “64 bytes” | cut -d “ “ -f 4 | tr -d “:”
How could you loop through a list of IP addresses that are up on a network and run nmap on each of them?
for ip in $(cat iplist.txt); nmap -p 80 -F4 $ip & done
What are the five stages of hacking?
- Reconnaissance (passive and active)
- Scanning and enumeration
- Gaining access
- Maintaining access
- Covering tracks
List the components of passive recon for web/host
Target validation - WHOIS, nslookup, dnsrecon
Finding subdomains - Google fu, fig, nmap, sublist3r, bluto, crt.sh
Fingerprinting - nmap, Wappalyzer, WhatWeb, BuiltWith, Netcat
Data breaches - HaveIBeenPwned
What are some ls flags and what do they do?
-l = lists out long format
-a = lists out all file including hidden files
What does theharvester do and what cli do you use?
It finds emails, subdomains and hostname IPs with the given domain name
theharvester -d telsa.com -l 500 -b google
What does bluto do and what cli do you use?
It looks through haveIpwned information, it does active DNS recon (zone transfers) and brute force attacks
bluto
->target Domain: tesla.com
What website can you use to search for subdomains via certificates?
crt.sh
Should you scan TCP, UDP or both?
mostly TCP, but should do both
What types of applications use UDP? and why?
DNS, DHCP, SNMP. Don’t need reliability, just fast connection
What is the process of a TCP connection?
Three way handshake
SYN ->
<- SYN, ACK
ACK ->
How does stealth scanning work?
-> SYN
<- SYN ACK
-> RST
What does the -T4 flag do?
It represents speed T1 - T5 on nmap
How many ports are by default scanned using nmap?
Is the default number good or bad? Why?
‘Top 1000’
Its better to scan more than the default as you may miss some with open connections
What does the -A flag enable in nmap scan?
It enables OS detection, version detection, script scanning and traceroute
It basically means ‘intense’
what does -p- flag do in nmap?
It makes the nmap scan all ports
Explain the concept of staging with nmap.
First, scan all ports to see which are open.
nmap T4 -p- {IP Address}
THEN, scan the ports that are open more intensely.
nmap T4 -p53, 404, 80, 111 {IP Address}
This avoids unnecessarily intensely scanning all unopened ports.
What kind of output does -oA give you with nmap?
normal, XML, s|<rIpt kIddi3, Grepable format
How would you check was rwx right each file has
use ls -l or ls -a
how do you change your password?
passwd
If you have a command in mind, but don’t know exactly what it is, how can you figure it out using the cli?
apropose copy
How do you find out who is logged into your system?
w or who
What does TTY mean and where can you find it?
TTY = teletype and stands for user sessions
You can find it using command w
How do you find the kernal version and name
uname
what does the uptime command do?
Tells you how long the machine has been up, the number of users sessions and average load
How do you find every log in and reboot that has happened in the system
last
How can you find the total storage left in the linux system?
df -h (h = human-readable)
Imagine you need to connect to one of your machines, somewhere in the cloud. How would you go about connecting to that machine securely and getting a shell on it?
Is there a VPN to connect to first?
SSH is standard tool to connect to remote host?
What does the SSH command look like?
How would you authenticate? password/key?
Don’t want root login enabled
what directory am i in?
pwd
how to copy text into an existing file?
echo “G’day” > file.txt
How to copy a file into another directory?
cp {filename} {path}
i.e.
cp file.txt /test/putHere
How would you copy a file from the remote host to another remote host or the work laptop you are currently using?
rsync root@{IP address}:/root/myfile.txt
Say we are on a box that is running Ubuntu, how would you manage services on this box?
systemctl start nginx
systemctl status nginx
curl localhost (check access)
systemctl stop
What is the difference between starting a service and enabling it?
Starting = just starts it for that session
Enabling = starts automatically upon each boot up
How would you see what all the files in var/log are taking up space?
du -sh var/log/*
how to find IP address of the eth0 interface
ip addr show
What is your default route?
ip route show
What is an init system?
init is the first real process that the kernel starts
init is responsible for starting all of the services, units that you expect to have running
init is responsible for reparenting orphaned processes
What is a linux user made of?
It is an entry in a few different text file etc/group, etc/shadow, etc/passwd
What is the shell?
Program that takes your commands and sends them to the operating system. These are launched by the Terminal.
How do you create a file called myfile?
touch myfile
What command can you use to find the file type of a file?
file
How can you read the contents of two files, file1 and file2 combined together?
cat file1 file 2
How do you quit out of a less command?
q
How do you copy myfile into another directory while making sure to notify yourself if there is a file in that directory with another name?
cp -i myfile /home/pictures
How do you copy over all files that have the extension .jpg into another file?
cp *.jpg home/pictures
How do you copy over a directory into another directory?
cp -r directorytoCopy home/directorycopyto
how do you move two files into another directory?
mv file1 file2 /home/..
How do you rename a file or directory?
mv oldfile newfile
mv olddir newdir
how do you make a backup of a folder when moving it?
mv -b dire1 dire2
How do you make subdirectories when making a new directory?
mkdir -p books/hemmingway/favourites
how do you remove a file
and how do you remove a directory?
rm file
rmdir directory
What protection level must a file have to restrict from straight out removing?
and how can you overcome the restriction?
Write-protected
you can overcome it by using the -f flag for force i.e.
rm -f file
How do you find a file in your home folder called puppies.jpg?
find /home -name puppies.jpg
How do you search for a folder called MyFolder in your home directory? You only want to search for directories. How can you do this?
find /home -type d -name Myfolder
What are the 4 main ways you can find information about a command?
pwd –help
help pwd
whatis
man
How do you set an alias for command?
alias foobar=’ls -la’
Note, this wont be saved after reboot
How do you exit from the shell?
exit
or
logout
how to append this text: “sample text” to a file named ‘Mate.txt’?
echo sample text»_space; Mate.txt
How would you redirect an ls call to be printed into a text file?
ls var/log > output.txt
How would you create an empty file?
> someFile.txt
or
touch someFile.txt
how would you read in from one file and paste it into another new file?
cat file1.txt > file2.txt
What are streams?
I/O streams are things like stdin, stdout and stderr
They can be called using file descriptors:
0 = stdin
1 = stdout
2 = stderror
How would you send a stderror to a file?
ls fake/directory 2> peanuts.txt
How would you direct both stdout and stderr to a file?
ls fake/directory &> peanuts.txt
How would you redirect stderror outputs to a special file call?
ls fake/directory 2> /dev/null
How can you see all items in a directory AND stdout it into a file?
ls | tee peanuts.txt
How do find the path to your home directory?
echo $HOME
How do you see your username?
echo $USER
Where do things like $HOME and $USER come from?
environment variables (env)
I have some text in a text file test.txt:
hello world; test
I want to cut out and present the part after ‘;’. how do I do it?
cut -f 2 -d ‘;’ test.txt
how do you paste content?
paste -d ‘ ‘ -s sample2.txt
how do you just display the first, say 20 lines of a cat?
head -n 20 /var/log/syslog
What is the default number of lines shown by the head command?
10
How do you just display the last, say 20 last lines of cat?
tail -n 20 /var/log/syslog
What does the following command do?
$ tail -f /var/log/syslog
It follows the file such that you can see everything that is getting added to that file
How do you join two files by field?
The two files must be ordered i.e.
1 Zac
2 Jack
3 Mack
Simunovic 1
Thackrey 2
James 3
Then do:
join -1 2 -2 1 text1.txt text2.txt
How do you sort text in a file?
How do you reverse sort?
How do you sort via numerical value?
sort file.txt
sort -r file.txt
sort -n file.txt
How do you translate from lower case to upper case?
tr a-z A-Z
hello
How can you remove duplicates from a text file?
unique text.txt
How do you get the number of occurances of a line?
unique -c text.txt
How do you return unique values?
uniq -u text.txt
How do you return duplicate values?
uniq -d text.txt
How would you overcome the limitation of uniq not picking up non-adjacent duplicates?
sort text.txt | uniq
How do you get the word count of a line?
wc
What does grep do
Is searches through text and returns matches
How can you use grep case insensitively?
grep -i hello helloWorld.txt
How would you use grep to search for all files in a directory with a .txt ending?
ls /directory | grep ‘.txt$’
Where can you find the UID for users?
cat /etc/passwd
What does each of these fields mean?
root:x:0:0:root:/root:/bin/bash
root = username
x = user’s password (stored in /etc/shadow)
0 = UID
0 = Group ID
root = GECOS field (comments about user)
/root = user’s home directory
/bin/bash = user’s shell
Where could you find this sort of information?
root:MyEPTEa$6Nonsense:15000:0:99999:7:::
sudo cat /etc/shadow
what do each of these fields stand for?
root:MyEPTEa$6Nonsense:15000:0:99999:7:::
- Username
- Encrypted password
- Date of last password changed (expressed as number of days since jan 1 1970)
- Minimum password age i.e. number of days a user has to change their password
- Max password age
- password warning period
- password inactivity period
- account expiration date
What is /etc/group for?
Used for user management, that is, different groups with different permissions
in /etc/group, what do these fields stand for?
root:*:0:pete
- Group name
- group password. Note, * = default value
- Group ID
- List of users
how do you add users?
sudo useradd bob
how do you remove users?
sudo userdel bob
How do you change password for a user
passwd bob
explain this:
drwxr-x-r-x
d = directory
rwx = user permissions include read, write, executable
r-x = group permissions include read and executable
r-x = other permissions include read and executable
how can you add user executable permissions to a file?
chmod u+x myfile
How do you remove user executable permissions to a file?
chmod u-x myfile
How do you add write permissions for user and groups?
chmod ug+w
what are the numeric representations for read, write, executable?
read = 4
write = 2
executable = 1
What does:
chmod 755 myfile
do?
7 = 4 + 2 + 1, so user has rwx
5 = 4 + 1, so groups have r-x
5 = 4 + 1, so other users have r-x
how do you modify the user ownership of a file?
sudo chown zac myfile
How do you modify the group ownership of a file?
sudo chgrp imogen myfile
How do you modify both user and group ownership at the same time?
sudo chown zac:imogen myfile
How do you reset permission back to default?
unmask 022
This sets the following:
user = wrx
group = -rx
others = -rx
What allows a user to run a program as the owner of the program file rather than as themselves?
Set User ID (SUID)
-rws
When this permission is set, it allows the users who launched the program to get the file owner’s permission as well as execution permission.
How do you modify the SUID permission?
sudo chmod u+s myfile
of
sudo chmod 4755 myfile
How do you modify the SGID?
sudo chmod g+s myfile
or sudo chmod 2555 myfile
What are the three process permissions?
- effective user ID = ID of the user that is normally the owner
- Real user ID = ID of the user that launched the process
- Saved User ID = Temporary switching from privileged to non-privileged permissions and the elevated user id is waved to SUID so that it can be used for switching back to privileged account
What is the sticky bit? and what is it defined as in the permissions?
It is a permission bit that sticks to a file/directory such that only the owner or root can delete or modify the file.
rwxt
How do you modify the sticky bit?
sudo chmod +t mydir
or sudo chmod 1755 mydir
What are processes and what manages them?
the programs running on your machine. More specifically its where the system allocates memory, CPU, I/O to make the program run. They are managed by the kernel.
How do you see what processes are running on your machine?
ps
What can you see when you run ps?
PID = process id
TTY = Controlling terminal asociated with the process
STAT = Process status code
TIME = total CPU usage time
CMD = Name of executable / command
What can you see when you run ps?
PID = process id
TTY = Controlling terminal asociated with the process
STAT = Process status code
TIME = total CPU usage time
CMD = Name of executable / command
what does ps aux do?
Show info on
a = all processes running inc. those run by others
u = shows more details about the process
x = lists all processes that don’t have a TTY associated with it
What are the fields that you can see in ps aux?
USER: Effective user
PID
%CPU = CPU time used divided by the time the process has been running
%MEM = Ratio of the process’s resident set size to the physical memory on the machine
VSZ = Virtual memory usage
RSS = Resident Set Size, the non-swapped physical memory that the task has used
et al
How can you get real time information about the processes running on your system?
top
What is the difference between a terminal device and a psuedoterminal device?
terminal device is a native hardware device running directly on a console
a psuedoterminal is a software emulation of a terminal - this is the terminal you are used to working in.
What is in charge of processes and how does it work?
Kernel is in charge of processes
When a program is run, the kernel loads up the code of the program in memory, determines and allocates resources and then keeps tabs on each process.
What does the kernel know about a process?
- Status
- The resources the process is using and receives
- Process owner
- Signal handling
How is a new process created?
An existing process clones itself using the fork system call, creating a mostly identical child process.
The child process takes on a new ID (PID) and the parent, the PPID
the execve system call is then called to launch a new program on that process.
What is the init process?
It is like the parent of all processes, which is created by the kernel upon boot up, and assigned a PID of 1. It is given root privileges and runs many processes that keep the system running.
can only be terminated when system shuts down.
How do you terminate a process?
use the _exit system call. This will free up the resources that process was using.
What does a termination status 0 mean?
It lets the kernel know that the process succeeded.
Why is it not enough to simply _exit system call a process?
Because the parent process must first acknowledge the termination of the child process by using the wait system call to check termination.
What happens when a parent process ends before a child process?
They become orphan processes and placed under the care of init, until init calls the wait system call.
What happens when a child terminates and the parent process hasn’t called wait yet?
The kernel turns the child process into a zombie process. The resources are freed up, but the zombie process is still present on the process table.
Why is it bad if there are many zombie processes?
Its bad because they take up space in the process table which may prevent other processes from running.
What are the 6 common signals?
SIGHUP or HUP or 1: Hangup
SIGINT or INT or 2: Interrupt
SIGKILL or KILL or 9: kill
SIGSEGV or SEGV or 11: Segmentation fault
SIGTERM or TERM or 15: Software termination
SIGSTOP or STOP: stop
What are two common special terminal characters that kill / interrupt / suspend a process?
crtl+z
ctrl+c
how do you kill a process?
kill -9 PID
what are the differences between SIGHUP, SIGINT, SIGTERM, SIGKILL, SIGSTOP?
SIGHUP = if a terminal is closed while a process is running
SIGINT = ctrl+c
SIGTERM = kill the process, but allows it to do some cleanup first
SIGKILL = kill the process without any cleanup
SIGSTOP = stop/suspend process
When multiple processes are running, how is the CPU used amongst them?
in ‘time slices’ like a round robin, where each processes has a time slice to complete a process.
This time slicing is handled by the kernel.
What does niceness mean?
It is a way to influence a kernel’s scheduling algorithm for time slicing for different processes.
What does a low niceness level indicate and what does a high niceness level indicate?
High = low priority for the CPU
low = high priority, as much as possible
How can you change the niceness level?
nice -n 5 someprocess upgrade
what is renice used for?
renice 10 -p 3245
It is for setting priority on an existing service.
Where is process information stored?
/proc
There is a subdirectory for every process.
Let’s say you’re working on a single terminal window and you’re running a command that is taking forever. How can you continue interacting with the shell while that command is running?
You can use the & symbol to tell the command to run in the background.
How do you send a job to the background after you have already started running it?
you suspend it with ctrl+z, then run the bg command to send it to the background
How do you move a job from the background to the foreground?
fg %{job number}
i.e.
fg %1
What is the ‘/’ directory called? and what does it contain?
root. It contains the entire filesystem hierarchy
What does the ‘/bin’ directory contain?
Essential, ready-to-run programs
What does the ‘/boot’ directory contain?
kernel boot loader files
What does the ‘/dev’ directory contain?
device files
What does the ‘/etc’ directory contain?
core system configuration directory, should hold only config files and not any binaries
What does the ‘/home’ directory contain?
personal directories for users
What does the ‘/lib’ directory contain?
holds library files that binaries can use
What does the ‘/media’ directory contain?
used as an attachment point for removable media like USB drives
What does the ‘/mnt’ directory contain?
temporary mounted filesystems
What does the ‘/opt’ directory contain?
optional application software packages
What does the ‘/root’ directory contain?
root user’s home directory
What does the ‘/run’ directory contain?
info about the running system since the last boot
What does the ‘/sbin’ directory contain?
essential system binaries, usually can only be ran by root
What does the ‘/srv’ directory contain?
site-sepcific data which are served by the system
What does the ‘/tmp’ directory contain?
Storage for temporary files
What does the ‘/usr’ directory contain?
user installed software and utilities
What does the ‘/var’ directory contain?
variable directory used for system logging, user tracking, caches
hard disks can be subdivided into ________
partitions
e.g.
/dev/sda1
/dev/sda2
What are partitions useful for?
separating data, and if you need a certain filesystem, you can easily create a partition instead of making the entire disk one filesystem type
What are the two main partition table schemes used
Master boot record (MBR) and GUID Partition Table (GPT)
What are disks comprised of ?
partitions, that help organise our data.
What can you have inside a partition?
filesystem or dedicate a par
What is a filesystem?
organised collection of files and directories. Comprised of a database to manage files and the files themselves
What are some different filesystems?
ext4 - most current and standard choice for linuc systems
Btrfs - filesystem with snapshots, incremental backups, performance increases
XFS - High performance journaling file system
NTFS and FAT - windows filesystem
HFS+ - Macintosh filesystem
How do you make a file system
sudo mkfs -t ext4 /dev/sdb2
What must you do before you can view the contents of your filesystem?
mount it. Do mount you need a device location, filesystem type and mount point.
What is a mount point?
directory on the system where the filesystem will be attached.
How do you mount a new filesystem?
sudo mount -t ext4 /dev/sdb2 /mydrive
How do you unmount a filesystem?
sudo unmount /mydrive
How can we automatically mount filesystems at startup?
add them to /etc/fstab
What is a swap partition?
Swap is what we use to allocate virtual memory to our system, and so if you are low on memory, the system uses this partition to swap pieces of memory of idle processes to the disk, so that you’re not bogged down for memory.
How do you see the utilisation of your disks
i.e. check how much of your disk is free
df -h
-h = gives the human readable format
use to check how much of your disk is free
Let’s say your disk is getting full and you want to know what files or directories are taking up that space, what command do you run?
i.e. check how much of your disk is being used
du -h
what does the fsck /dev/sda command do?
It checks the consistency of a filesystem and can try to repair it for us.
What is an inode
It describes everything about a file inc.
file type, owner, group, permissions, size, number of block allocated to the file, pointers to the data blocks etc.
When are inodes created?
when a filesystem is created, so is the space for inodes.
How do you see how many inodes are left on your system?
df -i
how do you view inode numbers?
ls -li
How do inodes locate files?
inodes point to the actual data blocks of your files
what are the 4 stages of the boot process?
- BIOS (basic input/output system
- Bootloader
- kernel
- init
What is BIOS?
Basic input / output system initialises the hardware and makes sure wuth a power-on self test that all hardware is good to go
What is Bootloader?
loads the kernel into memory and then starts the kernel with a set of kernel parameters
What is kernel responsible for in the boot process?
It initialises devices and memory. The main job of the kernel is to load up the init process
What is init responsible for in the boot process?
init is the first process that starts and stops essential services process on the system.
When using Sys V, what are the 7 different runlevels?
0: shutdown
1: Single user mode
2: Multiuser mode w/o networking
3: Multiuser mode with networking
4: unused
5:Multiuser mode with networking and GUI
6: reboot
How do you list all services?
system –status-all
How do you start, stop and restart a service?
sudo service networking start
and
sudo service networking stop
and
sudo service networking restart
How do you shutdown your system in 2 minutes?
sudo shutdown -h -2
How do you restart your system now?
sudo shutdown -r now
how do you reboot your system>
sudo reboot
what does the lsof command do?
It shows what is in use in a process including all open files and their associated processes.
What does the fuser command do?
It is short for file user and tracks infomration about teh process that is using the file or the file user
What is example of multi-threading?
Editing and saving simultaneously in a writing application
Is it more efficient to have a multi-threaded application or multi-process application?
Multi-threaded
What happens in multithreading?
multithreading is where two or more applications with otherwise isolated system resources share these resources, making it easier for them to communicate among each otehr.
how can you view process threads?
ps m
how can you see the load averages on your system?
uptime
how can you monitor CPU usage and disk usage?
iostat
What types of information can you see with iostat?
CPU usages at the user level, usage with nice priority, system level, iowait (CPU idle time during an oustanding disk I/O request
etc
How can you monitor your memory usage?
vmstat
What specifically does VMstat show?
number of processes
amount of used and free memory, memory used as buffers / cache
amount of memory swapped in and out of disk
Amount of blocks received in from a block device, sent out to a block device
number of interrupts per second, number of context switches per second
time spent in user, kernel time, idle
What is kept in teh /var directory?
logs
What does var/log/syslog contain?
one this is that there is daemon running called syslogd, which waits for event messages to occur.
what are the two most important log files in /var/log/..
/messages for messages logged during bootup, auth, cron, daemon
/syslog for everything except auth messages
What is contained in /var/log/dmesg?
information logged about the kernel ring buffer. Useful for hardware and bootup troubleshooting
Where can you find authentication logging?
/var/log/auth.log
info such as authorisation logs, user login and authentication method.
Where can you find authentication logging?
/var/log/auth.log
info such as authorisation logs, user login and authentication method.
what does the scp stand for and do?
scp = secure copy. It works the exact same way as the cp command does, but lets you copy from one host to another on the same network.
How can you copy a file over from local host to a remote host?
scp myfile.txt username@remotehost.com:/remote/directory
How can you copy a file over from a remote host to your local host?
scp username@remotehost.com:/remote/directory/myfile.txt/local/directory
how do you copy a directory from local host to remote host?
scp -r …..
What does rsync do?
It uses a special algorithm that checks in advance if there is already data that you are copying to and will only cover over the difference. It also checks the intergity with checksum
how can you set up a NFS client?
sudo service nfsclient start
sudo mount server:/directory /mount_directory
how do you view your IP address?
ifconfig -a
What does CIDR stand for?
classless inter-domain routing
used to represent a subnet mask in a more compact way
A network interface is how ______
the kernel links up the software side of networking to the hardware side
What does the ifconfig tool allow us to do>
Configure our network interfaces.
What does ifconfig do during bootup?
ifconfig runs on bootup and configures our interfaces through config files
What does ifconfig show?
- MAC address
- inet address (IPv4)
- inet6 address (IPv6)
- subnet mask
- broadcast address
How do you create an interface?
ifconfig eth0 {IP address} netmask {subnet} up
How do you bring up or bring down an interface?
ifup eth0
ifdown eth0
what does the ip command do?
allows us to manipulate the networking stack of a system.
What does ip link show do?
shows interface information for all interfaces
How do you show the statistics of an interface?
ip -s link show eth0
how do you show ip addresses allocated to interfaces?
ip address show
How do you add or delete a route ?
sudo route add -net {IP address} …
sudo route del -net …
What is the ICMP?
internet control message protocol
used to send updates and error messages and is extremely useful protocol used for debugging network issues
how do you check if a packet can reach a host?
ping {ip address}
What does traceroute do?
it follows the routing of packets to a domain i.e. google.com
How does traceroute work?
it works by sending packets with increasing TTL values, starting with 1. it send message back once the TTL is decremented to zero, thus building a trail.
what port is ftp on?
21/tcp
ssh port?
22/tcp
port 25/tcp
smtp
53/tcp
domain
http port
80/tcp
https port?
443/tcp
how can you get information about the various network related information such as network connections, routing tables, interfaces etc?
netstat
what does the netstat -a command show?
the listening and non-listening sockets for network connections.
how can you map a hostname to an IP address?
put it into /etc/hosts
127.0.1.1 icebox
What does nslookup do?
used to query name servers to find information about resource records i.e. gives info about address, server, location etc
What is a poweful tool for getting information about DNS name servers>
dig