web安全学习笔记(1)

信息搜集

  1. whois信息

    • 在线网站
    • kali下whois
  2. 备案信息

    • 在线网站
  3. cms指纹识别

  4. web敏感目录探测工具

    • 御剑
    • wwwscan
    • dirb命令行工具
    • dirbuster
  5. 端口信息

    • windows下netstat
    • kali中使用masscannmap(单独挑出来学语法)
    • 在线网站(e.g.站长之家)
    • 攻击方法:不同端口不同攻击方式,使用baidu
  6. 敏感信息

    • Google hacking
    1
    2
    3
    4
    5
    6
    7
    8
    site:
    inurl:
    intext:
    filetype(ext):
    intitle:
    link:网页链接
    info:网页信息
    e.g. inurl:?id= ext:jsp "hello" (password|username|hello)
    • HTTP响应

      • 浏览器审计工具、bp
      • python requests
    • GitHub

      1
      2
      3
      4
      5
      *** 代指 github
      site:*** smtp | *** smtp@qq.com
      site:*** sa password | root password | User ID='sa';Password
      site:*** svn | svn username
      site:*** password | ftp ftppassword | 密码 | 内部
  7. 真实ip<可扩展>

    • 判断是否存在cdn(内容分发网络)

      1
      2
      * 自己ping
      * 使用在线网站 各地ping、全球ping

      如果IP地址不同则存在cdn

    • 绕过cdn

      1
      2
      3
      4
      5
      * 内部邮箱源 收集到内部邮箱服务器IP地址
      * 网站phpinfo文件 phpinfo.php
      * 分站IP地址,查询子域名 CDN很贵,有可能分站不用CDN
      * 国外访问 https://asm.ca.com/en/ping.php
      * 查询域名解析记录 https://viewdns.com
    • 利用IP地址对web地址访问,能访问则为真

Shodan

  1. 语法和实战

    • webcam
    • port:22
    • ip:
    • city:hangzhou
  2. 命令行安装

    • easyinstall 安装shodan

    • 初始化shodan

      1
      shodan init 你在官网上的激活码(挺长的~)
    • 启动并查找具体服务

      1
      2
      3
      shodan count apache
      shodan count tomcat
      shodan search microsoft iis 6.0
    • 获取指定IP地址信息

      1
      shodan host ip
    • 获取自己账号信息&自身ip(鸡肋?应该有不同应用场景)

      1
      2
      shodan info 
      shodan myip
    • 检查是否有蜜罐

      1
      shodan honeyscore ip
  3. python-shodan

    • 我们使用ipython,初始化api_key
    1
    2
    3
    import shodan 
    SHODAN_API_KEY = "your api key"
    api = shodan.Shodan(SHODAN_API_KEY)
    • python-shodan search方法
    1
    2
    3
    result = api.search("apache")
    print(result['total'])
    # 具体查看https://developer/shodan.io/api
    • 查询
    1
    2
    result = api.host("59.110.244.199")
    print(result['country_name'])
    • 查询脚本编写<待扩展>

Git信息泄露

  1. 原理:
    • .git文件夹下文件,还原重建工程源代码
    • 解析.git/index文件,找到工程中所有的:(文件名,文件sha1)
    • 去.git/objects/文件夹下下载对应文件
    • zlib解压文件,按原始目录结构写入源代码(好好学git)
  1. 信息泄露利用
    • githack(lijiejie)

本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!