Linux提权后获取敏感信息的方法与途径(3)
如果命令限制,你可以打出哪些突破它的限制?
python -c 'import pty;pty.spawn("/bin/bash")'
echo os.system('/bin/bash')
/bin/sh -i
如何安装文件系统?
mount df -h
是否有挂载的文件系统?
cat /etc/fstab
什么是高级Linux文件权限使用?Sticky bits, SUID 和GUID
find / -perm -1000 -type d 2>/dev/null # Sticky bit - Only the owner of the directory or the owner of a file can delete or rename here find / -perm -g=s -type f 2>/dev/null # SGID (chmod 2000) - run as the group, not the user who started it. find / -perm -u=s -type f 2>/dev/null # SUID (chmod 4000) - run as the owner, not the user who started it. find / -perm -g=s -o -perm -u=s -type f 2>/dev/null # SGID or SUID for i in `locate -r "bin$"`; do find $i ( -perm -4000 -o -perm -2000 ) -type f 2>/dev/null; done # Looks in 'common' places: /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, /usr/local/sbin and any other *bin, for SGID or SUID (Quicker search) # findstarting at root (/), SGIDorSUID, not Symbolic links, only 3 folders deep, list with more detail and hideany errors (e.g. permission denied) find/-perm -g=s-o-perm -4000! -type l-maxdepth 3 -exec ls -ld {} ;2>/dev/null
在哪些目录可以写入和执行呢?几个“共同”的目录:/ tmp目录,/var / tmp目录/ dev /shm目录
find / -writable -type d 2>/dev/null # world-writeable folders find / -perm -222 -type d 2>/dev/null # world-writeable folders find / -perm -o+w -type d 2>/dev/null # world-writeable folders find / -perm -o+x -type d 2>/dev/null # world-executable folders find / ( -perm -o+w -perm -o+x ) -type d 2>/dev/null # world-writeable & executable folders Any "problem" files?可写的的,“没有使用"的文件 find / -xdev -type d ( -perm -0002 -a ! -perm -1000 ) -print # world-writeable files find /dir -xdev ( -nouser -o -nogroup ) -print # Noowner files
- 准备和查找漏洞利用代码
安装了什么开发工具/语言/支持?
find / -name perl* find / -name python* find / -name gcc* find / -name cc
如何上传文件?
find / -name wget find / -name nc* find / -name netcat* find / -name tftp* find / -name ftp
查找exploit代码
http://www.exploit-db.com
http://1337day.com
http://www.securiteam.com
http://www.securityfocus.com
http://www.exploitsearch.net
http://metasploit.com/modules/
http://securityreason.com
http://seclists.org/fulldisclosure/
http://www.google.com
查找更多有关漏洞的信息
http://www.cvedetails.com
http://packetstormsecurity.org/files/cve/[CVE]
http://cve.mitre.org/cgi-bin/cvename.cgi?name=[CVE]]http://cve.mitre.org/cgi-bin/cvename.cgi?name=[CVE]
http://www.vulnview.com/cve-details.php?cvename=[CVE]]http://www.vulnview.com/cve-details.php?cvename=[CVE]
http://www.91ri.org/
(快速)“共同的“exploit,预编译二进制代码文件
http://tarantula.by.ru/localroot/
http://www.kecepatan.66ghz.com/file/local-root-exploit-priv9/
上面的信息很难吗?
快去使用第三方脚本/工具来试试吧!
系统怎么打内核,操作系统,所有应用程序,插件和Web服务的最新补丁?
apt-get update && apt-get upgrade yum update
服务运行所需的最低的权限?
例如,你需要以root身份运行MySQL?
能够从以下网站找到自动运行的脚本?!
http://pentestmonkey.net/tools/unix-privesc-check/
http://labs.portcullis.co.uk/application/enum4linux/
http://bastille-linux.sourceforge.net
- (快速)指南和链接
例如
http://www.0daysecurity.com/penetration-testing/enumeration.html
http://www.microloft.co.uk/hacking/hacking3.htm
其他
http://jon.oberheide.org/files/stackjacking-infiltrate11.pdf
http://pentest.cryptocity.net/files/clientsides/post_exploitation_fall09.pdf
http://insidetrust.blogspot.com/2011/04/quick-guide-to-linux-privilege.html
相关文章《linux下的基本渗透方法-实战》《总结Linux的一些渗透技巧》
- 上一篇:老王:如何正确配置Nginx+PHP
- 下一篇:Shell编程的10个最佳实践