IPv6 Scapy Samples
IPv6 ICMP
icmp ipv6 request i=IPv6()
i.dst="2001:db8:dead::1"
q=ICMPv6EchoRequest()
p=(i/q)
sr1(p)
ipv6 source route packets
i=IPv6()
i.dst="2001:db8:dead::1"
h=IPv6ExtHdrRouting()
h.addresses=["2001:db8:dead::1","2001:db8:dead::1","2001:db8:dead::1"]
p=ICMPv6EchoRequest()
pa=(i/h/p)
Routing Header Example
a = sr1(IPv6(dst="2001:4f8:4:7:2e0:81ff:fe52:9a6b")/ \
IPv6ExtHdrRouting(addresses=["2001:78:1:32::1", "2001:20:82:203:fea5:385"])/ \
ICMPv6EchoRequest(data=RandString(7)), verbose=0)
a.src
Traceroute
waypoint = "2001:301:0:8002:203:47ff:fea5:3085"
target = "2001:5f9:4:7:2e0:81ff:fe52:9a6b"
traceroute6(waypoint, minttl=15 ,maxttl=34,l4=IPv6ExtHdrRouting(addresses=[target])/ICMPv6EchoRequest(data=RandString(7)))
Current high score (not tested)
addr1 = "2001:4830:ff:12ea::2"
addr2 = "2001:360:1:10::2"
zz=time.time();
a=sr1(IPv6(dst=addr2, hlim=255)/IPv6ExtHdrRouting(addresses=[addr1, addr2]*43)/ICMPv6EchoRequest(data="staythere"), verbose=0, timeout=80);
print "%.2f seconds" % (time.time() - zz)
ipv6 NA (version 1)
sendp(Ether()/IPv6()/ICMPv6ND_RA()/ ICMPv6NDOptPrefixInfo(prefix="2001:db8:cafe:deca::", prefixlen=64)/ ICMPv6NDOptSrcLLAddr(lladdr="00:b0:de:ad:be:ef"), loop=1, inter=3)
ipv6 NA (version 2)
a=IPv6(nh=58, src='fe80::214:f2ff:fe07:af0', dst='ff02::1', version=6L, hlim=255, plen=64, fl=0L, tc=224L)
b=ICMPv6ND_RA(code=0, chlim=64, H=0L, M=0L, O=0L, routerlifetime=1800, P=0L, retranstimer=0, prf=0L, res=0L, reachabletime=0, type=134)
c=ICMPv6NDOptSrcLLAddr(type=1, len=1, lladdr='00:14:f2:07:0a:f1')
d=ICMPv6NDOptMTU(res=0, type=5, len=1, mtu=1500)
e=ICMPv6NDOptPrefixInfo(A=1L, res2=0, res1=0L, L=1L, len=4, prefix='2001:db99:dead::', R=0L, validlifetime=2592000, prefixlen=64, preferredlifetime=604800, type=3)
send(a/b/c/d/e)
The one line Router Advertisement daemon killer
send(IPv6(src=server)/ICMPv6ND_RA(routerlifetime=0), loop=1, inter=1)
Test1
someaddr=["2001:6c8:6:4::7", "2001:500::1035", "2001:1ba0:0:4::1",
"2001:2f0:104:1:2e0:18ff:fea8:16f5", "2001:e40:100:207::2",
"2001:7f8:2:1::18", "2001:4f8:0:2::e", "2001:4f8:0:2::d"] for addr in someaddr:
a = sr1(IPv6(dst=addr)/ICMPv6NIQueryName(data=addr), verbose=0)
print a.sprintf( "%-35s,src%: %data%")
Test2
someaddr=["2001:6c8:6:4::7", "2001:500::1035", "2001:1ba0:0:4::1",
"2001:2f0:104:1:2e0:18ff:fea8:16f5", "2001:e40:100:207::2",
"2001:7f8:2:1::18", "2001:4f8:0:2::e", "2001:4f8:0:2::d"] for addr in someaddr:
a = sr1(IPv6(dst="ff02::1")/ICMPv6NIQueryName(data="ff02::1"))
print a.sprintf( "%data%") IPv6 Scapy 3 Way
Creating a IPv6 3 Way Handshake Step 1.
trun off the RST Packets from the Kernel, because no listen Port on the Source Port. (Scapy is not unsing RAW Socket)
iptables -A OUTPUT -p tcp --tcp-flags RST RST -d {dest IP} -j DROP
Step 2.
Send th SYN Packet with scapy and fetch the answer.
ip=IPv6(dst="2001:db8:0:1:207:3fff:fe68:df44")
TCP_SYN=TCP(sport=1500, dport=80, flags="S", seq=100)
TCP_SYNACK=sr1(ip/TCP_SYN)
Step 3.
Send the ACK Packet with scapy
my_ack = TCP_SYNACK.seq + 1
TCP_ACK=TCP(sport=1500, dport=80, flags="A", seq=101, ack=my_ack)
send(ip/TCP_ACK)
Step 4.
Check the client with netstat -na
IPv6 Scapy Samples的更多相关文章
- python脚本执行Scapy出现IPv6警告WARNING解决办法
安装完scapy,写了脚本执行后执行: WARNING: No route found for IPv6 destination :: (no default route?) 原因是用 from sc ...
- scapy IPv6 NS NA报文构造
NS 报文构造: #! /bin/python from scapy.all import * a=IPv6(src='2a01:4f8:161:5300::40', dst='ff02::1:ff0 ...
- 小白日记9:kali渗透测试之主动信息收集(二)四层发现:TCP、UDP、nmap、hping、scapy
四层发现 四层发现的目的是扫描出可能存活的IP地址,四层发现虽然涉及端口扫描,但是并不对端口的状态进行精确判断,其本质是利用四层协议的一些通信来识别主机ip是否存在. 四层发现的优点: 1.可路由且结 ...
- 小白日记7:kali渗透测试之主动信息收集-发现(一)--二层发现:arping/shell脚本,Netdiscover,scapy
主动信息收集 被动信息收集可能不准确,可以用主动信息收集验证 特点:直接与目标系统交互通信,无法避免留下访问痕迹 解决方法:1.使用受控的第三方电脑进行探测,使用代理 (做好被封杀的准备) 2 ...
- 小白日记8:kali渗透测试之主动信息收集(二)三层发现:ping、traceroute、scapy、nmap、fping、Hping
三层发现 三层协议有:IP以及ICMP协议(internet管理协议).icmp的作用是用来实现intenet管理的,进行路径的发现,网路通信情况,或者目标主机的状态:在三层发现中主要使用icmp协议 ...
- python自动化运维三:数据报表定制以及scapy模块介绍
p { margin-bottom: 0.25cm; line-height: 120% } a:link { } Excel也是报表的一个重要的工具.这里首先接受下excel的操作.先来看一个简单的 ...
- 从Linux内核角度看中间人攻击(ARP欺骗)并利用Python scapy实现
邻居子系统与ARP协议 邻居子系统的作用就是将IP地址,转换为MAC地址,类似操作系统中的MMU(内存管理单元),将虚拟地址,转换为物理地址. 其中邻居子系统相当于地址解析协议(IPv4的ARP协议, ...
- scapy学习笔记(2)--包及包的定义
转载请注明:@小五义:http://www.cnblogs/xiaowuyi 一.包 包(Packet)是TCP/IP协议通信传输中的数据单位,一般也称“数据包”.其主要由“目的IP地址”.“源IP地 ...
- scapy学习笔记(1)
转载请注明:小五义 http://www.cnblogs.com/xiaowuyi scapy是python写的一个功能强大的交互式数据包处理程序,可用来发送.嗅探.解析和伪造网络数据包,常常被用到网 ...
随机推荐
- Java 架构师
“学习的最好途径就是看书“,这是我自己学习并且小有了一定的积累之后的第一体会.个人认为看书有两点好处: 1.能出版出来的书一定是经过反复的思考.雕琢和审核的,因此从专业性的角度来说,一本好书的价值远超 ...
- How to set an Apache Kafka multi node – multi broker cluster【z】
Set a multi node Apache ZooKeeper cluster On every node of the cluster add the following lines to th ...
- 761A Dasha and Stairs
A. Dasha and Stairs time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- mysql 导入导出摘要
1.导入by数据文件. mysql>load data infile '文件路径' into table 表名 fields terminated by '字段分隔符' lines termin ...
- 661. Image Smoother
static int wing=[]() { std::ios::sync_with_stdio(false); cin.tie(NULL); ; }(); class Solution { publ ...
- 2018.07.04 POJ 1265 Area(计算几何)
Area Time Limit: 1000MS Memory Limit: 10000K Description Being well known for its highly innovative ...
- Linux服务器部署系列之六—远程管理篇
做为网络管理员,我们不可能总是在机房操作服务器,对于windows服务器,我们可以通过远程终端或netmeeting进行操作.但是对于Linux服务器呢?我们也可以使用远程工具进行操作,常用的远程管理 ...
- cxf-rs 和 swagger 的点
1. 从web.xml 说起 <servlet> <servlet-name>CXFServlet</servlet-name> <servlet-class ...
- MVC 图片上传(转)
转自:http://www.cnblogs.com/Tiramisu/archive/2009/02/06/1385405.html MVC 上传图片 直接上代码: 页面:Index.aspx C ...
- (最小生成树) 畅通工程再续 -- HDU --1875
链接: http://acm.hdu.edu.cn/showproblem.php?pid=1875 http://acm.hust.edu.cn/vjudge/contest/view.action ...