Bandit 11

Bandit 11





The transformation can be done using a lookup table, such as the following:

Input  ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
Output  NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm

But we do not actually need to know this, head to that wiki link. It will give you the answer in an example

The ROT13 and ROT47 are fairly easy to implement using the Unix terminal application tr; to encrypt the string "The Quick Brown Fox Jumps Over The Lazy Dog" in ROT13:

$ # Map upper case A-Z to N-ZA-M and lower case a-z to n-za-m
$ echo "The Quick Brown Fox Jumps Over The Lazy Dog" | tr 'A-Za-z' 'N-ZA-Mn-za-m'
Gur Dhvpx Oebja Sbk Whzcf Bire Gur Ynml Qb


So this has an echo command, I don't know why, and even though knowing everything can help, doesn't mean we need to. I tried

tr 'A-Za-z' 'N-ZA-Mn-za-m' data.txt

This didn't work, "tr" seems to rotate the characters in context of the example, and used the echo command (which will display the result of something back to us, like a reflection ... or echo).  "echo" writes it's arguments to stdio, so I assumed that I would have to adapt that command to our purposes. I need to output the results of data.txt and use the "tr" command on that output. Sound complicated? It's easier in practice, look

bandit11@bandit:~$ ls
data.txt
bandit11@bandit:~$ cat data.txt
Gur cnffjbeq vf 5Gr8L4qetPEsPk8htqjhRK8XSP6x2RHh]
bandit11@bandit:~$ cat data.txt | tr 'A-Za-z' 'N-ZA-Mn-za-m'
The password is 5Te8Y4drgCRfCx8ugdwuEX8KFC6k2EUu
bandit11@bandit:~$  

You don't get extra credit in real life for homework, but I wanted to know why my guess was correct and checked the man page for "tr"
Translate, squeeze, and/or delete characters from standard input, writing to standard output.
So I was kind of wrong in how I thought of it. We cat data.txt to view it's output. We cat data.txt and use a pipe to input those results into tr 'A-Za-z' 'N-ZA-Mn-za-m' Glowfish Contrast

Comments

Popular posts from this blog

Thoughts on ISSA talk on using AI to automate security

Bandit 12

Bandit level 14