What is it? @.@

Here is the place where I record some tactics about wargame, systems, and other security issues.

2014-02-06

OverTheWire - Krypton - Level 1 to Level 2

Description:

Level Info:
Krypton 2

Substitution ciphers are a simple replacement algorithm. In this example of a substitution cipher, we will explore a 'monoalphebetic' cipher. Monoalphebetic means, literally, "one alphabet" and you will see why.

This level contains an old form of cipher called a 'Caesar Cipher'. A Caesar cipher shifts the alphabet by a set number. For example:

plain: a b c d e f g h i j k ... cipher: G H I J K L M N O P Q ...

In this example, the letter 'a' in plaintext is replaced by a 'G' in the ciphertext so, for example, the plaintext 'bad' becomes 'HGJ' in ciphertext.

The password for level 3 is in the file krypton3. It is in 5 letter group ciphertext. It is encrypted with a Caesar Cipher. Without any further information, this cipher text may be difficult to break. You do not have direct access to the key, however you do have access to a program that will encrypt anything you wish to give it using the key. If you think logically, this is completely easy.

One shot can solve it!

Have fun.
Solution:
  1. [Comment] Connect to server and login with username, krypton2, and password, ROTTEN.
  2. sp@simple-plan:~|=> ssh krypton2@krypton.labs.overthewire.org
    ...
    krypton2@krypton.labs.overthewire.org's password: ROTTEN
  3. [Comment] Change directory to the one where we can access the files for krypton levels
  4. krypton2@melinda:~$ cd /krypton
  5. krypton2@melinda:/krypton$ ls
    krypton1  krypton2  krypton3  krypton4  krypton5  krypton6
  6. krypton2@melinda:/krypton$ cd krypton2
  7. krypton2@melinda:/krypton/krypton2$ ls
    README  encrypt  keyfile.dat  krypton3
  8. [Comment] Check the readme file
  9. krypton2@melinda:/krypton/krypton2$ cat README
    Krypton 2
    
    ROT13 is a simple substitution cipher.
    
    Substitution ciphers are a simple replacement algorithm.  In this example
    of a substitution cipher, we will explore a 'monoalphebetic' cipher.
    Monoalphebetic means, literally, "one alphabet" and you will see why.
    
    This level contains an old form of cipher called a 'Caesar Cipher'.
    A Caesar cipher shifts the alphabet by a set number.  For example:
    
    plain: a b c d e f g h i j k ...
    cipher: G H I J K L M N O P Q ...
    
    In this example, the letter 'a' in plaintext is replaced by a 'G' in the
    ciphertext so, for example, the plaintext 'bad' becomes 'HGJ' in ciphertext.
    
    The password for level 3 is in the file krypton3.  It is in 5 letter
    group ciphertext.  It is encrypted with a Caesar Cipher.  Without any 
    further information, this cipher text may be difficult to break.  You do 
    not have direct access to the key, however you do have access to a program 
    that will encrypt anything you wish to give it using the key.  
    If you think logically, this is completely easy.
    
    One shot can solve it!
    
    Have fun.
    
    
  10. [Comment] Show me the details
  11. krypton2@melinda:/krypton/krypton2$ ll
    total 15
    drwxr-xr-x 2 root     root     1024 Jun  6  2013 ./
    drwxr-xr-x 8 root     root     1024 Jun 12  2013 ../
    -rw-r----- 1 krypton2 krypton2 1060 Jun  6  2013 README
    -rwsr-x--- 1 krypton3 krypton2 8828 Jun  6  2013 encrypt*
    -rw-r----- 1 krypton3 krypton3   27 Jun  6  2013 keyfile.dat
    -rw-r----- 1 krypton2 krypton2   13 Jun  6  2013 krypton3
  12. krypton2@melinda:/krypton/krypton2$ cat keyfile.dat
    cat: keyfile.dat: Permission denied
  13. krypton2@melinda:/krypton/krypton2$ cat krypton3
    OMQEMDUEQMEK
  14. krypton2@melinda:/krypton/krypton2$ ./encrypt
     usage: encrypt foo  - where foo is the file containing the plaintext
  15. [Comment] Basically, we should be able to use the executable 'encrypt' to find out the key.
  16. [Comment] However, there are always error messages.
  17. krypton2@melinda:/krypton/krypton2$ ./encrypt /tmp/sp_krypton2/plaintext
    failed to create cipher file 
  18. [Comment] So, let's try to bruteforce the ciphertext.
    Reference: http://www.xarg.org/tools/caesar-cipher/
    OMQEMDUEQMEK > CAESARISEASY
  19. [Comment] It's done! Let's go to the next level!

No comments:

Post a Comment