SMTP smuggling tests
This commit is contained in:
parent
d5949da111
commit
5785ea1ab4
1 changed files with 61 additions and 0 deletions
|
@ -261,6 +261,67 @@ mod tests {
|
|||
vec!["\r\na\rb\nc\r\n.d\r\n..\r\n", "\r\n.\r\n"],
|
||||
"\r\na\rb\nc\r\nd\r\n.\r\n",
|
||||
),
|
||||
// Test SMTP smuggling attempts
|
||||
(
|
||||
vec![
|
||||
"\n.\r\n",
|
||||
"MAIL FROM:<hello@world.com>\r\n",
|
||||
"RCPT TO:<test@domain.com\r\n",
|
||||
"DATA\r\n",
|
||||
"\r\n.\r\n",
|
||||
],
|
||||
concat!(
|
||||
"\n.\r\n",
|
||||
"MAIL FROM:<hello@world.com>\r\n",
|
||||
"RCPT TO:<test@domain.com\r\n",
|
||||
"DATA\r\n",
|
||||
),
|
||||
),
|
||||
(
|
||||
vec![
|
||||
"\n.\n",
|
||||
"MAIL FROM:<hello@world.com>\r\n",
|
||||
"RCPT TO:<test@domain.com\r\n",
|
||||
"DATA\r\n",
|
||||
"\r\n.\r\n",
|
||||
],
|
||||
concat!(
|
||||
"\n.\n",
|
||||
"MAIL FROM:<hello@world.com>\r\n",
|
||||
"RCPT TO:<test@domain.com\r\n",
|
||||
"DATA\r\n",
|
||||
),
|
||||
),
|
||||
(
|
||||
vec![
|
||||
"\r.\r\n",
|
||||
"MAIL FROM:<hello@world.com>\r\n",
|
||||
"RCPT TO:<test@domain.com\r\n",
|
||||
"DATA\r\n",
|
||||
"\r\n.\r\n",
|
||||
],
|
||||
concat!(
|
||||
"\r.\r\n",
|
||||
"MAIL FROM:<hello@world.com>\r\n",
|
||||
"RCPT TO:<test@domain.com\r\n",
|
||||
"DATA\r\n",
|
||||
),
|
||||
),
|
||||
(
|
||||
vec![
|
||||
"\r.\r",
|
||||
"MAIL FROM:<hello@world.com>\r\n",
|
||||
"RCPT TO:<test@domain.com\r\n",
|
||||
"DATA\r\n",
|
||||
"\r\n.\r\n",
|
||||
],
|
||||
concat!(
|
||||
"\r.\r",
|
||||
"MAIL FROM:<hello@world.com>\r\n",
|
||||
"RCPT TO:<test@domain.com\r\n",
|
||||
"DATA\r\n",
|
||||
),
|
||||
),
|
||||
] {
|
||||
let mut r = DataReceiver::new();
|
||||
let mut buf = Vec::new();
|
||||
|
|
Loading…
Reference in a new issue