Network Security

1. Terminology

A hacker can be:

1.1 Black Hat Hacking

A black hat hacker can use one of the following methods:

A black hat hacker may use hacking tool such as:

2. Access Control

When a principal sends a request to a resource, the guard controls which principal can access the resource, where the principals are allowed to be located, and what requests principals are allowed to make.

A firewall controls access to a network, it is a security gateway betweeen the internal and external network. It can be a stateless packet filter (checking the IP addresses and ports), stateful packet filtering (remembering connections and checks current and previous packets), circuit level gateway (fully takes over hosts communication and decides what to allow or block), proxy server (runs on the network, can protect entire LAN. It also performs caching.), application level gateway (runs on the host, can only protect their host), or hybrid firewall. They can be software based, or hardware based.

2.1 Access Via Proxy

A proxy can filter incoming / outgoing traffic. A private network is only accessible via a proxy. It can operate in three modes:

2.2 Bastion Hosts

A bastion host expects to be attacked. It performs auditing / logging, and should run a trusted / secure OS. Only runs necessary services, and should be isolated from the rest of the network. It should be monitored, and should be able to detect and respond to attacks.

A bastion host may act as a proxy firewall - in the midst of a logical connection, can filter based on message content, scan for data leaks, and even rewrite data.

2.3 Stateful Inspection

A stateful inspection firewall keeps track of the state of active connections. It:

2.4 IDS, IPS, NGFW, UTM

2.5 Port Forwarding

A demilitarized zone (DMZ) is the neutral zone between the internal and external networlk. All non-DMZ hosts are hidden / protected by the gateway / router / firewall. The router uses NAT to get the external messages to the correct internal host. To expose an internal host, we have to use port forwarding.

Port forwarding lets the router know that packets for certain ports should be forwarded directly to an internal host / port. This should be done with caution, as it can expose your network to attacks. It is useful to host servers on your network, such as a web server, mail server, or game server.

2.6 Getting Around Firewalls

3. Encryption

We work with a ciphertext , and plaintext . Only some users should have and . Without , an attacker can only find by enumerating all possible , which is not feasible if the domain of is large.

In secret-key or symmetric encryption, . In this case, must be carefully distributed to all hosts who are to access the channel.

When , we have assymetric encruption, where is the private key of a host , and is never shared, and is the public key of host , and is freely distributed. If we encrypt the message with the public key of the destination, only the destination can decrypt it. We also encrypt the message with the senders private key, so that the receiver can verify that the sender has sent it.

Although assymmetric encryption is slower, it is much more secure.

3.1 Deffie - Hellman

We must exchange keys used for encryption, over a public, unsecured channel:

  1. Bob and Alice agree on a generator and large prime number .
  2. Bob chooses a secret number , and Alice chooses a secret number .
  3. They use their secret value to caclulate a public value, and exchange it.
  4. They then use each other's public value to calculate a shared secret key.

An alternative solution is to use a trusted key server to distribute keys. This is more secure, but requires a trusted third party.

3.2 Hashing

A hash function is a function that maps data of arbitrary size to a fixed size. It is a one-way function, meaning that it is easy to calculate the hash of a message, but hard to find a message that hashes to a given value. It is also hard to find two messages that hash to the same value. The hash value is a fixed size alphanumeric string.

Websites may store a password hash for authentication instead of a password itself. Rainbow tables can be used to quickly search for precomputed hash values, so websites may use password salting to make your password stronger (e.g. hash(password + salt)).

Back to Home