-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ℹ️ minor updates 🔅 added internal.functions.py ℹ️ updated GHA cache with id ℹ️ updated test.pcapng 🔅 changed how pcaps are loaded ✅ pcap_http_streams method added
- Loading branch information
1 parent
2bb40d6
commit 4bf0fba
Showing
8 changed files
with
138 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import scapy.all as scapy | ||
|
||
|
||
def full_duplex(p): # pragma: no cover | ||
"""Create a full duplex stream from packets | ||
`Reference <https://gist.github.com/MarkBaggett/d8933453f431c111169158ce7f4e2222>`__ | ||
""" | ||
sess = "Other" | ||
if "Ether" in p: | ||
if "IP" in p: | ||
if "TCP" in p: | ||
sess = str( | ||
sorted( | ||
[ | ||
"TCP", | ||
p[scapy.IP].src, | ||
p[scapy.TCP].sport, | ||
p[scapy.IP].dst, | ||
p[scapy.TCP].dport, | ||
], | ||
key=str, | ||
) | ||
) | ||
elif "UDP" in p: | ||
sess = str( | ||
sorted( | ||
[ | ||
"UDP", | ||
p[scapy.IP].src, | ||
p[scapy.UDP].sport, | ||
p[scapy.IP].dst, | ||
p[scapy.UDP].dport, | ||
], | ||
key=str, | ||
) | ||
) | ||
elif "ICMP" in p: | ||
sess = str( | ||
sorted( | ||
[ | ||
"ICMP", | ||
p[scapy.IP].src, | ||
p[scapy.IP].dst, | ||
p[scapy.ICMP].code, | ||
p[scapy.ICMP].type, | ||
p[scapy.ICMP].id, | ||
], | ||
key=str, | ||
) | ||
) | ||
else: | ||
sess = str( | ||
sorted( | ||
["IP", p[scapy.IP].src, p[scapy.IP].dst, p[scapy.IP].proto], | ||
key=str, | ||
) | ||
) | ||
elif "ARP" in p: | ||
sess = str(sorted(["ARP", p[scapy.ARP].psrc, p[scapy.ARP].pdst], key=str)) | ||
# else: | ||
# sess = p.sprintf("Ethernet type=%04xr,Ether.type%") | ||
return sess |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters