python局域網(wǎng)ip掃描示例分享
#!/usr/bin/python
# -*- coding: utf-8 -*-
from scapy.all import *
from time import ctime,sleep
import threading
TIMEOUT = 4
conf.verb=0
def pro(cc,handle):
dst = "192.168.1." + str(cc)
packet = IP(dst=dst, ttl=20)/ICMP()
reply = sr1(packet, timeout=TIMEOUT)
if not (reply is None):
handle.write(reply.src+" is online"+"\n")
#print reply.src, "is online"
def main():
threads=[]
f=open('ip.log','a')
for i in range(2,254):
t=threading.Thread(target=pro,args=(i,f))
threads.append(t)
print "main Thread begins at ",ctime()
for t in threads :
t.start()
for t in threads :
t.join()
print "main Thread ends at ",ctime()
if __name__=="__main__" :
main();
- 十行代碼使用Python寫一個USB病毒
- Python實現(xiàn)掃描局域網(wǎng)活動ip(掃描在線電腦)
- Python實現(xiàn)的多線程端口掃描工具分享
- python基礎教程之udp端口掃描
- Python腳本實現(xiàn)Web漏洞掃描工具
- Python掃描IP段查看指定端口是否開放的方法
- Python端口掃描簡單程序
- python多線程掃描端口示例
- 實例探究Python以并發(fā)方式編寫高性能端口掃描器的方法
- python實現(xiàn)上傳樣本到virustotal并查詢掃描信息的方法
- Python實現(xiàn)簡易端口掃描器代碼實例
- python實現(xiàn)集中式的病毒掃描功能詳解
相關文章
pandas實現(xiàn)手機號號碼中間4位匿名化的示例代碼
本文主要介紹了pandas實現(xiàn)手機號號碼中間4位匿名化的示例代碼,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2022-08-08Python Paramiko模塊中exec_command()和invoke_shell()兩種操作區(qū)別
invoke_shell 使用 SSH shell channel,而 exec_command 使用 SSH exec channel,本文主要介紹了Python Paramiko模塊中exec_command()和invoke_shell()兩種操作區(qū)別,具有一定的參考價值,感興趣的可以了解一下2024-02-02Django自定義全局403、404、500錯誤頁面的示例代碼
這篇文章主要介紹了Django自定義全局403、404、500錯誤頁面的示例代碼,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2020-03-03