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

Multipart mime 3487 v3 #1377

Closed
wants to merge 2 commits into from
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
Binary file modified tests/bug-6207-1/input.pcap
Binary file not shown.
1 change: 0 additions & 1 deletion tests/bug-6207-1/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ checks:
match:
app_proto: smtp
email.attachment[0]: smtptest-2021-02-25T13-54-22Z-aefb2fc1308d62f4b6c74769f69b13ddf80e995fd98ae442f3be499ea928c67f..zip
email.status: BODY_END_BOUND
event_type: fileinfo
fileinfo.filename: smtptest-2021-02-25T13-54-22Z-aefb2fc1308d62f4b6c74769f69b13ddf80e995fd98ae442f3be499ea928c67f..zip
fileinfo.size: 286
Expand Down
Binary file modified tests/bug-6207-2/input.pcap
Binary file not shown.
11 changes: 11 additions & 0 deletions tests/mime/mime-dec-parse-full-msg-test01/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Test Description

Test some mimre processing

## PCAP

Previous unit test for MIME in Suricata

## Related issues

https://redmine.openinfosecfoundation.org/issues/3487
Binary file not shown.
48 changes: 48 additions & 0 deletions tests/mime/mime-dec-parse-full-msg-test01/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# *** Add configuration here ***

Comment on lines +1 to +2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually ask folks to remove this. :P

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

Why is it not removed automatically ?

Copy link
Contributor

@jufajardini jufajardini Sep 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine that that is so people have a hint that test.yaml can be used for some configuration settings, too?

args:
- -k none

checks:
- filter:
count: 1
match:
anomaly.app_proto: smtp
anomaly.event: APPLAYER_DETECT_PROTOCOL_ONLY_ONE_DIRECTION
anomaly.layer: proto_detect
anomaly.type: applayer
dest_ip: 127.0.0.1
dest_port: 39202
event_type: anomaly
pcap_cnt: 6
proto: TCP
src_ip: 127.0.0.1
src_port: 25
- filter:
count: 1
match:
dest_ip: 127.0.0.1
dest_port: 25
email.from: toto <[email protected]>
email.status: PARSE_DONE
email.to[0]: 172.16.92.2@linuxbox
event_type: smtp
pcap_cnt: 14
proto: TCP
smtp.helo: linuxbox
smtp.mail_from: <[email protected]>
smtp.rcpt_to[0]: <172.16.92.2@linuxbox>
src_ip: 127.0.0.1
src_port: 39202
tx_id: 0
- filter:
count: 1
match:
dest_ip: 127.0.0.1
dest_port: 25
event_type: smtp
proto: TCP
smtp.helo: linuxbox
src_ip: 127.0.0.1
src_port: 39202
tx_id: 1
11 changes: 11 additions & 0 deletions tests/mime/mime-dec-parse-full-msg-test02/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Test Description

Test some mimre processing

## PCAP

Previous unit test for MIME in Suricata

## Related issues

https://redmine.openinfosecfoundation.org/issues/3487
Binary file not shown.
48 changes: 48 additions & 0 deletions tests/mime/mime-dec-parse-full-msg-test02/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# *** Add configuration here ***

args:
- -k none

checks:
- filter:
count: 1
match:
anomaly.app_proto: smtp
anomaly.event: APPLAYER_DETECT_PROTOCOL_ONLY_ONE_DIRECTION
anomaly.layer: proto_detect
anomaly.type: applayer
dest_ip: 127.0.0.1
dest_port: 39202
event_type: anomaly
pcap_cnt: 6
proto: TCP
src_ip: 127.0.0.1
src_port: 25
- filter:
count: 1
match:
dest_ip: 127.0.0.1
dest_port: 25
email.from: toto <[email protected]>
email.status: PARSE_DONE
email.to[0]: 172.16.92.2@linuxbox
event_type: smtp
pcap_cnt: 14
proto: TCP
smtp.helo: linuxbox
smtp.mail_from: <[email protected]>
smtp.rcpt_to[0]: <172.16.92.2@linuxbox>
src_ip: 127.0.0.1
src_port: 39202
tx_id: 0
- filter:
count: 1
match:
dest_ip: 127.0.0.1
dest_port: 25
event_type: smtp
proto: TCP
smtp.helo: linuxbox
src_ip: 127.0.0.1
src_port: 39202
tx_id: 1
11 changes: 11 additions & 0 deletions tests/mime/mime-dec-parse-line-test01/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Test Description

Test some mimre processing

## PCAP

Previous unit test for MIME in Suricata

## Related issues

https://redmine.openinfosecfoundation.org/issues/3487
Binary file added tests/mime/mime-dec-parse-line-test01/input.pcap
Binary file not shown.
48 changes: 48 additions & 0 deletions tests/mime/mime-dec-parse-line-test01/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# *** Add configuration here ***

args:
- -k none

