<a href="http://www.baidu.com">link</a>
registration.addUrlPatterns(propertiesXxs.getUrlPatterns().split(","));
public static Whitelist relaxed() {
return (new Whitelist()).addTags("a", "b", "blockquote", "br", "caption", "cite", "code", "col", "colgroup", "dd", "div", "dl", "dt", "em", "h1", "h2", "h3", "h4", "h5", "h6", "i", "img", "li", "ol", "p", "pre", "q", "small", "span", "strike", "strong", "sub", "sup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "u", "ul").addAttributes("a", "href", "title").addAttributes("blockquote", "cite").addAttributes("col", "span", "width").addAttributes("colgroup", "span", "width").addAttributes("img", "align", "alt", "height", "src", "title", "width").addAttributes("ol", "start", "type").addAttributes("q", "cite").addAttributes("table", "summary", "width").addAttributes("td", "abbr", "axis", "colspan", "rowspan", "width").addAttributes("th", "abbr", "axis", "colspan", "rowspan", "scope", "width").addAttributes("ul", "type").addProtocols("a", "href", "ftp", "http", "https", "mailto").addProtocols("blockquote", "cite", "http", "https").addProtocols("cite", "cite", "http", "https").addProtocols("img", "src", "http", "https").addProtocols("q", "cite", "http", "https");
}
<a href="http://www.baidu.com">link</a>
漏洞地址
github地址:https://github.com/auntvt/Timo
target:http://192.168.137.1:8081/#/system/dept/index
漏洞版本
TimoV2.0.3
简介
TimoV2.0.3存在HTML注入
分析过程
输入payload:
实现HTML注入:
代码分析:
首先该系统采用的是Jsoup ,Jsoup 全局配置
覆盖的请求类型
java
/\*:这意味着所有URL都会被检测检测规则配置:
只允许特定的属性:
a:href,title(没有onclick等事件处理器)img:align,alt,height,src,title,width(没有onerror)其他标签只有基本的展示属性
a[href]: 只允许ftp,http,https,mailto(没有javascript协议)img[src]: 只允许http,https(没有data协议)所以这里可以使用
再次检测页面配置:
可以看到是在页面中直接输出
所以导致了HTML注入。
攻击者可以借此构造恶意链接,钓鱼攻击