Skip to content

Commit

Permalink
Fix inet.py bugs (#4435)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpotter2 committed Jun 22, 2024
1 parent 2fdffe2 commit 039d10e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
9 changes: 7 additions & 2 deletions scapy/asn1/mib.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,10 @@ def load_mib(filenames):
"1.3.6.1.5.5.7.48.1.1": "basic-response"
}

certTransp_oids = {
'1.3.6.1.4.1.11129.2.4.2': "SignedCertificateTimestampList",
}

# ansi-x962 #

x962KeyType_oids = {
Expand Down Expand Up @@ -669,11 +673,12 @@ def load_mib(filenames):
attributeType_oids,
certificateExtension_oids,
certExt_oids,
certPkixAd_oids,
certPkixKp_oids,
certPkixPe_oids,
certPkixQt_oids,
certPkixKp_oids,
certPkixAd_oids,
certPolicy_oids,
certTransp_oids,
evPolicy_oids,
x962KeyType_oids,
x962Signature_oids,
Expand Down
5 changes: 3 additions & 2 deletions scapy/layers/l2.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,7 @@ def arp_mitm(
$ sysctl net.ipv4.conf.virbr0.send_redirects=0 # virbr0 = interface
$ sysctl net.ipv4.ip_forward=1
$ sudo iptables -t mangle -A PREROUTING -j TTL --ttl-inc 1
$ sudo scapy
>>> arp_mitm("192.168.122.156", "192.168.122.17")
Expand Down Expand Up @@ -986,15 +987,15 @@ def _tups(ip, mac):
for ipa, maca in tup1
for ipb, macb in tup2
for x in
Ether(dst=maca, src=macb) /
Ether(dst="ff:ff:ff:ff:ff:ff", src=macb) /
ARP(op="who-has", psrc=ipb, pdst=ipa,
hwsrc=macb, hwdst="00:00:00:00:00:00")
),
(x
for ipb, macb in tup2
for ipa, maca in tup1
for x in
Ether(dst=macb, src=maca) /
Ether(dst="ff:ff:ff:ff:ff:ff", src=maca) /
ARP(op="who-has", psrc=ipa, pdst=ipb,
hwsrc=maca, hwdst="00:00:00:00:00:00")
),
Expand Down
4 changes: 2 additions & 2 deletions test/scapy/layers/l2.uts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ def srploop_spoof(x, *args, **kwargs):

def sendp_spoof(x, *args, **kwargs):
assert len(x) == 2
assert x[0].dst == "cc:cc:cc:cc:cc:cc"
assert x[0].dst == "ff:ff:ff:ff:ff:ff"
assert x[0].src == x[0].hwsrc == "bb:bb:bb:bb:bb:bb"
assert x[0].hwdst == "00:00:00:00:00:00"
assert x[0].psrc == "192.168.0.2"
assert x[0].pdst == "192.168.0.1"
assert x[1].dst == "bb:bb:bb:bb:bb:bb"
assert x[1].dst == "ff:ff:ff:ff:ff:ff"
assert x[1].src == x[1].hwsrc == "cc:cc:cc:cc:cc:cc"
assert x[1].hwdst == "00:00:00:00:00:00"
assert x[1].psrc == "192.168.0.1"
Expand Down

0 comments on commit 039d10e

Please sign in to comment.