Python
root@localhost
这个作者很懒,什么都没留下…
展开
-
Python 函数运行时间计时器
def timer(func): """ 函数运行时间计时器 :param func: function :return: as same as function(param)'s return """ from functools import wraps # 对函数的装饰器 # 使用@wraps时可以保证装饰器修饰的函数的name的值保持不变(适配多线程) @wraps(func) def decorator(*args, **.原创 2022-01-20 10:31:57 · 821 阅读 · 0 评论 -
Python+Scapy 实现ARP扫描并获取IP+MAC
环境:Python 3.x +scapydef ip_mac_scanner(hosts: str, local_mac: str, detail: bool = False): """ 网段IP&Mac ARP协议扫描器 :param hosts: 网段 e.g.‘*.*.*.*/*’ :param local_mac: 本地MAC地址,e.g.‘**-**-**-**-**-**’ :param detail: 是否显示详细信息 :ret..原创 2021-08-11 15:06:08 · 3523 阅读 · 0 评论