Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

applayer: add test for dcerpc req http resp #2127

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tests/dcerpc-request-http-response/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Test Description

This test is a conversion of an applayer unittest that comprised of a dcerpc
request followed by an HTTP response.

## PCAP

PCAP was created with the Scapy script checked in.

## Related issues

None
Binary file added tests/dcerpc-request-http-response/input.pcap
Binary file not shown.
12 changes: 12 additions & 0 deletions tests/dcerpc-request-http-response/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
args:
- -k none
- --set stream.midstream=true

checks:
- filter:
count: 1
match:
event_type: flow
app_proto: dcerpc
inashivb marked this conversation as resolved.
Show resolved Hide resolved
tcp.psh: true
tcp.ack: true
14 changes: 14 additions & 0 deletions tests/dcerpc-request-http-response/writepcap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python
from scapy.all import *

pkts = []

load_layer("http")
pkts += Ether(dst='ff:ff:ff:ff:ff:ff', src='00:01:02:03:04:05')/ \
IP(dst='1.2.3.4', src='5.6.7.8')/TCP(sport=6666, dport=63, flags='P''A')/DceRpc()
pkts += Ether(dst='ff:ff:ff:ff:ff:ff', src='00:01:02:03:04:05')/ \
IP(dst='5.6.7.8', src='1.2.3.4')/TCP(sport=63, dport=6666, flags='P''A')/HTTP()/HTTPResponse(Http_Version='HTTP/1.0', Status_Code='200', Reason_Phrase='OK', Content_Type='text/html', Content_Length=7)
pkts += Ether(dst='ff:ff:ff:ff:ff:ff', src='00:01:02:03:04:05')/ \
IP(dst='1.2.3.4', src='5.6.7.8')/TCP(sport=6666, dport=63, flags='A')

wrpcap('input.pcap', pkts)
Loading