Level 11
Level Goal
The password for the next level is stored in the file data.txt, where all lowercase (a-z) and uppercase (A-Z) letters have been rotated by 13 positions
Solution
說是rot13加密了,其實也就是單表替換唄,但是在linux shell裏面怎麼做我確實不知道,本來想一個一個字符讀出來然後變換,沒有成功,最後找了個rot13的函數:
tr只能通過stdin(標準輸入)接收輸入(無法通過命令行參數接收)。其調用格式如下:
tr [options] set1 set2
來自stdin的輸入字符按照位置從set1映射到set2(set1中的第一個字符映射到set2 中的第一個字符,以此類推),然後將輸出寫入stdout(標準輸出)。set1和set2是字符類或字符組。如果兩個字符組的長度不相等,那麼set2 不斷複製其最後一個字符,直到長度與set1 相同。如果set2的長度大於set1,那麼在set2中超出set1長度的那部分字符則全部被忽略
bandit11@bandit:~$ cat data.txt | tr 'a-zA-Z' 'n-za-mN-ZA-M'
The password is JVNBBFSmZwKKOP0XbFXOoW8chDz5yVRv