前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >OSCP 考试操作笔记及参考资料

OSCP 考试操作笔记及参考资料

作者头像
信安之路
发布2021-04-14 11:03:44
1.3K0
发布2021-04-14 11:03:44
举报
文章被收录于专栏:信安之路信安之路
OSCP 认证,是一个专门针对 Kali Linux 渗透测试培训课程的专业认证。该认证机构声称,OSCP 认证是一个区别于所有其它认证的考试,考试全程采取手动操作的方式,而不设笔试环节。

每个 OSCP 考生,都拥有 24 小时的时间(实际是 23 小时 45 分钟)去完成考试,具体如何分配时间由考生自己决定。题目是 5 台主机(随机抽取),目标是攻入并拿到最高权限(ROOT/SYSTEM)。基于难度级别,成功执行的攻击会获得相应的积分。

以下是我用于测试目标实验机器的具体步骤,在考试期间这些都可以放入自动化代码中。

1、Nmap 基本扫描

Nmap -Pn -p- -vv Nmap -Pn -p- -sU -vv

2、针对端口指纹和漏洞的扫描

Nmap -Pn -sV -O -pT:{TCP ports found in step 1},U:{UDP ports found in step 1} -script vuln <ip address>

使用 NC 查看 banner

nc -nv <ip-address> <port>

3、针对 web 端口的枚举

Nikto -port {web ports} -host <ip address> -o <output file.txt>

目录扫描

Dirb http{s}://<ip address>:<port> /usr/share/wordlist/dirb/{common/small/vulns}.txt

Gobuster -u http://<ip-address> -w /usr/share/Seclists/Discovery/Web_Content/common.txt

如果想测试文件包含漏洞,可以使用 fimap:

fimap -u <ip-address>

4、针对已知的服务进行攻击尝试,搜索漏洞信息

Searchsploit <service name>

漏洞来源:

https://www.securityfocus.com/vulnerabilities

5、针对 web 页面的测试

检查页面信息,审查元素、查看 cookie、tamper 数据、可以使用 curl/wget

在线搜索资源(比如 github),如果应用程序是开源的,根据网站枚举的信息猜测版本,然后找出可能存在的风险

检查 HTTP 选项

测试输入表单参数(比如 1' or 1=1 limit 1; # AND 1' or 1=1--)

  • NULL 或 null
  • ', ", ;, <!
    • 中断 SQL 字符串或查询,常用于 SQL、XPath、XML 注入
  • -, =, +, "
    • 用于手工 SQL 注入测试
  • ', &, ! , ¦ , < , >
    • 用于找出命令执行漏洞
  • ../
    • 目录穿越漏洞

6、针对 NETBIOS、SMB、RPC 端口的测试

enum4linux -a <ip address> Rpcclient <ip address> -U "" -N Rpcinfo -p <target ip>

关于 RPC 历史漏洞的合集:

http://etutorials.org/Networking/network+security+assessment/Chapter+12.+Assessing+Unix+RPC+Services/12.2+RPC+Service+Vulnerabilities/

以下是常用的远程测试命令

Showmount -e <ip address>/<port> Mount -t cifs //<server ip>/<share> <local dir> -o username=”guest”,password=”” Rlogin <ip-address> Smbclient -L <ip-address> -U “” -N Nbtscan -r <ip address> Net use <ip-address>$Share “” /u:”” Net view <ip-address>

还可以使用 NMAP 的脚本测试 SMB、DCERPC、NETBIOS

7、针对 SMTP 端口的尝试

枚举用户,使用 VRFY 和 EXPN 命令

8、针对 SNMP 端口的测试

默认共享名称如:public, private, cisco, manager

使用工具:

Onesixtyone –c <community list file> -I <ip-address> Snmpwalk -c <community string> -v<version> <ip address>

默认 MIB:

