mirror of
https://github.com/ivre/masscanned.git
synced 2025-10-02 14:48:22 +00:00
Add pytohn tests for empty payload (TCP/UDP)
This commit is contained in:
parent
2ebeefb730
commit
bf1a2c7429
3 changed files with 70 additions and 0 deletions
|
@ -24,6 +24,27 @@ from scapy.volatile import RandInt
|
|||
from ..conf import IPV4_ADDR, IPV6_ADDR, MAC_ADDR
|
||||
from ..core import test, check_ip_checksum, check_ipv6_checksum
|
||||
|
||||
@test
|
||||
def test_ipv4_tcp_empty():
|
||||
for p in [0, 80, 443]:
|
||||
req = (
|
||||
Ether(dst=MAC_ADDR)
|
||||
/ IP(dst=IPV4_ADDR, proto=6) # UDP
|
||||
/ Raw()
|
||||
)
|
||||
repl = srp1(req, timeout=1)
|
||||
assert repl is None, "expecting no answer, got one"
|
||||
|
||||
@test
|
||||
def test_ipv6_tcp_empty():
|
||||
for p in [0, 80, 443]:
|
||||
req = (
|
||||
Ether(dst=MAC_ADDR)
|
||||
/ IPv6(dst=IPV6_ADDR, nh=6) # UDP
|
||||
/ Raw()
|
||||
)
|
||||
repl = srp1(req, timeout=1)
|
||||
assert repl is None, "expecting no answer, got one"
|
||||
|
||||
@test
|
||||
def test_tcp_syn():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue