Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Advanced Infrastructure Penetration Testing

You're reading from  Advanced Infrastructure Penetration Testing

Product type Book
Published in Feb 2018
Publisher Packt
ISBN-13 9781788624480
Pages 396 pages
Edition 1st Edition
Languages

Table of Contents (14) Chapters

Preface 1. Introduction to Advanced Infrastructure Penetration Testing 2. Advanced Linux Exploitation 3. Corporate Network and Database Exploitation 4. Active Directory Exploitation 5. Docker Exploitation 6. Exploiting Git and Continuous Integration Servers 7. Metasploit and PowerShell for Post-Exploitation 8. VLAN Exploitation 9. VoIP Exploitation 10. Insecure VPN Exploitation 11. Routing and Router Vulnerabilities 12. Internet of Things Exploitation 13. Other Books You May Enjoy

Insecure VPN Exploitation

Virtual private networks (VPNs) are very useful when it comes to transferring data in a secure way. VPNs enable information security, but they are still exposed to high risks from hackers, every day. If you want to learn how to secure VPNs, this chapter will guide you from the required fundamentals of cryptography to obtaining the skills you need to secure VPNs.

This chapter will cover the following topics:

  • Cryptography
  • VPN fundamentals
  • Insecure VPN exploitation

Cryptography

In the art of cryptology, we have two different sciences: cryptography and cryptanalysis. Cryptography secures information based on mathematical algorithms, while cryptanalysis deals with exposing ciphertexts created by cryptography systems. These two sciences coexist side by side. More simply, cryptography deals with hiding information, and cryptanalysis breaks cryptosystems to reveal the hidden information. Cryptography is not a new science, it is old. There are some classical cryptography techniques, such as Sumerian cuneiform, Egyptian hieroglyphics, scytale, Vigenère cipher, the Caesar cipher, and the ROT13 cipher.

Cryptosystems

The implementation of cryptographic techniques is called a cryptosystem...

Hash functions and message integrity

Hash functions are mathematical functions that take an arbitrarily sized input string, and generate a fixed-size output called a hash value or a message digest. A good hash function
should calculate hashes easily; it will be very difficult to calculate the plaintexts of a given
hash, and it does not generate the same hash for two different inputs, except in rare cases.

There are many well-known hash functions used nowadays; they are as follows:

  • Hashed message authentication code
  • Message Digest (MD2)
  • Message Digest (MD4)
  • Message Digest (MD5), if you want to encrypt or decrypt a plaintext you can use http://md5decrypt.net/en/ shown here:
  • Secure Hash Algorithm (SHA)
  • Whirlpool
  • HAVAL
  • RIPEMD

Digital signatures

...

Steganography

Steganography is the art of hiding messages in a human-readable medium, such as image files, videos, texts, and so on. The changes should be unnoticeable by sight, to mask the message behind the hosted file. The two types of steganography are as follows:

  • Text steganography:
    • Line-shift coding
    • Word-shift coding
    • Feature coding
  • Image steganography:
    • Least significant bit (LSB): Hiding 1 bit of data in every pixel of 8-bit images and 3 bits of data in every pixel of 24-bit images. You can use steglsb to perform LSB steganography:
    • Spread spectrum image steganography (SSIS)
    • F5 algorithm

Key management

Key management is the process of protecting encryption keys. In order to ensure this protection, a life cycle must be maintained, as shown:

  • Key creation
  • Key protection and custody
  • Key rotation
  • Key destruction
  • Key escrow

Cryptographic attacks

In order to retrieve the plaintexts of information, attackers and cryptanalysts are using many techniques:

  • Brute force attack (BFA): During this attack, the attacker will try all the key combinations to retrieve the key
  • Dictionary attack: In this attack, the attacker uses prepared dictionaries and tries the words in them
  • Birthday attack: In the birthday attack, the attacker uses hash collision
  • Ciphertext only attack (COA): In this attack, the attacker possesses the ciphertexts, and he only needs to determine the key
  • Known plaintext attack (KPA): The attacker uses what we call linear cryptanalysis to retrieve the missing plaintexts from ciphers, while he knows some partially plaintexts of the cipher
  • Chosen plaintext attack (CPA): The attacker uses differential cryptanalysis to retrieve the key after choosing the ciphertext and plaintexts by themselves
  • Side...

VPN fundamentals

When it comes to information technology, cryptography plays a huge role in securing information in its different status. Various technical applications use cryptography on a daily basis, such as disk encryption, email security, and communication. VPNs are one of them. By definition, a VPN is a logical network between two sites. The traffic of VPNs is encrypted.

In encryption, we have the following two modes:

  • Link encryption: In this mode, all the information is encrypted, and the message should be decrypted in every hop. In this case, the router should decrypt the message so it knows the routing information, encrypt it again, and forward it to the next hop.
  • End-to-end encryption: In this mode, shown here, the information in the required headers is not encrypted so the routers, for example, don't need to decrypt them, because the routing information is...

Summary

In this chapter, you learned how to secure VPNs. Like every other chapter, we started from the basics and went from cryptology techniques to VPNs, because having a clear understanding of the aspects of a technology will give penetration testers a clearer vision to know how to secure that technology.

In the next chapter, we will discuss common security vulnerabilities which may be present in switches and routers and offers advice on keeping network devices secure.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Advanced Infrastructure Penetration Testing
Published in: Feb 2018 Publisher: Packt ISBN-13: 9781788624480
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime}