当前位置:WooYun(白帽子技术社区) >> python >> 动态多线程敏感信息泄露检测工具--weakfilescan

动态多线程敏感信息泄露检测工具--weakfilescan

猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | 2015-04-03 00:29

https://github.com/ring04h/weakfilescan

具体使用细节文档,帮助文档正在写

一句话,用来检测敏感信息泄露的,svn、git、配置文件的临时文件全包含了,相关流程图、设计图编辑中
利用一切可利用的动态信息来关联检测的,各种用心的逻辑判断过滤

# 安装 lxml & beautifulsoup4

yum install python-devel libxml2-devel libxslt-devel
pip install lxml beautifulsoup4


python wyspider.py wuyun.org
--------------------------------------------------
* scan http://wuyun.org start
--------------------------------------------------
[200] http://wuyun.org => http://wuyun.org/
[200] http://wuyun.org/wuyun.tar.gz => http://wuyun.org/wuyun.tar.gz
--------------------------------------------------
* scan complete...
--------------------------------------------------
{
  "dirs": {
    "http://wuyun.org": [
      "http://wuyun.org"
    ]
  },
  "files": {
    "http://wuyun.org": [
      "http://wuyun.org/wuyun.tar.gz"
    ]
  }
}

分享到:
  1. 1#
    回复此人 感谢
    猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | | 2015-04-04 14:04

    设计图
    wyspdier.png

  2. 2#
    回复此人 感谢
    Sunshie (博客http://phpinfo.me 论坛 www.itgou.club) | 2015-04-03 00:33

    沙发

  3. 3#
    回复此人 感谢
    m1x7e1 (一枚92后小帅哥) | 2015-04-03 00:33

    赞!

  4. 4#
    回复此人 感谢
    小博 | 2015-04-03 00:36

    mac下自带的python是不是要安装什么依赖包

  5. 5#
    回复此人 感谢
    Well (男神提枪逛青楼。) | 2015-04-03 00:43

  6. 6#
    回复此人 感谢
    Arrow | 2015-04-03 00:45

  7. 7#
    回复此人 感谢
    小土豆 (加油ing~~) | 2015-04-03 00:48

    屌。赞一个

  8. 8#
    回复此人 感谢
    天地不仁 以万物为刍狗 (鬼冥夜出 天地现) | 2015-04-03 00:50

    赞个

  9. 9#
    回复此人 感谢
    sin (寻找最优雅的解决方案) | 2015-04-03 00:51

    mark

  10. 10#
    回复此人 感谢
    李旭敏 (˿̖̗̀́̂̃̄̅̆̇̈̉̊̋̌̍̎̏̐̑̒̓̔̕) | 2015-04-03 00:51

    灭绝人性的东西?

  11. 11#
    回复此人 感谢
    子非海绵宝宝 (呵呵) | 2015-04-03 00:54

    感觉这个是守株待兔式的找漏洞啊

  12. 12#
    回复此人 感谢
    动后河 (☭) | 2015-04-03 00:55

    深夜福利呀!
    我打赌依赖包又都贴心地打包进repo里了

  13. 13#
    回复此人 感谢
    _Thorns (创业公司招聘系统运维、软件逆向、数据可视化攻城狮。) | 2015-04-03 03:17

    深夜福利呀!

  14. 14#
    回复此人 感谢
    泳少 (此号被射!by U神) | 2015-04-03 07:54

    配合之前那几个已经成功一步步打造神器中。但是框架跟api不会搞。猪猪侠来教我下

  15. 15#
    回复此人 感谢
    老黑 | 2015-04-03 08:24

    不能批量啊

  16. 16#
    回复此人 感谢
    第四维度 (唯有梦想与好姑娘不可辜负) | 2015-04-03 08:26

    赞一个

  17. 17#
    回复此人 感谢
    东方不败 (日出东方,唯我不败) | 2015-04-03 08:59

    大恩不言谢,猪猪侠

  18. 18#
    回复此人 感谢
    sleep | 2015-04-03 09:10

    赞一个

  19. 19#
    回复此人 感谢
    Coody (&_&) | 2015-04-03 09:16

    漂亮

  20. 20#
    回复此人 感谢
    大大灰狼 (rourou男票) | 2015-04-03 09:22

    赞,猪猪

  21. 21#
    回复此人 感谢
    Nicky (安卓安全中文站 www.droidsec.cn) | 2015-04-03 09:27

    Mac系统下无法安装python-devel libxml2-devel libxslt-devel  所以会出现:IOError: [Errno 2] No such file or directory: './dict/package_ext.lst'

  22. 22#
    回复此人 感谢
    胡小树 | 2015-04-03 09:29

  23. 23#
    回复此人 感谢
    齐迹 (sec.zhubajie.com 欢迎来撸) | 2015-04-03 09:30

    前排支持!

  24. 24#
    回复此人 感谢
    Ricter (勿忘初心 (๑`・ᴗ・´๑) | 2015-04-03 09:46

    requirements.txt 内容大概不对,一般来说是这样。
    tornado>=4.0
    sqlalchemy>=0.9.7
    jinja2>=2.7.3


    这样可以方便的利用 pip install -r requirements.txt 安装,同时 PyCharm 可以正确的识别。

  25. 25#
    回复此人 感谢
    Allmylife | 2015-04-03 09:50

    good job

  26. 26#
    回复此人 感谢
    My5t3ry | 2015-04-03 09:56

    支持

  27. 27#
    回复此人 感谢
    erevus | 2015-04-03 10:20

     猪哥你把requestment 当成make来用了

  28. 28#
    回复此人 感谢
    Nicky (安卓安全中文站 www.droidsec.cn) | 2015-04-03 10:23

    @Nicky = =不对 其实是目录配置问题

  29. 29#
    回复此人 感谢
    D&G | 2015-04-03 10:28

    感谢猪猪侠大神~

  30. 30#
    回复此人 感谢
    無名老人 (干过开发,日过渗透,江湖人称:少妇杀手) | 2015-04-03 10:50

    赞一个

  31. 31#
    回复此人 感谢
    D&G | 2015-04-03 11:06

    对https是不是支持有问题?

  32. 32#
    回复此人 感谢
    Vinc (Q-Q-眼-W-R|Q-Q-闪现-R) | 2015-04-03 11:20

    感谢

  33. 33#
    回复此人 感谢
    东方不败 (日出东方,唯我不败) | 2015-04-03 11:28

    运行出现
    Traceback (most recent call last):
      File "wyspider.py", line 17, in <module>
        print json.dumps(start_wyspider(sys.argv[1]), indent=2)
      File "/root/weakfilescan/controller.py", line 78, in start_wyspider
        possibility = checksite_possibility(httpurl)
      File "/root/weakfilescan/common.py", line 65, in checksite_possibility
        httpres = http_request_get(siteurl.rstrip('/')+tempurl)
      File "/root/weakfilescan/common.py", line 39, in http_request_get
        allow_redirects=allow_redirects)
      File "/root/weakfilescan/libs/requests/sessions.py", line 473, in get
        return self.request('GET', url, **kwargs)
      File "/root/weakfilescan/libs/requests/sessions.py", line 461, in request
        resp = self.send(prep, **send_kwargs)
      File "/root/weakfilescan/libs/requests/sessions.py", line 573, in send
        r = adapter.send(request, **kwargs)
      File "/root/weakfilescan/libs/requests/adapters.py", line 415, in send
        raise ConnectionError(err, request=request)
    libs.requests.exceptions.ConnectionError: ('Connection aborted.', BadStatusLine("''",))

    有些是探测两三个就这样,有些就直接这样。还有些是直接卡死- -是我没安装yum install python-devel libxml2-devel libxslt-devel 这个的原因么,kali运行提示没有yum这个命令- -百度无果- -我看可以运行就没管了,

  34. 34#
    回复此人 感谢
    猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | 2015-04-03 11:33

    @东方不败 @D&G 才刚写好,确实各种不稳定,在改改改

  35. 35#
    回复此人 感谢
    东方不败 (日出东方,唯我不败) | 2015-04-03 11:35

    @猪猪侠 好的,幸苦猪猪侠大神了

  36. 36#
    回复此人 感谢
    纷纭 (:-)) | 2015-04-03 11:39

    @小博  http://stackoverflow.com/questions/26473197/how-to-install-libxml2-dev-libxslt-dev-on-mac-os

  37. 37#
    回复此人 感谢
    jeary ((:‮?办么怎,了多越来越法方象抽的我)) | 2015-04-03 11:57

    加了点代码,就可以从txt读取然后挂着去喝咖啡了~~
    if __name__ == "__main__":
      if len(sys.argv) == 2:
        print '2'
        print json.dumps(start_wyspider(sys.argv[1]), indent=2)
        sys.exit(0)
      elif len(sys.argv)==3:
        for i in open(sys.argv[2]):
          print i
          print json.dumps(start_wyspider(str(i).strip()), indent=2)
        sys.exit(0)
      else:
        print ("usage: %s http://wuyun.org" % sys.argv[0])
        print ("usage: %s -u url.txt" % sys.argv[0])
        sys.exit(-1)

  38. 38#
    回复此人 感谢
    pigzhu | 2015-04-03 12:51

    猪猪 辛苦了 不错

  39. 39#
    回复此人 感谢
    动后河 (☭) | 2015-04-03 13:08

    @东方不败 'kali运行提示没有yum这个命令- -百度无果-'  kali又不是centos,怎么会有yum, 试试apt-get

  40. 40#
    回复此人 感谢
    TellYouThat | 2015-04-03 14:24

    赞~~

  41. 41#
    回复此人 感谢
    Nicky (安卓安全中文站 www.droidsec.cn) | 2015-04-03 15:32

    希望加入超时自动停止和结果导出功能~thx~

  42. 42#
    回复此人 感谢
    待续 | 2015-04-03 17:25

    mk

  43. 43#
    回复此人 感谢
    灰色轨迹 | 2015-04-03 17:55

    @猪猪侠 猪哥 kali下如何安装呀  kali运行提示没有yum这个命令

  44. 44#
    回复此人 感谢
    zph | 2015-04-03 18:26

    顶猪哥

  45. 45#
    回复此人 感谢
    Well (男神提枪逛青楼。) | 2015-04-03 19:01

    猪哥也是个程序猿。。。

  46. 46#
    回复此人 感谢
    猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | 2015-04-04 01:08

    修复了几个大的BUG,各位可以  git pull 更新一下再使用
    1、解决了不支持HTTPS的问题
    2、解决了checksite_possibility()函数报错的问题

  47. 47#
    回复此人 感谢
    猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | 2015-04-04 01:18

    更新了config.py的配置项,剔除掉403
    # 无错爬取
    python wyspider.py https://mail.qq.com

  48. 48#
    回复此人 感谢
    Mujj (为何我的眼中饱含泪水?因为我装逼装的深沉) | 2015-04-04 03:43

    @猪猪侠 是不是有些问题啊?


    [200] http://zone.wooyun.org/zone/wooyun.bz2 => http://zone.wooyun.org/login


    [root@lax-01 weakfilescan]# curl -i http://zone.wooyun.org/zone/wooyun.bz2
    HTTP/1.1 302 Moved Temporarily
    Date: Fri, 03 Apr 2015 19:42:21 GMT
    Content-Type: text/html
    Transfer-Encoding: chunked
    Connection: keep-alive
    Set-Cookie: __cfduid=d4bb4dd27532c34ad259ff375546604b11428090140; expires=Sat, 02-Apr-16 19:42:20 GMT; path=/; domain=.wooyun.org; HttpOnly
    Set-Cookie: PHPSESSID=hqsh2s54gc943b1949d35ptuc4; path=/
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Pragma: no-cache
    Location: http://zone.wooyun.org/login
    Server: yunjiasu-nginx
    CF-RAY: 1d174193084f0af0-WAW

  49. 49#
    回复此人 感谢
    Well (男神提枪逛青楼。) | 2015-04-04 12:24

    @猪猪侠 求放出Scrapy+ bloom filter 规则,爬虫循环目录扫描。。大杀器

  50. 50#
    回复此人 感谢
    猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | 2015-04-04 13:22

    @Mujj 因为 /zone/目录下有.htaccess来重定向后面的内容,就像 http://www.wooyun.org/whitehats/weakfilescan ,
    需要你修改config.py 里面的
    page_not_found_reg = r'404|(n|N)ot\ (f|F)ound|不存在|未找到|Error'
    ,来自定义操蛋的url重定向,呵呵

  51. 51#
    回复此人 感谢
    Jumbo (www.chinabaiker.com) | 2015-04-04 14:02

    @猪猪侠 报错了Traceback (most recent call last):
      File "wyspider.py", line 20, in <module>
        print json.dumps(start_wyspider(sys.argv[1]),indent=2)
      File "/root/Desktop/weakfilescan-master/controller.py", line 81, in start_wyspider
        possibility = checksite_possibility(httpurl)
      File "/root/Desktop/weakfilescan-master/common.py", line 76, in checksite_possibility
        is_redirect = True if len(httpres.history) > 0 else False
    AttributeError: 'NoneType' object has no attribute 'history'

  52. 52#
    回复此人 感谢
    猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | 2015-04-04 14:06

    @Jumbo 是最新版吗?扫的哪个网站,我测试一下加个全局错误过滤

  53. 53#
    回复此人 感谢
    Jumbo (www.chinabaiker.com) | 2015-04-04 14:11

    @猪猪侠 恩 对,我测试了其他的,扫出来以后还是会报错,加个错误过滤

  54. 54#
    回复此人 感谢
    猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | 2015-04-04 14:46

    @Jumbo 改好更新了,你git pull试试新版本看看

  55. 55#
    回复此人 感谢
    izj | 2015-04-04 22:05

    猪猪侠的东西不会错

  56. 56#
    回复此人 感谢
    Mujj (为何我的眼中饱含泪水?因为我装逼装的深沉) | 2015-04-04 23:01

    @猪猪侠 好的。

  57. 57#
    回复此人 感谢
    风之传说 | 2015-04-04 23:04

    windows下使用。报错了。。

  58. 58#
    回复此人 感谢
    ddy (其实第一次要我挖洞我是拒绝的。因为,你不能让我挖,) | 2015-04-04 23:11

    每次有人骂我是猪我都说自己是猪猪侠

  59. 59#
    回复此人 感谢
    猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | 2015-04-05 00:46

    @Mujj 新代码加入了误报清洗功能,某个目录返回的结果超过config.py里面resulst_cnt_val定义的个数,会自动被清除掉。

  60. 60#
    回复此人 感谢
    几何黑店 | 2015-04-05 00:47

    @猪猪侠
    python wyspider.py http://www.youmi.net
    --------------------------------------------------
    * scan http://www.youmi.net start
    --------------------------------------------------
    Traceback (most recent call last):
      File "wyspider.py", line 20, in <module>
        print json.dumps(start_wyspider(sys.argv[1]),indent=2)
      File "/root/weakfilescan/controller.py", line 41, in start_wyspider
        link_datas = GetAllLink(siteurl).start()
      File "/root/weakfilescan/libs/GetAllLink.py", line 47, in start
        response_obj = LinksParser(http_request_get(self.siteurl))
      File "/root/weakfilescan/common.py", line 157, in __init__
        self.baseurl = get_baseurl(self.url)
      File "/root/weakfilescan/common.py", line 31, in get_baseurl
        netloc = urlparse.urlparse(link).netloc
      File "/usr/lib/python2.7/urlparse.py", line 140, in urlparse
        tuple = urlsplit(url, scheme, allow_fragments)
      File "/usr/lib/python2.7/urlparse.py", line 179, in urlsplit
        i = url.find(':')

  61. 61#
    回复此人 感谢
    猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | 2015-04-05 00:57

    @几何黑店
    SSLError: hostname 'www.youmi.net' doesn't match either of 'campus.youmi.net', 'www.campus.youmi.net'

    服务器开启强制跳转到https,问题是他服务器的证书不匹配,我更新下代码,忽略证书检测

  62. 62#
    回复此人 感谢
    猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | 2015-04-05 01:03

    @几何黑店 好了,你git pull下,SSL的warning可以不用理会

  63. 63#
    回复此人 感谢
    几何黑店 | 2015-04-05 01:17

    @猪猪侠
    python wyspider.py http://www.youmi.net
    --------------------------------------------------
    * scan http://www.youmi.net start
    --------------------------------------------------
    /root/weakfilescan/libs/requests/packages/urllib3/connectionpool.py:734: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
      InsecureRequestWarning)
    /root/weakfilescan/libs/requests/packages/urllib3/connectionpool.py:734: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
      InsecureRequestWarning)
    /root/weakfilescan/libs/requests/packages/urllib3/connectionpool.py:734: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
      InsecureRequestWarning)
    /root/weakfilescan/libs/requests/packages/urllib3/connectionpool.py:734: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
      InsecureRequestWarning)
    /root/weakfilescan/libs/requests/packages/urllib3/connectionpool.py:734: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
      InsecureRequestWarning)
    /root/weakfilescan/libs/requests/packages/urllib3/connectionpool.py:734: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
      InsecureRequestWarning)
    /root/weakfilescan/libs/requests/packages/urllib3/connectionpool.py:734: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html

  64. 64#
    回复此人 感谢
    猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | 2015-04-05 01:25

    @几何黑店 正常的警告,不用理会的

  65. 65#
    回复此人 感谢
    猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | 2015-04-05 01:29

    @几何黑店 好了,我把requests官方的类修改了,就为了屏蔽这个错误,哎

  66. 66#
    回复此人 感谢
    jeary ((:‮?办么怎,了多越来越法方象抽的我)) | 2015-04-05 02:33

    设计图叼得飞起.收下膝盖

  67. 67#
    回复此人 感谢
    rootsecurity | 2015-04-05 07:52

    @小博 pip

  68. 68#
    回复此人 感谢
    核攻击 (统治全球,奴役全人类!毁灭任何胆敢阻拦的有机生物!) | 2015-04-05 15:30

    赞一个!

  69. 69#
    回复此人 感谢
    Litteryi (小弈) | 2015-04-05 19:42

    我是来看4L头像的。

  70. 70#
    回复此人 感谢
    ringo | 2015-04-05 20:10

    大杀器。。。

  71. 71#
    回复此人 感谢
    Wooyun第一大屌 | 2015-04-06 08:30

    遇上安全狗会汪汪汪!没什么用   但是,我真心觉得很不错的一个工具! 谢谢分享!

  72. 72#
    回复此人 感谢
    纷纭 (:-)) | 2015-04-06 09:22

    @东方不败 look here http://blog.csdn.net/kezhen/article/details/42967143

  73. 73#
    回复此人 感谢
    ModNar | 2015-04-06 13:18

    @猪猪侠
    from requests.packages import urllib3
    urllib3.disable_warnings()

  74. 74#
    回复此人 感谢
    东方不败 (日出东方,唯我不败) | 2015-04-06 19:27

    @纷纭 好人一生平安! 我要你给我生猴子

  75. 75#
    回复此人 感谢
    浅蓝 (摸摸大) | 2015-04-06 21:11

    @猪猪侠  Windows下报错了

  76. 76#
    回复此人 感谢
    影刺 | 2015-04-07 17:03

    @东方不败 apt-get install

  77. 77#
    回复此人 感谢
    _Evil (科普是一种公益行为) | 2015-04-09 15:57

    哈喽

  78. 78#
    回复此人 感谢
    Seven.Sea | 2015-04-10 21:29

    辛苦辛苦福利啊

  79. 79#
    回复此人 感谢
    炯炯虾 | 2015-04-13 17:45
  80. 80#
    回复此人 感谢
    asdf (import pdb;pdb.set_trace(); name="signature" type="text" maxlength="25") | 2015-04-14 08:47

    @猪猪侠 不用修改官方的。在你主文件开头加上这个吧。 而且官方正在最新版本中计划加个参数可以ignore这个告警信息。
    import warnings
    from requests.packages.urllib3.exceptions import InsecureRequestWarning
    from requests.packages.urllib3.exceptions import InsecurePlatformWarning

    warnings.filterwarnings(action="ignore", message="Unverified HTTPS request.*", category=InsecureRequestWarning)
    warnings.filterwarnings(action="ignore", message="A true SSLContext object.*", category=InsecurePlatformWarning)

  81. 81#
    回复此人 感谢
    hkmm | 2015-04-14 09:31

    学习了,拿了东西也不感谢下的

  82. 82#
    回复此人 感谢
    cf_hb (10000定律<=>实践ing) | 2015-04-14 10:38

    好强大的神器,感谢猪猪侠的分享!

  83. 83#
    回复此人 感谢
    cf_hb (10000定律<=>实践ing) | 2015-04-14 10:54

    @猪猪侠 好像没有对被安全狗屏蔽访问的判断,QQ20150414105306.png

  84. 84#
    回复此人 感谢
    国士无双 (我来找快乐。) | 2015-04-14 11:42

    @cf_hb 用的爬虫吧

  85. 85#
    回复此人 感谢
    cf_hb (10000定律<=>实践ing) | 2015-04-14 12:31

    @国士无双 不是爬虫,这是在Fuzzing目录

  86. 86#
    回复此人 感谢
    猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | 2015-04-14 13:01

    @cf_hb 你没发现config.py可以定制规则的嘛? 你把安全狗报错的关键字写到404规则里面去,这些200的内容在结果集中就会自动消除了。

  87. 87#
    回复此人 感谢
    cf_hb (10000定律<=>实践ing) | 2015-04-14 13:33

    @猪猪侠 嗯,看到page_not_found_reg了

  88. 88#
    回复此人 感谢
    jeary ((:‮?办么怎,了多越来越法方象抽的我)) | 2015-04-14 17:41

    弱弱的问句,扫完之后输出文件在哪了..

  89. 89#
    回复此人 感谢
    Vern | 2015-04-14 21:59

    root@kali:~/weakfilescan# python wyspider.py http://www.xxxx.cn php
    --------------------------------------------------
    * scan http://www.qeeyou.cn start
    --------------------------------------------------
    Traceback (most recent call last):
      File "wyspider.py", line 17, in <module>
        print json.dumps(start_wyspider(sys.argv[1]), indent=2)
      File "/root/weakfilescan/controller.py", line 41, in start_wyspider
        link_datas = GetAllLink(siteurl).start()
      File "/root/weakfilescan/libs/GetAllLink.py", line 47, in start
        response_obj = LinksParser(http_request_get(self.siteurl))
      File "/root/weakfilescan/common.py", line 171, in __init__
        self.soup = BeautifulSoup(self.html_content.text, 'lxml')
      File "/usr/lib/python2.7/dist-packages/bs4/__init__.py", line 172, in __init__
        self._feed()
      File "/usr/lib/python2.7/dist-packages/bs4/__init__.py", line 185, in _feed
        self.builder.feed(self.markup)
      File "/usr/lib/python2.7/dist-packages/bs4/builder/_lxml.py", line 175, in feed
        self.parser.close()
      File "parser.pxi", line 1186, in lxml.etree._FeedParser.close (src/lxml/lxml.etree.c:88907)
      File "parsertarget.pxi", line 142, in lxml.etree._TargetParserContext._handleParseResult (src/lxml/lxml.etree.c:98223)
      File "parsertarget.pxi", line 130, in lxml.etree._TargetParserContext._handleParseResult (src/lxml/lxml.etree.c:98047)
      File "lxml.etree.pyx", line 294, in lxml.etree._ExceptionContext._raise_if_stored (src/lxml/lxml.etree.c:9077)
      File "saxparser.pxi", line 289, in lxml.etree._handleSaxDoctype (src/lxml/lxml.etree.c:94611)
      File "parsertarget.pxi", line 86, in lxml.etree._PythonSaxParserTarget._handleSaxDoctype (src/lxml/lxml.etree.c:97582)
      File "/usr/lib/python2.7/dist-packages/bs4/builder/_lxml.py", line 150, in doctype
        doctype = Doctype.for_name_and_ids(name, pubid, system)
      File "/usr/lib/python2.7/dist-packages/bs4/element.py", line 720, in for_name_and_ids
        return Doctype(value)
      File "/usr/lib/python2.7/dist-packages/bs4/element.py", line 653, in __new__
        return unicode.__new__(cls, value, DEFAULT_OUTPUT_ENCODING)
    TypeError: coercing to Unicode: need string or buffer, NoneType found

  90. 90#
    回复此人 感谢
    xssx | 2015-04-15 11:18

    弱弱的问句,扫完之后输出文件在哪了..

  91. 91#
    回复此人 感谢
    cf_hb (10000定律<=>实践ing) | 2015-04-15 13:41

    @xssx wyspider.py 第 17、21 行

  92. 92#
    回复此人 感谢
    jeary ((:‮?办么怎,了多越来越法方象抽的我)) | 2015-04-15 16:48

    加了点代码
    扫描完成后会写入结果在当前目录,生成文件result.txt(代码很搓,有点冗余)
    加了个用法:python wyspider.py -u url.txt   (从当前目录url.txt循环取url然后开始扫描)

    if __name__ == "__main__":
      f = file("result.txt","a+")
      result = "test"
      if len(sys.argv) == 2:    
        result = json.dumps(start_wyspider(sys.argv[1]), indent=2)
        f.write(result)
        print result
        sys.exit(0)
      elif len(sys.argv)==3:
        for i in open(sys.argv[2]):      
          result = json.dumps(start_wyspider(str(i).strip()), indent=2)
          f.write(result)
          print result
        sys.exit(0)
      else:
        print ("usage: %s http://wuyun.org" % sys.argv[0])
        print ("usage: %s -u url.txt" % sys.argv[0])
        sys.exit(-1)

  93. 93#
    回复此人 感谢
    Superman (脚踏实地) | 2015-04-16 10:07

    感觉 速度好慢呀~可以加设置线程数不

  94. 94#
    回复此人 感谢
    木马游民 | 2015-04-16 10:34

    感谢

  95. 95#
    回复此人 感谢
    猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | 2015-04-16 10:55

    @Superman config.py 里面不是有配置项吗?自定义线程数,慢是因为实实在在的发出了足够数量的扫描测试用例任务。。

  96. 96#
    回复此人 感谢
    jeary ((:‮?办么怎,了多越来越法方象抽的我)) | 2015-04-16 13:48

    某些url会报这个错误
    Traceback (most recent call last):
      File "wyspider.py", line 26, in <module>
        result = json.dumps(start_wyspider(str(i).strip()), indent=2)
      File "F:\Self\weakfilescan-master\controller.py", line 41, in start_wyspider
        link_datas = GetAllLink(siteurl).start()
      File "F:\Self\weakfilescan-master\libs\GetAllLink.py", line 47, in start
        response_obj = LinksParser(http_request_get(self.siteurl))
      File "F:\Self\weakfilescan-master\common.py", line 170, in __init__
        self.baseurl = get_baseurl(self.url)
      File "F:\Self\weakfilescan-master\common.py", line 31, in get_baseurl
        netloc = urlparse.urlparse(link).netloc
      File "C:\Python27\lib\urlparse.py", line 134, in urlparse
        tuple = urlsplit(url, scheme, allow_fragments)
      File "C:\Python27\lib\urlparse.py", line 173, in urlsplit
        i = url.find(':')
    AttributeError: 'NoneType' object has no attribute 'find'


    然后http://www.onlylady.com报了这个错误
    * scan http://www.onlylady.com start
    --------------------------------------------------
    encoding error : input conversion failed due to input error, bytes 0xB5 0x00 0xDA 0x00
    encoding error : input conversion failed due to input error, bytes 0xB5 0x00 0xDA 0x00
    encoding error : input conversion failed due to input error, bytes 0xD3 0x00 0xD1 0x00
    encoding error : input conversion failed due to input error, bytes 0xD3 0x00 0xD1 0x00
    encoding error : input conversion failed due to input error, bytes 0xC5 0x00 0xD4 0x00
    encoding error : input conversion failed due to input error, bytes 0xC5 0x00 0xD4 0x00
    encoding error : input conversion failed due to input error, bytes 0xD5 0x00 0xE2 0x00
    encoding error : input conversion failed due to input error, bytes 0xD5 0x00 0xE2 0x00
    encoding error : input conversion failed due to input error, bytes 0xD1 0x00 0xEE 0x00
    encoding error : input conversion failed due to input error, bytes 0xD1 0x00 0xEE 0x00
    encoding error : input conversion failed due to input error, bytes 0xB4 0x00 0xA6 0x00
    encoding error : input conversion failed due to input error, bytes 0xB4 0x00 0xA6 0x00
    encoding error : input conversion failed due to input error, bytes 0xB1 0x00 0xEA 0x00
    encoding error : input conversion failed due to input error, bytes 0xB1 0x00 0xEA 0x00
    encoding error : input conversion failed due to input error, bytes 0xB1 0x00 0xEA 0x00
    encoding error : input conversion failed due to input error, bytes 0xB1 0x00 0xEA 0x00
    encoding error : input conversion failed due to input error, bytes 0xB7 0x00 0xA2 0x00
    encoding error : input conversion failed due to input error, bytes 0xB7 0x00 0xA2 0x00
    encoding error : input conversion failed due to input error, bytes 0xC6 0x00 0xD8 0x00
    encoding error : input conversion failed due to input error, bytes 0xC6 0x00 0xD8 0x00
    encoding error : input conversion failed due to input error, bytes 0xC7 0x00 0xA7 0x00
    encoding error : input conversion failed due to input error, bytes 0xBF 0x00 0xC6 0x00
    encoding error : input conversion failed due to input error, bytes 0xBB 0x00 0xBC 0x00
    encoding error : input conversion failed due to input error, bytes 0xBC 0x00 0xAA 0x00
    encoding error : input conversion failed due to input error, bytes 0xC8 0x00 0xC8 0x00
    encoding error : input conversion failed due to input error, bytes 0xA1 0x00 0xBE 0x00
    encoding error : input conversion failed due to input error, bytes 0xC7 0x00 0xEF 0x00
    encoding error : input conversion failed due to input error, bytes 0xC8 0x00 0xC8 0x00
    encoding error : input conversion failed due to input error, bytes 0xA1 0x00 0xBE 0x00
    encoding error : input conversion failed due to input error, bytes 0xBB 0x00 0xBC 0x00
    encoding error : input conversion failed due to input error, bytes 0xC8 0x00 0xC8 0x00
    encoding error : input conversion failed due to input error, bytes 0xC7 0x00 0xA7 0x00
    encoding error : input conversion failed due to input error, bytes 0xC7 0x00 0xEF 0x00
    encoding error : input conversion failed due to input error, bytes 0xBF 0x00 0xC6 0x00
    encoding error : input conversion failed due to input error, bytes 0xC8 0x00 0xC8 0x00
    encoding error : input conversion failed due to input error, bytes 0xBC 0x00 0xAA 0x00
    encoding error : input conversion failed due to input error, bytes 0xD3 0x00 0xA2 0x00
    encoding error : input conversion failed due to input error, bytes 0xD3 0x00 0xA2 0x00
    encoding error : input conversion failed due to input error, bytes 0xD2 0x00 0xBB 0x00
    encoding error : input conversion failed due to input error, bytes 0xBB 0x00 0xD8 0x00
    encoding error : input conversion failed due to input error, bytes 0xD2 0x00 0xBB 0x00
    encoding error : input conversion failed due to input error, bytes 0xBB 0x00 0xD8 0x00

  97. 97#
    回复此人 感谢
    围剿 (七月流火,八月未央,九月白露凝成轻霜) | 2015-04-16 16:03

    神一般的存在

  98. 98#
    回复此人 感谢
    iceks (bk7477890) | 2015-04-16 16:57

    猪猪侠,你是原来邪八的ring04h?

  99. 99#
    回复此人 感谢
    Mody | 2015-04-16 18:47

    猪哥好吊

  100. 100#
    回复此人 感谢
    Mr.R | 2015-04-16 20:07

    猪哥好叼 来膜拜下 顺便收走工具

  101. 101#
    回复此人 感谢
    咖啡 (SELECT) | 2015-04-16 21:12

    有些url一直是未响应状态。。

  102. 102#
    回复此人 感谢
    JJ Fly | 2015-04-16 22:47

    @猪猪侠
    经过测试,发现如果是index.php.bak ,可以通过发现index.php 然后扫描备份文件会发现 。但是xxxxx/config.php.bak 就不能通过 xxxxx/config.php 发现 。 这个是为什么  ?

  103. 103#
    回复此人 感谢
    JJ Fly | 2015-04-18 09:24

    @猪猪侠  还有一个问题 ,我再filename.lst 字典中 添加xxx.rar  运行中确定他是 200的状态了,但是在最后的json结果中 ,没有这项数据。

  104. 104#
    回复此人 感谢
    zhxs (宁愿做一天的英雄,也不愿意平淡一生!) | 2015-04-20 13:34

    默默的走过、、、、

  105. 105#
    回复此人 感谢
    老黑 | 2015-04-20 17:58

    Traceback (most recent call last):
      File "wyspider.py", line 20, in <module>
        print json.dumps(start_wyspider(sys.argv[1]),indent=2)
      File "/home/wwwroot/scan/weakfilescan-master/controller.py", line 58, in start_wyspider
        fuzzfile_request_set.extend(urlgenerator_obj.generator())
      File "/home/wwwroot/scan/weakfilescan-master/libs/FuzzUrlGenerator.py", line 46, in generator
        urls_result.append(parser_obj.baseurl + webdir + depend)
    MemoryError

  106. 106#
    回复此人 感谢
    an0nym0u5 | 2015-04-22 08:31

    感谢猪猪侠分享,运行良好,期待帮助文档哈~

  107. 107#
    回复此人 感谢
    JGHOOluwa | 2015-04-22 13:46

    win下已正常运行,谢谢大神分享~

  108. 108# 感谢(1)
    回复此人 感谢
    百变屌丝 | 2015-04-22 21:48

    已关注

  109. 109#
    回复此人 感谢
    xsser_w (看个J8,SB!) | 2015-04-23 20:53

    @灰色轨迹 apt-get阿  你kali新手么。。。。。

  110. 110#
    回复此人 感谢
    xsser_w (看个J8,SB!) | 2015-04-23 20:54

    神器。。。。卧槽  猪猪侠带我飞阿

  111. 111#
    回复此人 感谢
    noob (漏洞深不可测#&8238) | 2015-04-25 15:05

    谢谢大神分享

  112. 112#
    回复此人 感谢
    Skull ((‮data;)) | 2015-05-05 05:52
  113. 113#
    回复此人 感谢
    Skull ((‮data;)) | 2015-05-05 05:56

    求解答是何处出了问题@猪猪侠

  114. 114#
    回复此人 感谢
    Skull ((‮data;)) | 2015-05-05 06:43

    @猪猪侠 虚拟机中ubuntu 已经成功运行。
    只是不懂mac 如何运行

  115. 115#
    回复此人 感谢
    猪猪侠 (每次有人骂我是猪我都说自己是猪猪侠) | 2015-05-05 12:21

    @Skull lxml 没装好。

  116. 116#
    回复此人 感谢
    Skull ((‮data;)) | 2015-05-05 15:40

    @猪猪侠 谢谢!

  117. 117#
    回复此人 感谢
    redare | 2015-05-12 13:48

    感谢猪猪侠,不过遇到200的自定义错误页怎么破?

  118. 118#
    回复此人 感谢
    redare | 2015-05-12 14:13

    找到设置的地方了,page_not_found_reg = r'404|[nN]ot [fF]ound|不存在|未找到|Error',不过自定义页面内已经有“404”的内容了但为什么还是被扫到了?

  119. 119#
    回复此人 感谢
    Balance | 2015-06-22 10:16

    顶了。。

  120. 120#
    回复此人 感谢
    Aepl│恋爱 | 2015-07-28 22:14

    @猪猪侠 请问下 扫描完输出的目录是什么? 文件名叫什么?

  121. 121#
    回复此人 感谢
    Evil卍 | 2015-08-04 17:44

    感谢

  122. 122#
    回复此人 感谢
    齐迹 (sec.zhubajie.com 欢迎来撸) | 2015-10-27 16:05

    mac下 没有任何错误 内存被吃光。。已卡死,求原因?@猪猪侠

添加新回复

登录 后才能参与评论.

WooYun(白帽子技术社区)

网络安全资讯、讨论,跨站师,渗透师,结界师聚集之地

登录