get_active_ips.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:LinuxDrop 作者: Livin21 项目源码 文件源码
def get():
    print("Fetching list of available planets...")
    interface = get_interface_name()
    this_device_ip = ni.ifaddresses(interface)[ni.AF_INET][0]['addr']
    p2 = subprocess.Popen(["nmap", "-sP", this_device_ip + "/24"], stdout=subprocess.PIPE)
    res = p2.communicate()
    arr = ''.join(map(str, res)).replace("\n", " ").replace("(", "").replace(")", "").split(" ")
    ip_arr = []
    print("Locking on target beam...")
    for i in arr:
        print(".", end="")
        if re.match(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$", i):
            ip_arr.append(i)

    correct_ips = find_correct_ips(ip_arr)
    return correct_ips
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号