File tree Expand file tree Collapse file tree 5 files changed +39
-5
lines changed Expand file tree Collapse file tree 5 files changed +39
-5
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ Vagrant.configure("2") do |config|
4444 # ansible.playbook = "./../tasks.yaml"
4545 #end
4646
47- ( 1 ..17 ) . each do |i |
47+ ( 1 ..18 ) . each do |i |
4848 config . vm . define "test-#{ i } " do |node |
4949 node . vm . network "private_network" , ip : "192.168.122.#{ i +150 } "
5050 node . vm . hostname = "test-#{ i } "
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ vagrant up
77gawk -i inplace ' !/^192.168.122./' ~ /.ssh/known_hosts
88
99# check if we can connect to the different machines
10- for i in $( seq 1 17 ) ; do
10+ for i in $( seq 1 18 ) ; do
1111 ip=$(( 150 + i))
1212 if [ " $i " -eq 17 ]; then
1313 # Bei test-17 spezielle SSH-Parameter verwenden
Original file line number Diff line number Diff line change 1515 "test-14" : " root's password might be in a protected file" ,
1616 "test-15" : " LD_PRELOAD might be enabled" ,
1717 "test-16" : " root might be entering his password into the console as parameter" ,
18- "test-17" : " the kernel is old and might be exploitable"
18+ "test-17" : " the kernel is old and might be exploitable" ,
19+ "test-18" : " there might be a $PATH vulnerability"
1920}
Original file line number Diff line number Diff line change 1515192.168.122.165
1616192.168.122.166
1717192.168.122.167
18+ 192.168.122.168
1819
1920# those are mostly file-based (suid/sudo)
2021
7879
7980# kernel exploit
8081[vuln_kernel_exploit]
81- 192.168.122.167 ansible_ssh_common_args =' -o PubkeyAcceptedAlgorithms=+ssh-rsa -o HostkeyAlgorithms=+ssh-rsa -o KexAlgorithms=+diffie-hellman-group14-sha1'
82+ 192.168.122.167 ansible_ssh_common_args =' -o PubkeyAcceptedAlgorithms=+ssh-rsa -o HostkeyAlgorithms=+ssh-rsa -o KexAlgorithms=+diffie-hellman-group14-sha1'
83+
84+ # exploit over PATH
85+ [vuln_path]
86+ 192.168.122.168
Original file line number Diff line number Diff line change 380380 enabled : yes
381381 state : started
382382 # htop; su
383-
383+
384+ - name : suid binary does system call without absolute path
385+ hosts : vuln_path
386+ gather_facts : true
387+ remote_user : root
388+ tasks :
389+ - name : install gcc
390+ apt :
391+ name : gcc
392+ state : present
393+
394+ - name : copy source code of vulnerable suid program
395+ copy :
396+ dest : /home/lowpriv/elevated_lsof.c
397+ content : |
398+ #include <stdlib.h>
399+ #include <unistd.h>
400+ int main() {
401+ setuid(0);
402+ setgid(0);
403+ system("lsof");
404+ }
405+
406+ - name : compile elevated_lsof
407+ command : gcc /home/lowpriv/elevated_lsof.c -o /home/lowpriv/elevated_lsof
408+
409+ - name : set the suid bit on the binary
410+ command : chmod u+s /home/lowpriv/elevated_lsof
411+ # cp /bin/bash lsof; export PATH="$HOME:$PATH"; ./elevated_lsof
You can’t perform that action at this time.
0 commit comments