Python3 小工具-ARP扫描
from scapy.all import *
import optparse
import threading
import os
def scan(ipt):
pkt=Ether(dst='ff:ff:ff:ff:ff:ff')/ARP(pdst=ipt)
res=srp1(pkt,timeout=0.1,verbose=0)
if res:
print(ipt,' is online')
def main():
parser=optparse.OptionParser('%prog'+"-t <target> -f <filename>")
parser.add_option('-t',dest='target',type='string',help='Target')
parser.add_option('-f',dest='fil',type='string',help='File')
(options,args)=parser.parse_args()
target=options.target
fil=options.fil
if(target==None) and (fil==None):
print('Please input target(-t) or file(-f)')
exit(0)
if target:
iplist=target.split('.')
ip=iplist[0]+'.'+iplist[1]+'.'+iplist[2]+'.'
for t in range(1,255):
ipt=ip+str(t)
t=threading.Thread(target=scan,args=(ipt,))
t.start()
if fil:
if os.path.exists(fil):
with open(fil) as f:
for i in f.readlines():
ipt=i.strip('\n')
t=threading.Thread(target=scan,args=(ipt,))
t.start()
else:
print('File is not exists!')
exit(0)
if __name__=='__main__':
main()
使用说明
开始程序
github:https://github.com/zmqq/pytools/tree/master/arpscan
Python3 小工具-ARP扫描的更多相关文章
- Python3 小工具-ARP欺骗
在kali中使用 from scapy.all import * import optparse import os def send(pkt,interface): for p in pkt: se ...
- Python3 小工具-UDP扫描
from scapy.all import * import optparse import threading def scan(target,port): pkt=IP(dst=target)/U ...
- Python3 小工具-僵尸扫描
僵尸机的条件: 1.足够闲置,不与其他机器进行通讯 2.IPID必须是递增的,不然无法判断端口是否开放 本实验僵尸机选择的是Windows2003 from scapy.all import * im ...
- Python3 小工具-ICMP扫描
from scapy.all import * import optparse import threading import os def scan(ipt): pkt=IP(dst=ipt)/IC ...
- python3 小工具
扫描IP的端口是否开放:Porttest.py # -*- coding: utf-8 -*- import sys import os import socket #扫描 def scanport( ...
- ip地址查询python3小工具_V0.0.1
看到同事在一个一个IP地址的百度来确认导出表格中的ip地址所对应的现实世界的地址是否正确,决定给自己新开一个坑.做一个查询ip“地址”的python小工具,读取Excel表格,在表格中的后续列输出尽可 ...
- Python3 小工具-TCP半连接扫描
from scapy.all import * import optparse import threading def scan(ip,port): pkt=IP(dst=ip)/TCP(dport ...
- Python3 小工具-UDP发现
from scapy.all import * import optparse import threading import os def scan(ip): pkt=IP(dst=ip)/UDP( ...
- Python3 小工具-TCP发现
from scapy.all import * import optparse import threading import os def scan(ip): pkt=IP(dst=ip)/TCP( ...
随机推荐
- C++ ACM基础
一.C++结构体 #include <iostream> using namespace std; struct Point{ int x; int y; Point(int x=0,in ...
- SpringBoot使用maven插件打包時報:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException的處理方案
SpringBoot使用maven插件打包時報:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExec ...
- mysql碰到的问题总结
1.问题描述: 连接数据库出现大约10s延迟后才能连接,排除网络问题 解决方案: 通过抓包工具tcpdump抓包分析mysql在连接开始有近10s的空白请求,问题原因就在这 ,不知道在执行什么请求,后 ...
- 32位ubuntu16.04桌面版系统安装
1.下载并安装UltraISO软件安装之后插入U盘 2.然后打开软件点击文件打开找到下载的Ubuntu的ISO文件双击打开完成ISO文件的加载 3.点击启动选项(记得点开加载后的镜像,使之展开如图) ...
- 解决微信小程序安卓手机访问不到图片,无法显示图片
关于微信小程序不显示图片 通病可能有以下几个可能性: 非本地图片:确定图片资源存在,copy 图片url再浏览器打开,确定图片资源存在且能正常访问 本地图片:确定相对路径或者绝对路径正确 微信小程序图 ...
- 「PHP」简单工厂模式
引言 所属:创建型模式,常用设计模式之一 工厂模式分为:简单工厂模式.工厂方法模式.静态工厂模式.抽象工厂模式. 下面为简单工厂模式. 参考资料: <大话设计模式>程杰 模式概 ...
- MySQL数据库 : 函数和存储过程
CONCAT 可以把多个字符串连在一起,如把 doc_id 和 title这两个字段的查询结果组合成一个字符串:SELECT CONCAT(doc_id,title) FROM simhash; CO ...
- PHP的高效率写法
1.尽量静态化: 如果一个方法能被静态,那就声明它为静态的,速度可提高1/4,甚至我测试的时候,这个提高了近三倍. 当然了,这个测试方法需要在十万级以上次执行,效果才明显. 其实静态方法和非静态方法的 ...
- ajax重定向登录页
/** * ajax默认设置 * 包括默认提交方式为POST, * 判断后台是否是重定向 */ $.ajaxSetup( { //设置ajax请求结束后的执行动作 complete : functio ...
- C语言思维导图总结