怎么发现一些隐藏的功能/接口/字段

admin 2023年1月11日17:10:00评论31 views字数 1844阅读6分8秒阅读模式

怎么发现一些隐藏的功能/接口/字段

声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由用户承担全部法律及连带责任,文章作者不承担任何法律及连带责任。

前言

主要分享一些发现隐藏字段/功能/接口的方法。

方法1

在web开发(尤其是前端开发)中,经常有一些输入字段是在网页中是隐藏的,这里有多种方法可以隐藏输入字段:

1.input标签有一个比较特别的属性叫做hidden:

<input type="hidden" value=""></input>

如果在<input>标签内调用属性之前的值,则可以绕过type=”hidden” 。即

<input name=”xyz” value=”somevalue” type=”hidden”>

除此之外:

可以通过插入另一个类型属性作为type=”text”来绕过,即<input name=”xyz” value=”somevalue” type=”text” type=”hidden”>

2.将<input>标签放在另一个元素中并将其样式设置为display:none

<div style=”display:none”>
<input type=”text” value=”somevalue”>
</div>

绕过的方式:

<div style=”display:none”>
<input type=”text” value=”somevalue” pattern=”somethingelse” oninvalid=”alert(document.cookie)”>
</div>

主要利用pattern 属性,此属性用于比较值和模式,它与 if 条件相同,如果模式匹配并且有效则执行;

其他操作如果无效则执行其他操作.

3.将<input>标签样式设置为: visibility:hidden

<input type="text" value="" style="visibility:hidden"></input>

4.将<input>标签样式设置为width:0;height:0;

<input type="text" value="" style="width:0;height:0;"></input>

以上主要是碰到表单/input标签的时候需要多加留意

方法2

使用一些自动化工具:

Arjun:

pip3 install arjun    安装Arjun
arjun -i subdomains.txt -m GET -oT param.txt   针对多个目标
arjun -u target.com -m GET -oT param.txt   针对单个目标
[-m ] 参数方法
[-oT] 文本格式输出 # arjun -h 可以看到更多选项

ParamSpider:

$ python3 paramspider.py --domain bugcrowd.com --exclude woff,css,js,png,svg,php,jpg --output bugcrowd.txt

方法3

查找javascript文件中隐藏的GET参数:

这里主要通过分析javascript文件来寻找隐藏参数

  • 搜集javascript文件中的变量名,例如: var test = "xxx"
  • 尝试将每⼀个都作为GET参数,以发现隐藏的参数,例如: https://example.com/?test="xsstest

有人做了一个单行代码⽣生成器,它可以找到所有的变量名,并将其作为参数追加

 
assetfinder example.com | gau | egrep -v
'(.css|.png|.jpeg|.jpg|.svg|.gif|.wolf)' | while read url; do vars=$(curl -s
$url | grep -Eo "var [a-zA-Z0-9]+" | sed -e 's,'var','"$url"?',g' -e 's/ //g' |
grep -v '.js' | sed 's/.*/&=xss/g'); echo -e "e[1;33m$urlne[1;32m$vars";
done

往期回顾

2022年度精选文章

参考

https://github.com/s0md3v/

https://github.com/devanshbatham/ParamSpider

原文始发于微信公众号(迪哥讲事):怎么发现一些隐藏的功能/接口/字段

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年1月11日17:10:00
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   怎么发现一些隐藏的功能/接口/字段http://cn-sec.com/archives/1512782.html

发表评论

匿名网友 填写信息