10.子域名和后台扫描

一、子域名扫描

1、价值与分类

1、价值与分类

(1)价值:在进行入侵之前,通常会考虑将周边的主机或应用进行排查,进而从周边系统入手。通常情况下,主站的防御体系要更加完整,而周边站点则可能会存在更多薄弱环节。

(2)分类:

---级域名:woniuxy.com,baidu.com,woniuxy.cn

二级域名:www.woniuxy.com, mail.woniuxy.com

三级域名:mp.weixin.qq.com

通常情况下,一个子域名的命名相对是规范的,mail.woniuxy.com,而密码完全因人而异。

2、使用Ping命令

使用Ping命令可以获取域名对应的IP地址,则可以使用Ping命令来进行判断。

复制代码
C:\Users\22141>ping www.baidu.com

正在 Ping www.a.shifen.com [2409:8c54:870:187:0:ff:b0d9:bb1c] 具有 32 字节的数据:
来自 2409:8c54:870:187:0:ff:b0d9:bb1c 的回复: 时间=39ms
来自 2409:8c54:870:187:0:ff:b0d9:bb1c 的回复: 时间=39ms
来自 2409:8c54:870:187:0:ff:b0d9:bb1c 的回复: 时间=41ms
来自 2409:8c54:870:187:0:ff:b0d9:bb1c 的回复: 时间=36ms

2409:8c54:870:187:0:ff:b0d9:bb1c 的 Ping 统计信息:
    数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
    最短 = 36ms,最长 = 41ms,平均 = 38ms

另外,在Windows和Linux上,Ping命令的参数不太一样,所以如果扫描脚本运行于不同平台,需要做不同的参数处理

复制代码
Ping的次数:windows:ping -n 1, Linux: ping -c 1
超时时间:windows:ping -w 1,Linux: ping -W 1

3、使用socket库

python 复制代码
# 基于ping命令的子域名扫描
def ping_domain():
    with open('../dict/dic_domain.txt') as file:
        domain_list = file.readlines()
    for domain in domain_list:
        result = os.popen(f'ping -n 1 -w 1000 {domain.strip()}.baidu.com').read()
        # print(result)
        # if '请求超时' in result or 'TTL=' in result:
        #     print(f"{domain.strip()}.baidu.com")

        if '找不到主机' not in result:
            print(f"{domain.strip()}.baidu.com")
python 复制代码
# 基于socket库的DNS解析功能实现扫描
def socket_domain():
    with open('../dict/dic_domain.txt') as file:
        domain_list = file.readlines()
    for domain in domain_list:
        try:
            ip = socket.gethostbyname(f'{domain.strip()}.baidu.com')
            print(f'{domain.strip()}.baidu.com,{ip}')
        except socket.gaierror:
            pass

4、Windows工具:Layer子域挖掘机

5、Kali工具:dnsenum

复制代码
dnsenum -f /usr/share/dnsenum/dns.txt baidu.com

6、在线工具

在线子域名扫描-YoungxjTools

二、后台扫描

扫描一个网站的后台地址:通常不包含在页面的超链接中,或者无法通过爬虫获取到的一些隐藏的页面地址。

三、Web站点信息采集

1、Kali工具

复制代码
whatweb woniuxy.com

2、whois信息

查询某个域名的注册信息

3、python-whois库

复制代码
pip install python-whois
python 复制代码
# 查询域名的whois信息
def whois_info():
    from whois import whois
    import json
    result = whois('woniuxy.com')
    # print(result)
    dict = json.loads(str(result))
    print(dict)
    print(dict['domain_name'])

4、nslookup

用于确认域名是否使用了CDN网络,nslookup aliyun.com

5、fofa.so

可用于端口和服务信息搜集,其好处是不用nmap那样直接扫描,而是根本不存在扫描行为。

已经无法访问:

6、shodan.io

可以搜索一切联网的设备,如摄像头、工控设备、路由器、打印机、物联网设备等。

相关推荐
老唐7772 分钟前
Transformer原理大白话讲解
人工智能·python·深度学习·神经网络·计算机视觉·ai·transformer
对讲机数码科普4 分钟前
业余无线电野外中继寒地故障排查|东北林区 VHF/UHF 台站四季射频环境适配方案
运维·网络
黄焖鸡能干四碗5 分钟前
大数据平台安全防护策略方案(PPT)
大数据·运维·网络·安全·web安全·制造
佳木逢钺6 分钟前
从火灾模拟到系统热寂:一个双非运维如何用零 GPU 推导出多智能体系统的终极死锁
人工智能·python·算法·多智能体
fwc18 分钟前
第T9周:猫狗识别2
python·深度学习
Likeadust19 分钟前
门店客流少、曝光弱?视频直播点播EasyDSS音视频平台解锁门店线上拓客新模式
网络·音视频·easydss
砚底藏山河19 分钟前
数据新鲜度 SLA 监控
java·大数据·python·maven
Wzx19801224 分钟前
Python Agent 短期记忆设计:从对话历史到 LangGraph Checkpointer
开发语言·python
szuaudi31 分钟前
K8s 节点假死故障排查过程复盘
网络·容器·kubernetes