from scapy.all import *
import optparse
import threading

def scan(target,port):
    pkt=IP(dst=target)/UDP(dport=int(port))
    res=sr1(pkt,timeout=0.1,verbose=0)
    if res==None:
        print(port,' is online')

def main():
    parser=optparse.OptionParser("%prog"+"-t <target> -p <port>")
    parser.add_option('-t',dest='target',type='string',help='Target')
    parser.add_option('-p',dest='port',type='string',help='Port(split with \',\')')
    (options,args)=parser.parse_args()
    target=options.target
    ports=str(options.port).split(',')
    if(target==None) or (ports[0]==None):
        print('Please input target(-t) and port(-p)!')
        exit(0)
    for port in ports:
        t=threading.Thread(target=scan,args=(target,port))
        t.start()

if __name__=='__main__':
    main()

使用说明

程序开始

github:https://github.com/zmqq/pytools/tree/master/udpscan

Python3 小工具-UDP扫描的更多相关文章

  1. Python3 小工具-UDP发现

    from scapy.all import * import optparse import threading import os def scan(ip): pkt=IP(dst=ip)/UDP( ...

  2. Python3 小工具-僵尸扫描

    僵尸机的条件: 1.足够闲置,不与其他机器进行通讯 2.IPID必须是递增的,不然无法判断端口是否开放 本实验僵尸机选择的是Windows2003 from scapy.all import * im ...

  3. Python3 小工具-ICMP扫描

    from scapy.all import * import optparse import threading import os def scan(ipt): pkt=IP(dst=ipt)/IC ...

  4. Python3 小工具-ARP扫描

    from scapy.all import * import optparse import threading import os def scan(ipt): pkt=Ether(dst='ff: ...

  5. python3 小工具

    扫描IP的端口是否开放:Porttest.py # -*- coding: utf-8 -*- import sys import os import socket #扫描 def scanport( ...

  6. ip地址查询python3小工具_V0.0.1

    看到同事在一个一个IP地址的百度来确认导出表格中的ip地址所对应的现实世界的地址是否正确,决定给自己新开一个坑.做一个查询ip“地址”的python小工具,读取Excel表格,在表格中的后续列输出尽可 ...

  7. Python3 小工具-TCP半连接扫描

    from scapy.all import * import optparse import threading def scan(ip,port): pkt=IP(dst=ip)/TCP(dport ...

  8. Python3 小工具-TCP发现

    from scapy.all import * import optparse import threading import os def scan(ip): pkt=IP(dst=ip)/TCP( ...

  9. Python3 小工具-MAC泛洪

    from scapy.all import * import optparse def attack(interface): pkt=Ether(src=RandMAC(),dst=RandMAC() ...

随机推荐

  1. Haroopad 中文不显示

    https://blog.csdn.net/zgf19930504/article/details/51508111 1. 选择文件--> 偏好设置 2. 选择 编辑器--> 编辑--&g ...

  2. 关于从Oracle数据库中删除表数据

    1,删除表 drop 1.1 执行drop table table_name  语句 被 drop后的表被放在用户回收站(user_recyclebin)里,而没有被直接删除掉,回收站里的表可以被恢复 ...

  3. java web中对json的使用

    一.在Java Web的开发过程中,如果希望调用Java对象转化成JSON对象等操作.则需要引入以下jar包,不然运行时则报错. 1.commons-beanutils.jar 2.commons-c ...

  4. DB数据源之SpringBoot+MyBatis踏坑过程(五)手动使用Hikari连接池

    DB数据源之SpringBoot+MyBatis踏坑过程(五)手动使用Hikari连接池 liuyuhang原创,未经允许禁止转载  系列目录连接 DB数据源之SpringBoot+Mybatis踏坑 ...

  5. 『ACM C++』 PTA 天梯赛练习集L1 | 042-43

    记录刷题情况 ------------------------------------------------L1-042--------------------------------------- ...

  6. Mint-UI 的 DatetimePicker 日期时间插件的安装与使用

    简介:Mint-UI是饿了么出品的基于vue的移动端组件库(element-ui是桌面端) 官网:http://mint-ui.github.io/docs/#/zh-cn2 项目环境:vue-cli ...

  7. UEditor显示Invalid or unexpected token

    原文链接http://www.qqdeveloper.com/a/53.html 问题背景    数据修改操作,需要做一个数据内容回显,该内容中包含代码.图片.普通文本等等内容,反正就是各种内容. 当 ...

  8. 小心使用replicate_do_db和replicate_ignore_db

    内容来源于网络 使用replicate_do_db和replicate_ignore_db时有一个隐患,跨库更新时会出错 如设置 replicate_do_db=testuse mysql;updat ...

  9. PHP基础1--环境搭建

    主要: 环境搭建 站点配置 环境搭建 web运行流程: 1. 浏览器输入地址,回车(发送请求) 2. 根据规则找到对应web服务器.规则如下: 首先在本机hosts文件中找对应IP hosts位置: ...

  10. 使用 win10 的库来组织自己的同类文件

    库相当于虚拟目录,可以把不同的文件夹包含起来. 找起东西来不用东奔西跑了...