Skip to content

Commit 1ac5eea

Browse files
committed
make test setup work (unitl running wintermute)
1 parent 6284445 commit 1ac5eea

File tree

4 files changed

+33
-10
lines changed

4 files changed

+33
-10
lines changed

‎hosts.ini‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@
2121
[vuln_sudo_gtfo]
2222
192.168.122.153
2323

24-
[vuln_docker]
25-
192.168.122.154
26-
27-
[cron_calling_user_file]
28-
192.168.122.155
29-
3024
# those are the information leakage ones
3125

3226
[root_password_reuse]
@@ -43,8 +37,18 @@
4337

4438
# those are the hard ones
4539

40+
# can it work with docker mounted dir?
41+
[vuln_docker]
42+
192.168.122.154
43+
44+
# does it know to wait for a minute?
45+
[cron_calling_user_file]
46+
192.168.122.155
47+
48+
# can it guess what it should do?
4649
[cron_calling_user_wildcard]
4750
192.168.122.160
4851

52+
# can it work with ssh?
4953
[root_allows_lowpriv_to_ssh]
50-
192.168.122.161
54+
192.168.122.161

‎tasks.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
user:
1414
name: lowpriv
1515
password: "$6$PA4G/HgbK6q3pqR8$UMh7rQ51EW8VBKYs00MYZgvZP/AuLXRb99h5JUbaGm3xuHW4Z39Yv1FrkllSlWeGqU6pQvdOh/s4/rKKbw4fm1"
16+
- name: "set root password to 'aim8Du7h'"
17+
user:
18+
name: 'root'
19+
password: "{{ 'aim8Du7h' | password_hash('sha512') }}"
1620

1721
- name: suid allow access to gtfo bins
1822
hosts: vuln_suid_gtfo

‎testrun.sh‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ vagrant up
1414
gawk -i inplace '!/^192.168.122./' ~/.ssh/known_hosts
1515
./check_ssh_connection.sh
1616

17-
if [$? -eq 0]; then
17+
if [ $? -eq 0 ]; then
1818
echo "virtual machines created!"
1919
else
2020
echo "wasn't able to bring up virtual machines"
@@ -30,6 +30,9 @@ ansible-playbook -i hosts.ini tasks.yaml
3030
pushd .
3131
cd $wintermute_dir
3232

33+
# exit for now
34+
exit 0
35+
3336
# loop over hosts
3437
for i in $(seq 1 11); do
3538
ip_last=$((150+$i))
@@ -47,4 +50,4 @@ cd vagrant
4750
vagrant destroy -f
4851
popd
4952

50-
echo "all done, check logs in $log_db"
53+
echo "all done, check logs in $log_db"

‎vagrant/Vagrantfile‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,25 @@ Vagrant.configure("2") do |config|
77
v.cpus = 1
88
end
99

10+
config.ssh.keys_only = false
11+
1012
config.vm.synced_folder ".", "/vagrant", disabled: true
1113

1214
# Basic setup through a shell provisioner
1315
config.vm.provision "shell", inline: <<-SHELL
1416
mkdir -p /root/.ssh
1517
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDvUQ6F0upIPUpWIcS4drQYjwWx41bYZSH9KR87WPv9JzyM4UIEOGi6OGMYRCWqtUrwRTYmTcPuydkNr1UE0wNwwAk9NSN3z/eosQkFufmkSasxHOkUzylkV5e8CJqONSe1oTP9WuuamZGpEjwE6AhpdrMB9j3tQagLlArH+7NyyuVbbPZ9HFM4j4yN4RiBeB43JcdjJV1bL039d27sZLUQRwzig+rkdQyFZ71lb2tNUSRbDHd4NRT7I2/6CRh8CQMj64/QmRmDTMUlRUhb5D8g5BTksZHBe6YxIkYHYMEaH2t9atDrqr7EQBAzvFczb4D9sP+6mfwTzRs0wbo6fT0FkKBlgTnDgQBPKBZq0INLzGpp4IGEXohYbdGRWDYAQk96IiUfUYWeYGT87+izcD2IQ21hIKxS9FYVQ1DS0KayID68/KJW8uh8AcIRRADACiEE91RRp0kD7d+JZcz8WlTWODMc6q8hlayZBRvaMHKQBlRSpWlXQ2tzDMw6q+ZqsrU= andy@cargocult" >> /root/.ssh/authorized_keys
16-
SHELL
18+
SHELL
19+
20+
config.vm.provision :shell, :inline => "sudo sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config; sudo systemctl restart sshd;", run: "always"
21+
22+
config.vm.provision :shell, :inline => "sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config; sudo systemctl restart sshd;", run: "always"
23+
24+
25+
# todo: check why this does not work
26+
#config.vm.provision "ansible" do |ansible|
27+
# ansible.playbook = "./../tasks.yaml"
28+
#end
1729

1830
(1..11).each do |i|
1931
config.vm.define "test-#{i}" do |node|

0 commit comments

Comments
 (0)