Skip to content

Commit

Permalink
Add more test samples
Browse files Browse the repository at this point in the history
  • Loading branch information
Anilm3 committed Aug 13, 2024
1 parent 9058c1f commit 342a630
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/condition/shi_detector_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ TEST(TestSHIDetector, ExecutablesAndRedirections)
{"ls 2> file; echo hello", "2> file"},
{"ls &> file; echo hello", "&> file"},
{"$(<file) -l", "$(<file) -l"},
{"ls injection ls; injection ls", "injection ls"},
{"ls $(<file) -l ; $(<file) -l", "$(<file) -l"},
};

for (const auto &[resource, param] : samples) {
Expand Down
7 changes: 7 additions & 0 deletions tests/condition/sqli_detector_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,13 @@ TEST_P(DialectTestFixture, Tautologies)
"SELECT x FROM t WHERE id = ? or (?) = (?)", "(1) = ('1')"},
{R"(SELECT * FROM ships WHERE name LIKE '%neb%' OR 1=1)",
R"(SELECT * FROM ships WHERE name LIKE ? OR ?=?)", R"(neb%' OR 1=1)"},
{
R"(-- 'something' OR 1=1; --
SELECT * FROM table WHERE id='' OR 1=1; --)",
R"(-- 'something' OR 1=1; --
SELECT * FROM table WHERE id=? OR ?=?; --)",
"' OR 1=1; --",
},
};

for (const auto &[statement, obfuscated, input] : samples) {
Expand Down

0 comments on commit 342a630

Please sign in to comment.