Skip to content

Commit

Permalink
first challenges
Browse files Browse the repository at this point in the history
  • Loading branch information
kaliban2056 committed Aug 4, 2024
1 parent c6ba4a9 commit f2175d7
Show file tree
Hide file tree
Showing 32 changed files with 498 additions and 195 deletions.
39 changes: 39 additions & 0 deletions content/posts/overthewire-bandit-0-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
+++
title = 'Over The Wire - Bandit 0 -> 1'
date = 2024-08-04T19:51:15+02:00
draft = false
tags = ["cyber security", "bandit", "over the wire"]
+++

# Task

Find the file `readme` stored in the filesystem.

SSH: `bandit0@bandit.labs.overthewire.org -p 2220`

Password: `bandit0`

# Theory

After loggin in the remote host you can use a set of commands to understand where are you and what files are in your directory:
- `pwd` this command show the name of the working directory, the directory you're in right now.
- `ls` list the files in the current folder, you can add the attribute `-a` to show hidden files, using `-l` instead will show additional information on the files.
- `cat` read the content of a file and print them to standard output.

# Solution

1. We log in with SSH using the information above.

2. Make sure the `readme` file is in the directory.
```bash
bandit0@bandit:~$ ls
readme
```

3. We can read the content of the file.
```
bandit0@bandit:~$ cat readme
ZjLjTmM6FvvyRnrb2rfNWOZOTa6ip5If
```

Now we can move on to the next challenge.
74 changes: 35 additions & 39 deletions content/posts/overthewire-bandit-0.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,56 @@
+++
title = 'Over The Wire - Bandit 0'
date = 2024-08-04T15:45:39+02:00
title = 'Overthewire Bandit 0'
date = 2024-08-04T19:47:52+02:00
draft = false
tags = ["cyber security", "bandit", "over the wire"]
+++

# Introduction