checks:
- filter:
count: 1
match:
anomaly.app_proto: smtp
anomaly.event: APPLAYER_DETECT_PROTOCOL_ONLY_ONE_DIRECTION
anomaly.layer: proto_detect
anomaly.type: applayer
dest_ip: 127.0.0.1
dest_port: 39202
event_type: anomaly
pcap_cnt: 6
proto: TCP
src_ip: 127.0.0.1
src_port: 25
- filter:
count: 1
match:
dest_ip: 127.0.0.1
dest_port: 25
email.from: toto <[email protected]>
email.status: PARSE_DONE
email.to[0]: 172.16.92.2@linuxbox
event_type: smtp
pcap_cnt: 14
proto: TCP
smtp.helo: linuxbox
smtp.mail_from: <[email protected]>
smtp.rcpt_to[0]: <172.16.92.2@linuxbox>
src_ip: 127.0.0.1
src_port: 39202
tx_id: 0
- filter:
count: 1
match:
dest_ip: 127.0.0.1
dest_port: 25
event_type: smtp
proto: TCP
smtp.helo: linuxbox
src_ip: 127.0.0.1
src_port: 39202
tx_id: 1
11 changes: 11 additions & 0 deletions tests/mime/mime-dec-parse-line-test02/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Test Description

Test some mimre processing

## PCAP

Previous unit test for MIME in Suricata

## Related issues

https://redmine.openinfosecfoundation.org/issues/3487
Binary file added tests/mime/mime-dec-parse-line-test02/input.pcap
Binary file not shown.
49 changes: 49 additions & 0 deletions tests/mime/mime-dec-parse-line-test02/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# *** Add configuration here ***

args:
- -k none

checks:
- filter:
count: 1
match:
anomaly.app_proto: smtp
anomaly.event: APPLAYER_DETECT_PROTOCOL_ONLY_ONE_DIRECTION
anomaly.layer: proto_detect
anomaly.type: applayer
dest_ip: 127.0.0.1
dest_port: 39202
event_type: anomaly
pcap_cnt: 6
proto: TCP
src_ip: 127.0.0.1
src_port: 25
- filter:
count: 1
match:
dest_ip: 127.0.0.1
dest_port: 25
email.from: toto <[email protected]>
email.status: PARSE_DONE
email.to[0]: 172.16.92.2@linuxbox
email.url[0]: www.test.com/malware.exe?hahah
event_type: smtp
pcap_cnt: 14
proto: TCP
smtp.helo: linuxbox
smtp.mail_from: <[email protected]>
smtp.rcpt_to[0]: <172.16.92.2@linuxbox>
src_ip: 127.0.0.1
src_port: 39202
tx_id: 0
- filter:
count: 1
match:
dest_ip: 127.0.0.1
dest_port: 25
event_type: smtp
proto: TCP
smtp.helo: linuxbox
src_ip: 127.0.0.1
src_port: 39202
tx_id: 1
11 changes: 11 additions & 0 deletions tests/mime/mime-dec-parse-long-filename01/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Test Description

Test some mimre processing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is mimre a real term, or is it a typo? Couldn't find it on google...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, changing


## PCAP

Previous unit test for MIME in Suricata

## Related issues

https://redmine.openinfosecfoundation.org/issues/3487
Binary file not shown.
88 changes: 88 additions & 0 deletions tests/mime/mime-dec-parse-long-filename01/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# *** Add configuration here ***

args:
- -k none

checks:
- filter:
count: 1
match:
anomaly.app_proto: smtp
anomaly.event: APPLAYER_DETECT_PROTOCOL_ONLY_ONE_DIRECTION
anomaly.layer: proto_detect
anomaly.type: applayer
dest_ip: 127.0.0.1
dest_port: 39202
event_type: anomaly
pcap_cnt: 6
proto: TCP
src_ip: 127.0.0.1
src_port: 25
- filter:
count: 1
match:
anomaly.app_proto: smtp
anomaly.event: MIME_LONG_FILENAME
anomaly.layer: proto_parser
anomaly.type: applayer
dest_ip: 127.0.0.1
dest_port: 39202
event_type: anomaly
pcap_cnt: 14
proto: TCP
src_ip: 127.0.0.1
src_port: 25
tx_id: 0
- filter:
count: 1
match:
dest_ip: 127.0.0.1
dest_port: 25
email.attachment[0]: 12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12c
email.from: toto <[email protected]>
email.status: PARSE_DONE
email.to[0]: 172.16.92.2@linuxbox
event_type: smtp
pcap_cnt: 14
proto: TCP
smtp.helo: linuxbox
smtp.mail_from: <[email protected]>
smtp.rcpt_to[0]: <172.16.92.2@linuxbox>
src_ip: 127.0.0.1
src_port: 39202
tx_id: 0
- filter:
count: 1
match:
app_proto: smtp
dest_ip: 127.0.0.1
dest_port: 25
email.attachment[0]: 12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12c
email.from: toto <[email protected]>
email.status: PARSE_DONE
email.to[0]: 172.16.92.2@linuxbox
event_type: fileinfo
fileinfo.filename: 12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12characters12c
fileinfo.gaps: false
fileinfo.size: 25
fileinfo.state: CLOSED
fileinfo.stored: false
fileinfo.tx_id: 0
pcap_cnt: 15
proto: TCP
smtp.helo: linuxbox
smtp.mail_from: <[email protected]>
smtp.rcpt_to[0]: <172.16.92.2@linuxbox>
src_ip: 127.0.0.1
src_port: 39202
- filter:
count: 1
match:
dest_ip: 127.0.0.1
dest_port: 25
event_type: smtp
proto: TCP
smtp.helo: linuxbox
src_ip: 127.0.0.1
src_port: 39202
tx_id: 1
11 changes: 11 additions & 0 deletions tests/mime/mime-dec-parse-long-filename02/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Test Description

Test some mimre processing

## PCAP

Previous unit test for MIME in Suricata

## Related issues

https://redmine.openinfosecfoundation.org/issues/3487
Binary file not shown.
Loading