From cb0aff1b1f2b9efa3d5da8f635485f2a44b05bf8 Mon Sep 17 00:00:00 2001 From: kaliban Date: Wed, 7 Aug 2024 16:50:03 +0200 Subject: [PATCH] seventh level --- content/posts/overthewire-bandit-6-7.md | 52 ++++++++++++++++++ public/404.html | 4 +- public/about/index.html | 4 +- public/archives/index.html | 6 +-- public/categories/index.html | 4 +- public/categories/index.xml | 8 +-- public/index.html | 14 ++--- public/index.xml | 54 +++++++++---------- public/layouts/index.html | 6 +-- public/layouts/index.xml | 8 +-- public/layouts/page/1/index.html | 4 +- public/page/1/index.html | 4 +- public/page/2/index.html | 12 ++--- public/posts/index.html | 14 ++--- public/posts/index.xml | 46 ++++++++-------- .../posts/overthewire-bandit-0-1/index.html | 12 ++--- public/posts/overthewire-bandit-0/index.html | 12 ++--- .../posts/overthewire-bandit-1-2/index.html | 12 ++--- .../posts/overthewire-bandit-2-3/index.html | 12 ++--- .../posts/overthewire-bandit-3-4/index.html | 12 ++--- .../posts/overthewire-bandit-4-5/index.html | 12 ++--- .../posts/overthewire-bandit-5-6/index.html | 12 ++--- .../posts/overthewire-bandit-6-7/index.html | 41 ++++++++++++-- public/posts/page/1/index.html | 4 +- public/posts/page/2/index.html | 12 ++--- public/posts/welcome/index.html | 8 +-- public/projects/index.html | 8 +-- public/robots.txt | 2 +- public/sitemap.xml | 40 +++++++------- public/tags/bandit/index.html | 14 ++--- public/tags/bandit/index.xml | 42 +++++++-------- public/tags/bandit/page/1/index.html | 4 +- public/tags/bandit/page/2/index.html | 10 ++-- public/tags/cyber-security/index.html | 14 ++--- public/tags/cyber-security/index.xml | 42 +++++++-------- public/tags/cyber-security/page/1/index.html | 4 +- public/tags/cyber-security/page/2/index.html | 10 ++-- public/tags/index.html | 4 +- public/tags/index.xml | 20 +++---- public/tags/over-the-wire/index.html | 14 ++--- public/tags/over-the-wire/index.xml | 42 +++++++-------- public/tags/over-the-wire/page/1/index.html | 4 +- public/tags/over-the-wire/page/2/index.html | 10 ++-- 43 files changed, 379 insertions(+), 294 deletions(-) diff --git a/content/posts/overthewire-bandit-6-7.md b/content/posts/overthewire-bandit-6-7.md index 67a3d0e..b029798 100644 --- a/content/posts/overthewire-bandit-6-7.md +++ b/content/posts/overthewire-bandit-6-7.md @@ -21,4 +21,56 @@ Password: `HWasnPhtq9AVKe0dmk45nxy20cvUa6EG` # Theory +The process to solve this task is pretty similar to the previous level, we just need the `find` command with some different attribute, `-user [username]` searches for files owned by a specific user and `-group [groupname]` searches for files owned by a specific group. +# Solution + +1. Log in to the remote machine with the credentials previously found. + +``` +~$: ssh bandit6@bandit.labs.overthewire.org -p 2220 +``` + +2. To find the right file we will user the find command with some attributes: + +``` +bandit6@bandit~$: find / -type f -user bandit7 -group bandit6 -size 33c +... +find: ‘/etc/stunnel’: Permission denied +find: ‘/etc/multipath’: Permission denied +find: ‘/etc/sudoers.d’: Permission denied +find: ‘/etc/credstore.encrypted’: Permission denied +find: ‘/etc/ssl/private’: Permission denied +find: ‘/etc/credstore’: Permission denied +find: ‘/etc/xinetd.d’: Permission denied +find: ‘/etc/polkit-1/rules.d’: Permission denied +find: ‘/root’: Permission denied +find: ‘/tmp’: Permission denied +find: ‘/lost+found’: Permission denied +find: ‘/dev/shm’: Permission denied +find: ‘/dev/mqueue’: Permission denied +find: ‘/var/spool/bandit24’: Permission denied +find: ‘/var/spool/rsyslog’: Permission denied +find: ‘/var/spool/cron/crontabs’: Permission denied +find: ‘/var/lib/udisks2’: Permission denied +/var/lib/dpkg/info/bandit7.password +find: ‘/var/lib/snapd/void’: Permission denied +find: ‘/var/lib/snapd/cookie’: Permission denied +find: ‘/var/lib/ubuntu-advantage/apt-esm/var/lib/apt/lists/partial’: Permission denied +find: ‘/var/lib/private’: Permission denied +find: ‘/var/lib/update-notifier/package-data-downloads/partial’: Permission denied +find: ‘/var/lib/amazon’: Permission denied +... +``` + +To avoid this kind of output we can add a piece of code at the end of the command to suppress error messages: + +``` +bandit6@bandit~$: find / -type f -user bandit7 -group bandit6 -size 33c 2>/dev/null +/var/lib/dpkg/info/bandit7.password + +bandit6@bandit~$: cat /var/lib/dpkg/info/bandit7.password +morbNTDkSW6jIlUc0ymOdMaLnOlFVAaj +``` + +3. Now we can move to the next level. diff --git a/public/404.html b/public/404.html index 5215f19..1c3eb76 100644 --- a/public/404.html +++ b/public/404.html @@ -1,5 +1,5 @@ -404 Page not found | Kaliban's Blog -
404