10.子域名和后台扫描

一、子域名扫描

1、价值与分类

1、价值与分类

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

(2)分类:

---级域名:woniuxy.combaidu.comwoniuxy.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

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

相关推荐
安科士andxe2 小时前
深入解析|安科士1.25G CWDM SFP光模块核心技术,破解中长距离传输痛点
服务器·网络·5g
YJlio5 小时前
1.7 通过 Sysinternals Live 在线运行工具:不下载也能用的“云端工具箱”
c语言·网络·python·数码相机·ios·django·iphone
l1t5 小时前
在wsl的python 3.14.3容器中使用databend包
开发语言·数据库·python·databend
CTRA王大大5 小时前
【网络】FRP实战之frpc全套配置 - fnos飞牛os内网穿透(全网最通俗易懂)
网络
testpassportcn6 小时前
AWS DOP-C02 認證完整解析|AWS DevOps Engineer Professional 考試
网络·学习·改行学it
山塘小鱼儿7 小时前
本地Ollama+Agent+LangGraph+LangSmith运行
python·langchain·ollama·langgraph·langsimth
码说AI7 小时前
python快速绘制走势图对比曲线
开发语言·python
通信大师7 小时前
深度解析PCC策略计费控制:核心网产品与应用价值
运维·服务器·网络·5g
wait_luky7 小时前
python作业3
开发语言·python