我们在做渗透的时候肯定会用上扫描器的,本人一般会用御剑,当然你也会喜欢别的工具。
很多时候,能否渗透成功其实还挺依赖与字典的,如果把后台给扫出来了,恰好还弱口令,那么岂不是美滋滋。

因此,有一个好的字典是至关重要的。当然了,大佬们渗透多年肯定已经收藏了很多好用的字典了,但是吧,很多时候一个asp的字典里还有aspx啊,php啊,jsp啊等等不相关的东西,
如果不相关的东西多了就会降低扫描的效率了,因此我们需要一个用来整理的工具,可以让我们肆无忌惮的到处收集字典,然后整合到自己的字典库中

创建个data目录  把需要去重和分类的txt文件放到里面
请用python3.X执行

用法如下

  1. python datahanle.py
  1. #!/usr/bin/env python
  2. # -*- conding:utf-8 -*-
  3. import os,re
  4.  
  5. data =[]
  6. asp = []
  7. aspx = []
  8. php = []
  9. jsp = []
  10. mdb = []
  11. dirx = []
  12.  
  13. def file_name():
  14. for files in os.walk("data"):
  15. #print(files[2]) #当前路径下文件
  16. pass
  17. return files[2]
  18. def datas(dir):
  19. with open("%s"%dir,"r",encoding="gb18030") as f:
  20. for i in f.readlines():
  21. data.append(i)
  22. dirs =file_name()
  23. for i in dirs:
  24. datas("data/%s"%(i))
  25. print("一共有%s条路径"%(len(data)))
  26. data = list(set(data))
  27. print("去重后一共还有%s条路径"%(len(data)))
  28.  
  29. count_asp = 0
  30. count_aspx = 0
  31. count_jsp = 0
  32. count_php = 0
  33. count_dirx = 0
  34. count_mdb = 0
  35.  
  36. data = sorted(data) #对列表排序
  37.  
  38. for i in data:
  39. #rule = re.compile(r".*?asp",re.I)
  40. res = re.search('.*?\.asp',i,flags=re.I)
  41. if res == None:
  42. res = re.search('.*?\.mdb', i, flags=re.I)
  43. if res == None:
  44. res = re.search('.*?\.php', i, flags=re.I)
  45. if res == None:
  46. res = re.search('.*?\.jsp', i, flags=re.I)
  47. if res == None:
  48. dirx.append(i)
  49. count_dirx +=1
  50. else:
  51. jsp.append(i)
  52. count_jsp +=1
  53. else:
  54. php.append(i)
  55. count_php +=1
  56. else:
  57. mdb.append(i)
  58. count_mdb += 1
  59. else:
  60. res = re.search('.*?\.aspx', i, flags=re.I)
  61. if res == None:
  62. asp.append(i)
  63. count_asp+=1
  64. else:
  65. aspx.append(i)
  66. count_aspx +=1
  67.  
  68. print("asp:%s aspx:%s php:%s jsp:%s dir:%s mdb:%s"%(count_asp,count_aspx,count_php,count_jsp,count_dirx,count_mdb))
  69. with open('nwe_asp.txt','a',encoding='utf-8') as f:
  70. for i in asp:
  71. f.write(i)
  72.  
  73. with open('nwe_aspx.txt','a',encoding='utf-8') as f:
  74. for i in aspx:
  75. f.write(i)
  76.  
  77. with open('nwe_php.txt','a',encoding='utf-8') as f:
  78. for i in php:
  79. f.write(i)
  80.  
  81. with open('nwe_jsp.txt','a',encoding='utf-8') as f:
  82. for i in jsp:
  83. f.write(i)
  84.  
  85. with open('nwe_mdb.txt','a',encoding='utf-8') as f:
  86. for i in mdb:
  87. f.write(i)
  88.  
  89. with open('nwe_dir.txt','a',encoding='utf-8') as f:
  90. for i in dirx:
  91. f.write(i)

