Wargames与bash知识19

Wargames与bash知识19

Bandit28

关卡提示:

有一个git存储库位于ssh://bandit28-git@localhost/home/bandit28 git/repo通过端口2220。用户bandit28git的密码与用户bandit28的密码相同。克隆存储库并查找下一级别的密码。

bash 复制代码
bandit28@bandit:~$ ls -al
total 20
drwxr-xr-x  2 root root 4096 Oct  5 06:19 .
drwxr-xr-x 70 root root 4096 Oct  5 06:20 ..
-rw-r--r--  1 root root  220 Jan  6  2022 .bash_logout
-rw-r--r--  1 root root 3771 Jan  6  2022 .bashrc
-rw-r--r--  1 root root  807 Jan  6  2022 .profile

创建目录,克隆

bash 复制代码
bandit28@bandit:~$ mkdir /tmp/bdit29
bandit28@bandit:~$ cd /tmp/bdit29
bandit28@bandit:/tmp/bdit29$ git clone ssh://bandit28-git@localhost:2220/home/bandit28-git/rpepo
Cloning into 'rpepo'...
The authenticity of host '[localhost]:2220 ([127.0.0.1]:2220)' can't be established.
ED25519 key fingerprint is SHA256:C2ihUBV7ihnV1wUXRb4RrEcLfXC5CXlhmAAM/urerLY.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Could not create directory '/home/bandit28/.ssh' (Permission denied).
Failed to add the host to the list of known hosts (/home/bandit28/.ssh/known_hosts).
                         _                     _ _ _
                        | |__   __ _ _ __   __| (_) |_
                        | '_ \ / _` | '_ \ / _` | | __|
                        | |_) | (_| | | | | (_| | | |_
                        |_.__/ \__,_|_| |_|\__,_|_|\__|


                      This is an OverTheWire game server.
            More information on http://www.overthewire.org/wargames

bandit28-git@localhost's password:
fatal: '/home/bandit28-git/rpepo' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
bandit28@bandit:/tmp/bdit29$ git clone ssh://bandit28-git@localhost:2220/home/bandit28-git/repo
Cloning into 'repo'...
The authenticity of host '[localhost]:2220 ([127.0.0.1]:2220)' can't be established.
ED25519 key fingerprint is SHA256:C2ihUBV7ihnV1wUXRb4RrEcLfXC5CXlhmAAM/urerLY.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Could not create directory '/home/bandit28/.ssh' (Permission denied).
Failed to add the host to the list of known hosts (/home/bandit28/.ssh/known_hosts).
                         _                     _ _ _
                        | |__   __ _ _ __   __| (_) |_
                        | '_ \ / _` | '_ \ / _` | | __|
                        | |_) | (_| | | | | (_| | | |_
                        |_.__/ \__,_|_| |_|\__,_|_|\__|


                      This is an OverTheWire game server.
            More information on http://www.overthewire.org/wargames

bandit28-git@localhost's password:
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 9 (delta 2), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (9/9), done.
Resolving deltas: 100% (2/2), done.

查看README.d 未获取到密码

bash 复制代码
bandit28@bandit:/tmp/bdit29$ ls
repo
bandit28@bandit:/tmp/bdit29$ vf repo
vf: command not found
bandit28@bandit:/tmp/bdit29$ cd repo/
bandit28@bandit:/tmp/bdit29/repo$ ls
README.md
bandit28@bandit:/tmp/bdit29/repo$ cat README.md
# Bandit Notes
Some notes for level29 of bandit.

## credentials

- username: bandit29
- password: xxxxxxxxxx

bandit28@bandit:/tmp/bdit29/repo$ file README.md
README.md: ASCII text

git太不熟悉了,需要找本书看看。

bash 复制代码
bandit28@bandit:/tmp/bdit29/repo$ ls -al
total 16
drwxrwxr-x 3 bandit28 bandit28 4096 Jan 16 01:51 .
drwxrwxr-x 3 bandit28 bandit28 4096 Jan 16 01:46 ..
drwxrwxr-x 8 bandit28 bandit28 4096 Jan 16 01:46 .git
-rw-rw-r-- 1 bandit28 bandit28  111 Jan 16 01:46 README.md
bandit28@bandit:/tmp/bdit29/repo$ cd ./.git
bandit28@bandit:/tmp/bdit29/repo/.git$ ls
branches  config  description  HEAD  hooks  index  info  logs  objects  packed-refs  refs
bandit28@bandit:/tmp/bdit29/repo/.git$ ls -al
total 52
drwxrwxr-x 8 bandit28 bandit28 4096 Jan 16 01:46 .
drwxrwxr-x 3 bandit28 bandit28 4096 Jan 16 01:51 ..
drwxrwxr-x 2 bandit28 bandit28 4096 Jan 16 01:46 branches
-rw-rw-r-- 1 bandit28 bandit28  281 Jan 16 01:46 config
-rw-rw-r-- 1 bandit28 bandit28   73 Jan 16 01:46 description
-rw-rw-r-- 1 bandit28 bandit28   23 Jan 16 01:46 HEAD
drwxrwxr-x 2 bandit28 bandit28 4096 Jan 16 01:46 hooks
-rw-rw-r-- 1 bandit28 bandit28  137 Jan 16 01:46 index
drwxrwxr-x 2 bandit28 bandit28 4096 Jan 16 01:46 info
drwxrwxr-x 3 bandit28 bandit28 4096 Jan 16 01:46 logs
drwxrwxr-x 4 bandit28 bandit28 4096 Jan 16 01:46 objects
-rw-rw-r-- 1 bandit28 bandit28  114 Jan 16 01:46 packed-refs
drwxrwxr-x 5 bandit28 bandit28 4096 Jan 16 01:46 refs
bandit28@bandit:/tmp/bdit29/repo/.git$ cat index
▒QՕ▒n▒▒▒README.mdTREE1 0W▒}▒;_G▒#S▒
▒u([4▒▒▒4▒s▒z▒▒E▒F▒▒"Ԥ:D▒xL▒▒k\Tbandit28@bandit:/tmp/bdit29/repo/.git$
bandit28@bandit:/tmp/bdit29/repo/.git$ git show-branch
[master] fix info leak
bandit28@bandit:/tmp/bdit29/repo/.git$ git branch -vvv
* master 14f754b [origin/master] fix info leak
bandit28@bandit:/tmp/bdit29/repo/.git$ http://index
-bash: http://index: No such file or directory
bandit28@bandit:/tmp/bdit29/repo/.git$ file://index
-bash: file://index: No such file or directory
bandit28@bandit:/tmp/bdit29/repo/.git$ file://./index
-bash: file://./index: No such file or directory
bandit28@bandit:/tmp/bdit29/repo/.git$ git log
commit 14f754b3ba6531a2b89df6ccae6446e8969a41f3 (HEAD -> master, origin/master, origin/HEAD)
Author: Morla Porla <morla@overthewire.org>
Date:   Thu Oct 5 06:19:41 2023 +0000

    fix info leak

commit f08b9cc63fa1a4602fb065257633c2dae6e5651b
Author: Morla Porla <morla@overthewire.org>
Date:   Thu Oct 5 06:19:41 2023 +0000

    add missing data

commit a645bcc508c63f081234911d2f631f87cf469258
Author: Ben Dover <noone@overthewire.org>
Date:   Thu Oct 5 06:19:41 2023 +0000

    initial commit of README.md
bandit28@bandit:/tmp/bdit29/repo/.git$ diff --git a/README.md b/READMEmd
diff: unrecognized option '--git'
diff: Try 'diff --help' for more information.
bandit28@bandit:/tmp/bdit29/repo/.git$ git show
commit 14f754b3ba6531a2b89df6ccae6446e8969a41f3 (HEAD -> master, origin/master, origin/HEAD)
Author: Morla Porla <morla@overthewire.org>
Date:   Thu Oct 5 06:19:41 2023 +0000

    fix info leak

diff --git a/README.md b/README.md
index b302105..5c6457b 100644
--- a/README.md
+++ b/README.md
@@ -4,5 +4,5 @@ Some notes for level29 of bandit.
 ## credentials

 - username: bandit29
-- password: tQKvmcwNYcFS6vmPHIUSI3ShmsrQZK8S
+- password: xxxxxxxxxx

bandit28@bandit:/tmp/bdit29/repo/.git$
相关推荐
爬虫程序猿1 小时前
用 Python 给京东商品详情做“全身 CT”——可量产、可扩展的爬虫实战
开发语言·爬虫·python
徐同保3 小时前
tailwindcss暗色主题切换
开发语言·前端·javascript
蓝纹绿茶3 小时前
bash:**:pip:***python: 错误的解释器: 没有那个文件或目录
开发语言·python·pip
云知谷3 小时前
【经典书籍】C++ Primer 第15章类虚函数与多态 “友元、异常和其他高级特性” 精华讲解
c语言·开发语言·c++·软件工程·团队开发
START_GAME4 小时前
深度学习Diffusers:用 DiffusionPipeline 实现图像生成
开发语言·python·深度学习
不爱编程的小九九4 小时前
小九源码-springboot088-宾馆客房管理系统
java·开发语言·spring boot
Evand J5 小时前
【MATLAB例程】到达角度定位(AOA),平面环境多锚点定位(自适应基站数量),动态轨迹使用EKF滤波优化。附代码下载链接
开发语言·matlab·平面·滤波·aoa·到达角度
细节控菜鸡5 小时前
【2025最新】ArcGIS for JS 实现随着时间变化而变化的热力图
开发语言·javascript·arcgis
Pluto_CSND5 小时前
Java实现gRPC双向流通信
java·开发语言·单元测试
Elastic 中国社区官方博客5 小时前
介绍 Elastic 的 Agent Builder - 9.2
大数据·运维·人工智能·elasticsearch·搜索引擎·ai·全文检索