查看: 10990|回复: 4

web信息收集脚本

[复制链接]
  • TA的每日心情

    昨天 21:42
  • 签到天数: 1564 天

    [LV.Master]伴坛终老

    发表于 2015-11-16 15:54:14 | 显示全部楼层 |阅读模式
    From:Joseph

    [Python] 纯文本查看 复制代码
    #! /usr/bin/python
    # -*- coding: utf-8 -*-
    # Joseph
     
    import os
    import re
    import urllib
    def getFileName(rootpath,path):
        ''' 获取指定目录下的所有指定后缀的文件名 '''
     
        f_list = os.listdir(path)
        for i in f_list:
            # os.path.splitext():分离文件名与扩展名
            if os.path.splitext(i)[1] == '.php' or os.path.splitext(i)[1] == '.txt' or os.path.splitext(i)[1] == '.xls' or os.path.splitext(i)[1] == '.rar':
                    Absolutepath=urllib.quote(path+i)
                    scandir=re.sub(rootpath,"",Absolutepath)
                    print urllib.unquote("/"+scandir)
    def processDirectory(rootpath,dirname):
            Filelist=os.listdir(dirname)
            getFileName(rootpath,dirname)
            for files in Filelist:
                    if os.path.isdir(dirname+files):
                            processDirectory(rootpath,dirname+files+"/")
                            pass
                    pass
    def main(path):
            rootpath=urllib.quote(path)
            processDirectory(rootpath,path)
            pass
     
    if __name__ == '__main__':
            scandir=raw_input('Please input startdir:')
            main(scandir+"/")
    回复

    使用道具 举报

    头像被屏蔽
  • TA的每日心情
    慵懒
    2016-2-28 17:24
  • 签到天数: 72 天

    [LV.6]常住居民II

    发表于 2015-11-16 18:47:14 | 显示全部楼层
    提示: 作者被禁止或删除 内容自动屏蔽
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    无聊
    2016-3-31 18:55
  • 签到天数: 38 天

    [LV.5]常住居民I

    发表于 2015-11-16 20:00:24 | 显示全部楼层
    续爷这个脚本只是一个雏形,期待更多的人来添加功能
    回复 支持 反对

    使用道具 举报

  • TA的每日心情

    7 小时前
  • 签到天数: 122 天

    [LV.7]常住居民III

    发表于 2015-11-16 22:58:25 | 显示全部楼层
    前排瞻仰大牛!!!
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    擦汗
    2016-5-30 09:11
  • 签到天数: 49 天

    [LV.5]常住居民I

    发表于 2015-11-17 21:00:27 | 显示全部楼层
    学习一下 看看是怎么写的
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    指导单位

    江苏省公安厅

    江苏省通信管理局

    浙江省台州刑侦支队

    DEFCON GROUP 86025

    旗下站点

    邮箱系统

    应急响应中心

    红盟安全

    联系我们

    官方QQ群:112851260

    官方邮箱:security#ihonker.org(#改成@)

    官方核心成员

    Archiver|手机版|小黑屋| ( 苏ICP备2021031567号 )

    GMT+8, 2024-5-10 21:20 , Processed in 0.029011 second(s), 15 queries , Gzip On, MemCache On.

    Powered by ihonker.com

    Copyright © 2015-现在.

  • 返回顶部