[OverTheWire](https://overthewire.org/wargames/) is an online platform that provides a series of interactive war games designed to teach and challenge users in various aspects of cybersecurity, programming, and systems administration. These war games cover a diverse range of topics, from basic Linux command line usage to complex cryptography and network exploitation techniques.
OverTheWire is a free online platform to learn and practice security concepts in the form of fun-filled games”. It has different, so-called “Wargames”, that deal each deal with an area of security.

# Bandit 0
The first game that is recommended is called Bandit. It is recommended first because it teaches “the basics needed to be able to play other wargames”. This includes mainly basic Linux and Git commands.

## Level Goal
I worked through the levels and decided to write a walkthrough for my blog. There are already walkthroughs on the internet, from different persons and with different solutions. However, I still decided to publish mine, to at the very least get more comfortable with writing and maybe, since my explanations and thought processes may vary from other writers, help someone understand the solutions better. Also, this way future me has a reference to look back at.

The goal of this level is for you to log into the game using SSH. The host to which you need to connect is `bandit.labs.overthewire.org`, on port `2220`. The username is `bandit0` and the password is `bandit0`.
I will try to explain the important concepts shortly, however, there is always a lot more we can learn about them. What the game and I would encourage you to do, is research on your own.

Great, now that you know what this article is about and why I am doing this, let’s start with the walkthrough of Level 0.

# Bandit Level 0

## Task

Log into the level with SSH.

Server: `bandit.labs.overthewire.org`

Port: `2220`

Username: `bandit0`

Password: `bandit0`

## Theory

1. Introduction to SSH:
- Definition: SSH or Secure Shell, is a cryptographic network protocol used for secure data communication, remote command-line login, and other secure network services between two networked computers.
- Purpose: It ensures that the data sent over the network is encrypted, providing confidentiality and integrity of data and secure authentication.
2. Understanding SSH Authentication:
- Authentication mechanisms: SSH supports various authentication methods, including password-based authentication, public key authentication and host based authentication. For this level, the focus is on password-based authentication.
- Process: WHen using password-based authentication, the client provides a username and password, which the server verifies. If the credentials are correct, access is granted.
3. Connecting to a Remote Host Using SSH:
- Basic Command Structure: The basic syntax for connection to a remote host via SSH is:
```bash
ssh [username]@[hostname] -p [port]
```
- Parameters:
- `username`: The username you are logging in with.
- `hostname`: The remote host’s address (in this case, bandit.labs.overthewire.org).
- `port`: The port number to connect to (in this case, 2220).
4. Common Pitfalls and Troubleshooting:
- Incorrect Credentials: Ensure that you are using the correct username and password. Typos can lead to authentication failures.
- Firewall and Network Issues: Ensure that your network allows outbound connections on port `2220`. If you are behind a restrictive firewall, you might need to adjust your network settings.
This challenge wants us to user SSH, which stands for Secure Shell, is a cryptographic network protocol used to securely access and manage network devices and servers over an insecure network. It provides a secure channel over an unsecured network by using encryption to protect the communication between the client and the server.

## Solution
Key features of SSH include:
- Secure Remote Login: Allows users to securely log into a remote machine.
- Command Execution: Enables users to run commands on a remote server.
- File Transfer: Facilitates secure file transfers through protocols like SCP (Secure Copy Protocol) and SFTP (SSH File Transfer Protocol).
- Port Forwarding: Supports tunneling of network services over a secure connection.

To solve this level simply SSH into the remote host with the credentials given in the level goal and find the password for the next level.
SSH helps ensure that data transmitted between the client and server remains confidential and protected from eavesdropping and tampering.

```
~$ ssh bandit0@bandit.labs.overthewire.org -p 2220
It is a very common service. So common in fact that it was assigned its own standard port, Port 22. A port is an endpoint that allows your computer to know which service should be accessed - kind of like office room numbers, so you know in which room the person you need to talk to is.

~$ ls
readme
## Solution

~$ cat readme
Congratulations on your first steps into the bandit game!!
Please make sure you have read the rules at https://overthewire.org/rules/
If you are following a course, workshop, walthrough or other educational activity,
please inform the instructor about the rules as well and encourage them to
contribute to the OverTheWire community so we can keep these games free!
To solve this challenge first we SSH into the remote machine with the credentials in the Level Goal.

The password you are looking for is: ZjLjTmM6FvvyRnrb2rfNWOZOTa6ip5If
```
~$ ssh bandit0@bandit.labs.overthewire.org -p 2220
```

Password: ZjLjTmM6FvvyRnrb2rfNWOZOTa6ip5If
After typing the password we're in and this is the end of the level 0.
38 changes: 38 additions & 0 deletions content/posts/overthewire-bandit-1-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
+++
title = 'Overthewire Bandit 1 2'
date = 2024-08-04T20:08:05+02:00
draft = false
tags = ["cyber security", "bandit", "over the wire"]
+++

# Task

Read the content of the file called "-"

SSH: `bandit1@bandit.labs.overthewire.org -p 2220`

Password: `ZjLjTmM6FvvyRnrb2rfNWOZOTa6ip5If`

# Theory

To read a file with an "unconventional name" such as - we need to use the path of the file `./`.

# Solution

1. We log in to the remote host with the right credentials

```
~$: ssh bandit1@bandit.labs.overthewire.org -p 2220
```

2. Search for the file and read it.

```
bandit1@bandit~$: ls
-
bandit1@bandit~$: cat ./-
263JGJPfgU6LtdEvgfWU1XP5yac29mFx
```

We can now proceed to the next challenge.
4 changes: 2 additions & 2 deletions public/404.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html><html lang=en dir=auto><head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=robots content="index, follow"><title>404 Page not found | Kaliban's Blog</title>
<meta name=keywords content><meta name=description content="Cyber Security | Development | Self Hosting"><meta name=author content="Kaliban"><link rel=canonical href=http://localhost:1313/404.html><meta name=google-site-verification content="XYZabc"><meta name=yandex-verification content="XYZabc"><meta name=msvalidate.01 content="XYZabc"><link crossorigin=anonymous href=/assets/css/stylesheet.54405a410796490bc874ab6181fac9b675753cc2b91375d8f882566459eca428.css integrity="sha256-VEBaQQeWSQvIdKthgfrJtnV1PMK5E3XY+IJWZFnspCg=" rel="preload stylesheet" as=style><link rel=icon href=http://localhost:1313/images/favicon.svg><link rel=icon type=image/png sizes=16x16 href=http://localhost:1313/images/favicon-16x16.svg><link rel=icon type=image/png sizes=32x32 href=http://localhost:1313/images/favicon-32x32.svg><link rel=apple-touch-icon href=http://localhost:1313/apple-touch-icon.png><link rel=mask-icon href=http://localhost:1313/safari-pinned-tab.svg><meta name=theme-color content="#2e2e33"><meta name=msapplication-TileColor content="#2e2e33"><link rel=alternate hreflang=en href=http://localhost:1313/404.html><noscript><style>#theme-toggle,.top-link{display:none}</style><style>@media(prefers-color-scheme:dark){:root{--theme:rgb(29, 30, 32);--entry:rgb(46, 46, 51);--primary:rgb(218, 218, 219);--secondary:rgb(155, 156, 157);--tertiary:rgb(65, 66, 68);--content:rgb(196, 196, 197);--code-block-bg:rgb(46, 46, 51);--code-bg:rgb(55, 56, 62);--border:rgb(51, 51, 51)}.list{background:var(--theme)}.list:not(.dark)::-webkit-scrollbar-track{background:0 0}.list:not(.dark)::-webkit-scrollbar-thumb{border-color:var(--theme)}}</style></noscript><meta property="og:title" content="404 Page not found"><meta property="og:description" content="Cyber Security | Development | Self Hosting"><meta property="og:type" content="website"><meta property="og:url" content="http://localhost:1313/404.html"><meta property="og:image" content="http://localhost:1313/link%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta property="og:site_name" content="Kaliban's Blog"><meta name=twitter:card content="summary_large_image"><meta name=twitter:image content="http://localhost:1313/link%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta name=twitter:title content="404 Page not found"><meta name=twitter:description content="Cyber Security | Development | Self Hosting"></head><body class=list id=top><script>localStorage.getItem("pref-theme")==="dark"?document.body.classList.add("dark"):localStorage.getItem("pref-theme")==="light"?document.body.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches&&document.body.classList.add("dark")</script><header class=header><nav class=nav><div class=logo><a href=http://localhost:1313/ accesskey=h title="Kaliban's Blog (Alt + H)"><img src=http://localhost:1313/apple-touch-icon.png alt aria-label=logo height=35>Kaliban's Blog</a><div class=logo-switches><button id=theme-toggle accesskey=t title="(Alt + T)"><svg id="moon" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg><svg id="sun" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg></button></div></div><ul id=menu><li><a href=http://localhost:1313/categories/ title=categories><span>categories</span></a></li><li><a href=http://localhost:1313/tags/ title=tags><span>tags</span></a></li><li><a href=http://localhost:1313/projects/ title=projects><span>projects</span></a></li><li><a href=http://localhost:1313/about/ title=about><span>about</span></a></li></ul></nav></header><main class=main><div class=not-found>404</div></main><footer class=footer><span>&copy; 2024 <a href=http://localhost:1313/>Kaliban's Blog</a></span> ·
<!doctype html><html lang=en dir=auto><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name=robots content="index, follow"><title>404 Page not found | Kaliban's Blog</title>
<meta name=keywords content><meta name=description content="Cyber Security | Development | Self Hosting"><meta name=author content="Kaliban"><link rel=canonical href=https://kaliban2056.github.io/404.html><meta name=google-site-verification content="XYZabc"><meta name=yandex-verification content="XYZabc"><meta name=msvalidate.01 content="XYZabc"><link crossorigin=anonymous href=/assets/css/stylesheet.54405a410796490bc874ab6181fac9b675753cc2b91375d8f882566459eca428.css integrity="sha256-VEBaQQeWSQvIdKthgfrJtnV1PMK5E3XY+IJWZFnspCg=" rel="preload stylesheet" as=style><link rel=icon href=https://kaliban2056.github.io/images/favicon.svg><link rel=icon type=image/png sizes=16x16 href=https://kaliban2056.github.io/images/favicon-16x16.svg><link rel=icon type=image/png sizes=32x32 href=https://kaliban2056.github.io/images/favicon-32x32.svg><link rel=apple-touch-icon href=https://kaliban2056.github.io/apple-touch-icon.png><link rel=mask-icon href=https://kaliban2056.github.io/safari-pinned-tab.svg><meta name=theme-color content="#2e2e33"><meta name=msapplication-TileColor content="#2e2e33"><link rel=alternate hreflang=en href=https://kaliban2056.github.io/404.html><noscript><style>#theme-toggle,.top-link{display:none}</style><style>@media(prefers-color-scheme:dark){:root{--theme:rgb(29, 30, 32);--entry:rgb(46, 46, 51);--primary:rgb(218, 218, 219);--secondary:rgb(155, 156, 157);--tertiary:rgb(65, 66, 68);--content:rgb(196, 196, 197);--code-block-bg:rgb(46, 46, 51);--code-bg:rgb(55, 56, 62);--border:rgb(51, 51, 51)}.list{background:var(--theme)}.list:not(.dark)::-webkit-scrollbar-track{background:0 0}.list:not(.dark)::-webkit-scrollbar-thumb{border-color:var(--theme)}}</style></noscript><meta property="og:title" content="404 Page not found"><meta property="og:description" content="Cyber Security | Development | Self Hosting"><meta property="og:type" content="website"><meta property="og:url" content="https://kaliban2056.github.io/404.html"><meta property="og:image" content="https://kaliban2056.github.io/link%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta property="og:site_name" content="Kaliban's Blog"><meta name=twitter:card content="summary_large_image"><meta name=twitter:image content="https://kaliban2056.github.io/link%20or%20path%20of%20image%20for%20opengraph,%20twitter-cards%3E"><meta name=twitter:title content="404 Page not found"><meta name=twitter:description content="Cyber Security | Development | Self Hosting"></head><body class=list id=top><script>localStorage.getItem("pref-theme")==="dark"?document.body.classList.add("dark"):localStorage.getItem("pref-theme")==="light"?document.body.classList.remove("dark"):window.matchMedia("(prefers-color-scheme: dark)").matches&&document.body.classList.add("dark")</script><header class=header><nav class=nav><div class=logo><a href=https://kaliban2056.github.io/ accesskey=h title="Kaliban's Blog (Alt + H)"><img src=https://kaliban2056.github.io/apple-touch-icon.png alt aria-label=logo height=35>Kaliban's Blog</a><div class=logo-switches><button id=theme-toggle accesskey=t title="(Alt + T)"><svg id="moon" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg><svg id="sun" width="24" height="18" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg></button></div></div><ul id=menu><li><a href=https://kaliban2056.github.io/categories/ title=categories><span>categories</span></a></li><li><a href=https://kaliban2056.github.io/tags/ title=tags><span>tags</span></a></li><li><a href=https://kaliban2056.github.io/projects/ title=projects><span>projects</span></a></li><li><a href=https://kaliban2056.github.io/about/ title=about><span>about</span></a></li></ul></nav></header><main class=main><div class=not-found>404</div></main><footer class=footer><span>&copy; 2024 <a href=https://kaliban2056.github.io/>Kaliban's Blog</a></span> ·
<span>Powered by
<a href=https://gohugo.io/ rel="noopener noreferrer" target=_blank>Hugo</a> &
<a href=https://github.com/adityatelange/hugo-PaperMod/ rel=noopener target=_blank>PaperMod</a></span></footer><a href=#top aria-label="go to top" title="Go to Top (Alt + G)" class=top-link id=top-link accesskey=g><svg viewBox="0 0 12 6" fill="currentcolor"><path d="M12 6H0l6-6z"/></svg>
Expand Down
4 changes: 2 additions & 2 deletions public/about/index.html

Large diffs are not rendered by default.

Loading

0 comments on commit f2175d7

Please sign in to comment.