去重和分类后缀asp、php等路径 用python3写的的更多相关文章

  1. Asp.net项目路径获取方法【转】

    获取项目完整的绝对路径string path = System.AppDomain.CurrentDomain.BaseDirectory.ToString();string path = Serve ...

  2. ASP.NET获取路径的方法

    原文:[转载]ASP.NET获取路径的方法 HttpContext.Current.Request.PhysicalPath;    // 获得当前页面的完整物理路径.比如 F:\XFU.NSQS\p ...

  3. 关于ASP.Net中路径的问题

    比如你的工程是Webapplication1(url是:http://localhost/webapplication1/webform1.aspx) Request.ApplicationPath ...

  4. 2强类型DataSet (2011-12-30 23:16:59)转载▼ 标签: 杂谈 分类: Asp.Net练习笔记 http://blog.sina.com.cn/s/blog_9d90c4140101214w.html

    强类型DataSet (2011-12-30 23:16:59) 转载▼ 标签: 杂谈 分类: Asp.Net练习笔记 using System; using System.Collections.G ...

  5. 强类型DataSet (2011-12-30 23:16:59)转载▼ 标签: 杂谈 分类: Asp.Net练习笔记 http://blog.sina.com.cn/s/blog_9d90c4140101214w.html

    强类型DataSet (2011-12-30 23:16:59) 转载▼ 标签: 杂谈 分类: Asp.Net练习笔记 using System; using System.Collections.G ...

  6. [置顶] Asp.Net底层原理(二、写自己的Asp.Net框架)

    我们介绍过了浏览器和服务器之间的交互过程,接下来介绍Asp.net处理动态请求. 写自己的Asp.Net框架,我们不会引用System.Web这个程序集,我们只需要创建要给自己的类库,所以在接下来的程 ...

  7. direct path read/write (直接路径读/写)

    转载:http://www.dbtan.com/2010/04/direct-path-readwrite.html direct path read/write (直接路径读/写): 直接路径读(d ...

  8. Http,Https (SSL)的Url绝对路径,相对路径解决方案Security Switch 4.2 中文帮助文档 分类: ASP.NET 2014-10-28 14:09 177人阅读 评论(1) 收藏

    下载地址1:https://securityswitch.googlecode.com/files/SecuritySwitch%20v4.2.0.0%20-%20Binary.zip 下载地址2:h ...

  9. Http,Https(SSL)的Url绝对路径,相对路径解决方案Security Switch 4.2的配置和使用 分类: ASP.NET 2014-11-05 12:51 97人阅读 评论(0) 收藏

    下载地址1:https://securityswitch.googlecode.com/files/SecuritySwitch%20v4.2.0.0%20-%20Binary.zip 下载地址2:h ...

随机推荐

  1. 搭建SSH框架心得

    <Struts2+Spring4+hibernate3> 工程结构 导入相关jar包:自行网上百度即可,根据环境需要 写dao类 以及实现 package com.icommon.dao; ...

  2. 《Swell数学》用户故事

    一.用户故事基础知识: 1. 从用户的角度来描述用户渴望得到的功能. 2. 用户故事是描述对用户有价值的功能,好的用户故事应该包括角色.功能和商业价值三个要素. 3. 一个用户故事只是以客户能够明白的 ...

  3. java web后台工作原理

    多时候我们都想知道,web容器或web服务器(比如Tomcat或者jboss)是怎样工作的?它们是怎样处理来自全世界的http请求的?它们在幕后做了什么动作?Java Servlet API(例如Se ...

  4. Vue对Html标签应用条件渲染

    我的需求 在flag属性为true时 渲染标签的html为 <input :data-val-required="不能为空"/> 在flag属性为false时 渲染标签 ...

  5. 基于ZYNQ的双核启动与通信问题解决

    1    处理器间的通信 为AMP 设计创建应用之前,您需要考虑应用如何进行通信(如有需要).最简单的方法是使用片上存储器.Zynq SoC 配备256KB 的片上SRAM,可从以下四个源地址进行访问 ...

  6. less &进行选择判断css的样式

    先说&在less写 .parent{ .child{} &.and{} }在css就是 .parent.child{}//父子关系 .parent.and{}//并关系 用到这个方法是 ...

  7. 封装Thread的两种方法 via C++ in Linux

    方法一: 代理线程函数(proxyThreadFunc)作为类的静态成员函数, 回调函数指针作为类的私有成员变量 方法二: 代理线程函数(proxyThreadFunc)作为全局函数,  回调函数指针 ...

  8. Android 底部导航栏的xml

    <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android=&q ...

  9. postman的安装和使用

    在后端开发的过程中,没有前端代码可以配合测试已完成的代码是否有问题,这个时候就需要postman来帮忙解决.对于后端人员来说,postman是很好的测试工具,下面具体讲下怎么安装postman,本次安 ...

  10. Java前后端依赖

    有时候我们的一个类需要依赖另外一个类,这种就是依赖关系,创建对象的工作一般由spring容器来完成然后注入给调用者,这种就是依赖注入. 代码可参考1227210565朋友空间 DispatcherSe ...