1.3.6.1.2.1.25.1.6.0 System Processes 1.3.6.1.2.1.25.4.2.1.2 Running Programs 1.3.6.1.2.1.25.4.2.1.4 Processes Path 1.3.6.1.2.1.25.2.3.1.4 Storage Units 1.3.6.1.2.1.25.6.3.1.2 Software Name 1.3.6.1.4.1.77.1.2.25 User Accounts 1.3.6.1.2.1.6.13.1.3 TCP Local Ports

比如枚举运行的进程

nmpwalk -c public -v1 192.168.11.204 1.3.6.1.2.1.25.4.2.1.2

9、针对 FTP 端口测试

  • anonymous 是否可以登录
  • 如果可以登录是否可以使用 get 或 send 操作文件
  • 使用浏览器是否可以访问,ftp://<ip-address>

10、密码破解

在 linux 下可以使用 unshadow 命令合并 passwd 和 shadow 文件:

unshadow [passwd-file] [shadow-file] > unshadowed.txt

可以使用的 hash-identifier 识别 hash 类型,使用 hashcat 破解 hash

hashcat -m 400 -a 0 <hash file> <wordlist file>

对于其他服务,可以使用 Medusa 或 hydra

Hydra -L <username file> -P <Password file> -v <ip-address> ssh Medusa -h <ip-address> -U <username file> -P <password file> -M http -m DIR:/admin -T 30

11、数据包抓取

使用 wireshark / tcpdump 获取目标主机的流量

“tcpdump -i tap0 host tcp port 80 and not arp and not icmp -vv”

参考资料

NMAP Cheatsheet

https://blogs.sans.org/pen-testing/files/2013/10/NmapCheatSheetv1.1.pdf

Exploit-DB

https://www.exploit-db.com/

Kernel Exploits

https://www.kernel-exploits.com/

Privilege Escalation Linux

https://blog.g0tmi1k.com/2011/08/basic-linux-privilege-escalation/

Linux Pentest Commands

http://www.networkpentest.net/p/linuxunix-command-list.html

Windows Command Line Cheatsheet

https://www.sans.org/security-resources/sec560/windows_command_line_sheet_v1.pdf

Privilege Escalation Windows:

http://www.fuzzysecurity.com/tutorials/16.html

http://toshellandback.com/2015/11/24/ms-priv-esc/

Windows Priv Esc cheatsheet

http://it-ovid.blogspot.com/2012/02/windows-privilege-escalation.html

Pentest References:

http://www.vulnerabilityassessment.co.uk/

http://www.0daysecurity.com/penetration-testing/enumeration.html

Reverse Shell:

https://www.asafety.fr/reverse-shell-one-liner-cheat-sheet/

http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet

http://bernardodamele.blogspot.com/2011/09/reverse-shells-one-liners.html

http://www.lanmaster53.com/2011/05/7-linux-shells-using-built-in-tools/

Web Shells

http://repository.root-me.org/Exploitation - Web/EN - Webshells In PHP, ASP, JSP, Perl, And ColdFusion.pdf

Shell Escape:

https://speakerdeck.com/knaps/escape-from-shellcatraz-breaking-out-of-restricted-unix-shells

https://pen-testing.sans.org/blog/2012/06/06/escaping-restricted-linux-shells

https://null-byte.wonderhowto.com/how-to/use-misconfigured-suid-bit-escalate-privileges-get-root-0173929/

Pentestmonkey Cheat Sheets (SQL Injection)

http://pentestmonkey.net/category/cheat-sheet

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2021-03-24,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 信安之路 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 参考资料
相关产品与服务
网站渗透测试
网站渗透测试(Website Penetration Test,WPT)是完全模拟黑客可能使用的攻击技术和漏洞发现技术,对目标系统的安全做深入的探测,发现系统最脆弱的环节。渗透测试和黑客入侵最大区别在于渗透测试是经过客户授权,采用可控制、非破坏性质的方法和手段发现目标和网络设备中存在弱点,帮助管理者知道自己网络所面临的问题,同时提供安全加固意见帮助客户提升系统的安全性。腾讯云网站渗透测试由腾讯安全实验室安全专家进行,我们提供黑盒、白盒、灰盒多种测试方案,更全面更深入的发现客户的潜在风险。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档