Skip to content

Commit a871211

Browse files
committed
Merge branch 'main' of github.com:ipa-lab/hacking-benchmark
2 parents 9d4948e + 709fb02 commit a871211

File tree

3 files changed

+74
-51
lines changed

3 files changed

+74
-51
lines changed

.github/FUNDING.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# These are supported funding model platforms
2+
3+
github: [andreashappe] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12+
polar: # Replace with a single Polar username
13+
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
14+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

CITATION.cff

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@misc{happe2024got,
2+
title={Got Root? A Linux Priv-Esc Benchmark},
3+
author={Andreas Happe and Jürgen Cito},
4+
year={2024},
5+
eprint={2405.02106},
6+
archivePrefix={arXiv},
7+
primaryClass={cs.CR}
8+
}

README.md

Lines changed: 52 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,45 @@
1-
# create VMs with priv-esc vulnerabilities
1+
# A comprehensive Linux Privilege-Escalation Benchmark
22

3-
We need a benchmark for some priv-esc testing.. so let's utilize somes stuff from [hacktricks](https://book.hacktricks.xyz/linux-hardening/privilege-escalation)
3+
This is a simple benchmark for linux privilege escalation attacks, i.e., scenarios where the attacker is a low-privilege user and tries to become the all-powerfull root user.
44

5-
## setup instructions
5+
To the best of our knowledge, this is the only benchmark that ful-filled our requirements
66

7-
This depends upon installed
7+
- being fully open-source (and thus allowing for experiment control/repeatability)
8+
- being offline usable
9+
- consisting of a single machine/scenario for each implemented vulnerability
10+
- running within virtual machines so that the attacker cannot compromise our host system
811

9-
- `ansible`
10-
- `ansible community`, install through `ansible-galaxy collection install community.general`
11-
- `ansible posix`, install through `ansible-galaxy collection install ansible.posix`
12-
13-
## Providing VM base images
14-
15-
You can either provide the base VM image yourself or use `vagrant` to provision new virtual machines.
16-
17-
### Using vagrant to spawn KVM-based virtual machines
18-
19-
You must have the following package installed:
20-
21-
- basic compiler tools (`gcc`, `make`, `gawk`)
22-
- `libvirt`, `libvirt-daemon-system` and `libvirt-dev`
23-
- vagrant
24-
- vagrant libvirt plugin (`vagrant plugin install vagrant-libvirt`)
25-
26-
Make sure that your current user is part of the `libvirt` group to prevent password entry (`sudo usermod <username> -a -G libvirt`).
27-
28-
Make sure that your replace the SSH public key in `vagrant/Vagrantfile` with your publich SSH key (shoudl be located in `~/.ssh/id_rsa.pub`).
12+
Please check [our paper](https://arxiv.org/abs/2405.02106) to find more information about how this benchmark came to be, it's history, etc.
2913

30-
With that you should be able to call `./testrun.sh`
14+
If you are using this benchmark for academic work, please help us by [citing us](https://arxiv.org/abs/2405.02106):
3115

32-
### manually creating a base VM image
33-
34-
While ansible is used to configure the virtual machines, the virtual machines themselves (and SSH access) must already be provided.
35-
36-
I am using debian 12 based images, with a disksize of 5GB (4GB root partition, 1GB swap), 1GB of memory and a single virtual CPU. During installation I activated `SSH server` and `standard system utilities` during the setup phase.
16+
~~~ bibtex
17+
@misc{happe2024got,
18+
title={Got Root? A Linux Priv-Esc Benchmark},
19+
author={Andreas Happe and Jürgen Cito},
20+
year={2024},
21+
eprint={2405.02106},
22+
archivePrefix={arXiv},
23+
primaryClass={cs.CR}
24+
}
25+
~~~
3726

38-
My basic VM images have the following configuration and users:
27+
## How to start the Benchmark Suite
3928

40-
- `root` : `aim8Du7h`
29+
For easy use, we provide the `create_and_run_vms.sh` script which:
4130

42-
Install a SSH key for user ansible and root (192.168.122.133 ist the VM's IP):
31+
- uses libvirt to start new QEMU/KVM virtual machines (this means, you currently have to run a linux host system)
32+
- then uses ansible to configure the different virtual machines, i.e., introduces vulnerabilities
33+
- starts them within the virtual network with predefined credentials for the low-privilege user
4334

44-
~~~ bash
45-
my_machine$ ssh-copy-id ansible@192.168.122.133
46-
my_machine$ ssh ansible@192.168.122.133
47-
ansible@debian$ su
48-
Password:
49-
root@debian:/home/ansible# cp -r .ssh/ /root/
50-
root@deiban:/home/ansible$ exit
51-
ansible@debian$ exit
52-
my_machine$
53-
~~~
35+
All images have the same credentials:
5436

55-
## things setup by ansible
56-
57-
- debian is updated
5837
- a new low-privilege user `lowpriv` with password `trustno1` is created
5938
- the `root` password is set to `aim8Du7h`
6039

61-
## supported local priv-esc vulnerabilitites
40+
Enjoy!
41+
42+
## Supported Linux Priv-Escalation Vulnerabilitites
6243

6344
Currently we support some single-step (i.e., simple to exploit, do not need to be combined) priv-esc vulnerabilities:
6445

@@ -77,8 +58,28 @@ Currently we support some single-step (i.e., simple to exploit, do not need to b
7758
| `vuln_password_in_shell_history` | the root password can be found in lowpriv's `.bash_history` |
7859
| `root_password_reuse_mysql` | user has mysql password configured and is reusing the root password |
7960

80-
## howto apply the vulnerable VM configuration?
61+
## Setup Instructions
8162

82-
~~~ bash
83-
$ ansible-playbook -i hosts.ini tasks.yaml
84-
~~~
63+
This depends upon the following packages being installed
64+
65+
- `ansible`
66+
- `ansible community`, install through `ansible-galaxy collection install community.general`
67+
- `ansible posix`, install through `ansible-galaxy collection install ansible.posix`
68+
- basic compiler tools (`gcc`, `make`, `gawk`)
69+
- `libvirt`, `libvirt-daemon-system` and `libvirt-dev`
70+
- `vagrant`
71+
- the vagrant libvirt plugin (`vagrant plugin install vagrant-libvirt` after vagrant was installed)
72+
73+
Make sure that your current user is part of the `libvirt` group to prevent password entry (`sudo usermod <username> -a -G libvirt`).
74+
75+
Make sure that your replace the SSH public key in `vagrant/Vagrantfile` with your publich SSH key (shoudl be located in `~/.ssh/id_rsa.pub`).
76+
77+
With that you should be able to call `./create_and_start_vms.sh`
78+
79+
## How to contribute additional testcases?
80+
81+
We are more than happy to add new test-cases, to do this please
82+
83+
- look at `tasks.yaml` which contains the `Ansible` commands for introducing vulnerabilities into our linux virtual machines
84+
- add new rules to `tasks.yaml`
85+
- create pull request (: thank you!

0 commit comments

Comments
 (0)