diff --git a/.gitignore b/.gitignore index 3f07002..4680d14 100644 --- a/.gitignore +++ b/.gitignore @@ -71,8 +71,8 @@ tests/dst/* tests/*_dst tests/test_logs/* !tests/**/.keepdir -!tests/src_invalid/* -!tests/src_valid/* +!tests/dangerous/* +!tests/normal/* pdfid.py # Plugins are pdfid stuff plugin_* diff --git a/.travis.yml b/.travis.yml index 81374d2..a8e0e4d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,7 +45,7 @@ install: - pushd theZoo/malwares/Binaries - python unpackall.py - popd - - mv theZoo/malwares/Binaries/out tests/src_invalid/ + - mv theZoo/malwares/Binaries/out tests/dangerous/ # Path traversal attacks - git clone https://github.com/jwilk/path-traversal-samples - pushd path-traversal-samples @@ -56,12 +56,12 @@ install: - make - popd - popd - - mv path-traversal-samples/zip/*.zip tests/src_invalid/ - - mv path-traversal-samples/rar/*.rar tests/src_invalid/ + - mv path-traversal-samples/zip/*.zip tests/dangerous/ + - mv path-traversal-samples/rar/*.rar tests/dangerous/ # Office docs - git clone https://github.com/eea/odfpy.git - - mv odfpy/tests/examples/* tests/src_invalid/ - - pushd tests/src_invalid/ + - mv odfpy/tests/examples/* tests/dangerous/ + - pushd tests/dangerous/ - wget https://bitbucket.org/decalage/olefileio_pl/raw/3073963b640935134ed0da34906fea8e506460be/Tests/images/test-ole-file.doc - wget --no-check-certificate https://www.officedissector.com/corpus/fraunhoferlibrary.zip - unzip -o fraunhoferlibrary.zip diff --git a/tests/dangerous/.DS_Store b/tests/dangerous/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/tests/dangerous/.DS_Store differ diff --git a/tests/src_invalid/42.zip b/tests/dangerous/42.zip similarity index 100% rename from tests/src_invalid/42.zip rename to tests/dangerous/42.zip diff --git a/tests/src_invalid/autorun.inf b/tests/dangerous/autorun.inf similarity index 100% rename from tests/src_invalid/autorun.inf rename to tests/dangerous/autorun.inf diff --git a/tests/src_invalid/blah.conf b/tests/dangerous/config_file.conf similarity index 100% rename from tests/src_invalid/blah.conf rename to tests/dangerous/config_file.conf diff --git a/tests/dangerous/message.msg b/tests/dangerous/message.msg new file mode 100644 index 0000000..93a1885 --- /dev/null +++ b/tests/dangerous/message.msg @@ -0,0 +1,20 @@ +From: John Doe +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="XXXXboundary text" + +This is a multipart message in MIME format. + +--XXXXboundary text +Content-Type: text/plain + +this is the body text + +--XXXXboundary text +Content-Type: text/plain; +Content-Disposition: attachment; + filename="test.txt" + +this is the attachment text + +--XXXXboundary text-- diff --git a/tests/src_invalid/testRTL‮exe.txt b/tests/dangerous/testRTL‮exe.txt similarity index 100% rename from tests/src_invalid/testRTL‮exe.txt rename to tests/dangerous/testRTL‮exe.txt diff --git a/tests/normal/Example.gif b/tests/normal/Example.gif new file mode 100644 index 0000000..2b65920 Binary files /dev/null and b/tests/normal/Example.gif differ diff --git a/tests/src_valid/Example.jpg b/tests/normal/Example.jpg similarity index 100% rename from tests/src_valid/Example.jpg rename to tests/normal/Example.jpg diff --git a/tests/normal/Example.ogg b/tests/normal/Example.ogg new file mode 100644 index 0000000..0d7f43e Binary files /dev/null and b/tests/normal/Example.ogg differ diff --git a/tests/src_valid/Example.png b/tests/normal/Example.png similarity index 100% rename from tests/src_valid/Example.png rename to tests/normal/Example.png diff --git a/tests/normal/Example.svg b/tests/normal/Example.svg new file mode 100644 index 0000000..438734c --- /dev/null +++ b/tests/normal/Example.svg @@ -0,0 +1,69 @@ + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/tests/src_valid/sample.pdf b/tests/normal/pdf-sample.pdf similarity index 100% rename from tests/src_valid/sample.pdf rename to tests/normal/pdf-sample.pdf diff --git a/tests/src_invalid/blah.txt b/tests/normal/plaintext.txt similarity index 100% rename from tests/src_invalid/blah.txt rename to tests/normal/plaintext.txt diff --git a/tests/src_valid/rartest.rar b/tests/normal/rar_archive.rar similarity index 100% rename from tests/src_valid/rartest.rar rename to tests/normal/rar_archive.rar diff --git a/tests/src_valid/sample.rtf b/tests/normal/rich_text.rtf similarity index 100% rename from tests/src_valid/sample.rtf rename to tests/normal/rich_text.rtf diff --git a/tests/normal/sample_mpeg4.mp4 b/tests/normal/sample_mpeg4.mp4 new file mode 100644 index 0000000..a05d935 Binary files /dev/null and b/tests/normal/sample_mpeg4.mp4 differ diff --git a/tests/normal/zip_archive.zip b/tests/normal/zip_archive.zip new file mode 100644 index 0000000..a396625 Binary files /dev/null and b/tests/normal/zip_archive.zip differ diff --git a/tests/src_invalid/blah.tar.bz2 b/tests/src_invalid/blah.tar.bz2 deleted file mode 100644 index 4aeb2cd..0000000 Binary files a/tests/src_invalid/blah.tar.bz2 and /dev/null differ diff --git a/tests/src_invalid/blah.zip b/tests/src_invalid/blah.zip deleted file mode 100644 index 3e809f4..0000000 Binary files a/tests/src_invalid/blah.zip and /dev/null differ diff --git a/tests/src_invalid/foobar.dat b/tests/src_invalid/foobar.dat deleted file mode 120000 index f553ab5..0000000 --- a/tests/src_invalid/foobar.dat +++ /dev/null @@ -1 +0,0 @@ -geneve_1564.pdf \ No newline at end of file diff --git a/tests/src_invalid/geneve_1564.pdf b/tests/src_invalid/geneve_1564.pdf deleted file mode 100644 index 9ae1d9c..0000000 Binary files a/tests/src_invalid/geneve_1564.pdf and /dev/null differ diff --git a/tests/src_invalid/geneve_1564_wrong_mime.conf b/tests/src_invalid/geneve_1564_wrong_mime.conf deleted file mode 100644 index 9ae1d9c..0000000 Binary files a/tests/src_invalid/geneve_1564_wrong_mime.conf and /dev/null differ diff --git a/tests/src_invalid/test.obj b/tests/src_invalid/test.obj deleted file mode 100644 index 907b308..0000000 --- a/tests/src_invalid/test.obj +++ /dev/null @@ -1 +0,0 @@ -blah diff --git a/tests/src_valid/blah.conf b/tests/src_valid/blah.conf deleted file mode 100644 index 484ba93..0000000 --- a/tests/src_valid/blah.conf +++ /dev/null @@ -1 +0,0 @@ -This is a test. diff --git a/tests/src_valid/dir1/dir2/blah.conf b/tests/src_valid/dir1/dir2/blah.conf deleted file mode 100644 index 484ba93..0000000 --- a/tests/src_valid/dir1/dir2/blah.conf +++ /dev/null @@ -1 +0,0 @@ -This is a test. diff --git a/tests/src_valid/test.zip b/tests/src_valid/test.zip deleted file mode 100644 index 4b911c0..0000000 Binary files a/tests/src_valid/test.zip and /dev/null differ diff --git a/tests/test_filecheck.py b/tests/test_filecheck.py index e7aeaac..77a7887 100644 --- a/tests/test_filecheck.py +++ b/tests/test_filecheck.py @@ -24,13 +24,13 @@ class TestSystem: @fixture def valid_groomer(self): - src_path = os.path.join(os.getcwd(), 'tests/src_valid') + src_path = os.path.join(os.getcwd(), 'tests/normal') dst_path = self.make_dst_dir_path(src_path) return KittenGroomerFileCheck(src_path, dst_path, debug=True) @fixture def invalid_groomer(self): - src_path = os.path.join(os.getcwd(), 'tests/src_invalid') + src_path = os.path.join(os.getcwd(), 'tests/dangerous') dst_path = self.make_dst_dir_path(src_path) return KittenGroomerFileCheck(src_path, dst_path, debug=True) diff --git a/tests/test_kittengroomer.py b/tests/test_kittengroomer.py index 538314d..27f8045 100644 --- a/tests/test_kittengroomer.py +++ b/tests/test_kittengroomer.py @@ -13,12 +13,12 @@ fixture = pytest.fixture # FileBase - +@xfail class TestFileBase: @fixture def source_file(self): - return 'tests/src_valid/blah.conf' + return 'tests/normal/blah.conf' @fixture def dest_file(self): @@ -214,16 +214,11 @@ class TestFileBase: # check that safe copy can handle weird file path inputs -class TestLogger: - - pass - - class TestKittenGroomerBase: @fixture def source_directory(self): - return 'tests/src_invalid' + return 'tests/dangerous' @fixture def dest_directory(self):