本文整理汇总了Python中cuckoo.processing.static.Static.set_options方法的典型用法代码示例。如果您正苦于以下问题:Python Static.set_options方法的具体用法?Python Static.set_options怎么用?Python Static.set_options使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cuckoo.processing.static.Static
的用法示例。
在下文中一共展示了Static.set_options方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_pdf_metadata
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_options [as 别名]
def test_pdf_metadata(self):
set_cwd(tempfile.mkdtemp())
s = Static()
s.set_task({
"category": "file",
"package": "pdf",
"target": "pdf-sample.pdf",
})
s.set_options({
"pdf_timeout": 30,
})
s.file_path = "tests/files/pdf-sample.pdf"
obj = s.run()["pdf"]
assert len(obj) == 2
assert obj[1] == {
"author": "cdaily",
"creation": "D:20000629102108+11'00'",
"creator": "Microsoft Word 8.0",
"javascript": [],
"modification": "2013-10-28T15:24:13-04:00",
"producer": "Acrobat Distiller 4.0 for Windows",
"subject": "",
"title": "This is a test PDF file",
"urls": [],
"version": 1,
}
示例2: test_phishing0_pdf
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_options [as 别名]
def test_phishing0_pdf(self):
set_cwd(tempfile.mkdtemp())
s = Static()
s.set_task({
"category": "file",
"package": "pdf",
"target": "phishing0.pdf",
})
s.set_options({
"pdf_timeout": 30,
})
s.file_path = "tests/files/phishing0.pdf"
assert "googleattachmentsigned" in s.run()["pdf"][0]["urls"][0]
示例3: test_pdf_stringjs
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_options [as 别名]
def test_pdf_stringjs(self):
set_cwd(tempfile.mkdtemp())
s = Static()
s.set_task({
"category": "file",
"package": "pdf",
"target": "pdf1-stringjs.pdf",
})
s.set_options({
"pdf_timeout": 30,
})
s.file_path = "tests/files/pdf1-stringjs.pdf"
r = s.run()["pdf"][12]
assert "app.alert({" in r["javascript"][0]["orig_code"]
示例4: test_pdf
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_options [as 别名]
def test_pdf(self):
set_cwd(tempfile.mkdtemp())
s = Static()
s.set_task({
"category": "file",
"package": "pdf",
"target": "pdf0.pdf",
})
s.set_options({
"pdf_timeout": 30,
})
s.file_path = "tests/files/pdf0.pdf"
r = s.run()["pdf"][0]
assert "var x = unescape" in r["javascript"][0]["orig_code"]
示例5: test_archive_pdf
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_options [as 别名]
def test_archive_pdf(self):
set_cwd(tempfile.mkdtemp())
s = Static()
s.set_task({
"category": "archive",
"package": "pdf",
"options": {
"filename": "files/pdf0.pdf",
},
})
s.set_options({
"pdf_timeout": 30,
})
s.file_path = "tests/files/pdf0.zip"
assert "%48%65" in s.run()["pdf"][0]["javascript"][0]["orig_code"]
示例6: test_pdf_workercrash
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_options [as 别名]
def test_pdf_workercrash(self, md):
set_cwd(tempfile.mkdtemp())
md.return_value = None
s = Static()
s.set_task({
"category": "file",
"package": "pdf",
"target": "pdf0.pdf",
})
s.set_options({
"pdf_timeout": 30,
})
s.file_path = "tests/files/pdf0.pdf"
r = s.run()
assert r["pdf"] == []
示例7: test_pdf_ignorefake
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_options [as 别名]
def test_pdf_ignorefake(self):
set_cwd(tempfile.mkdtemp())
s = Static()
s.set_task({
"category": "file",
"package": "pdf",
"target": "fakepdf.pdf",
})
s.set_options({
"pdf_timeout": 30,
})
s.file_path = "tests/files/fakepdf.pdf"
assert s.run() == {
"pdf": [],
}
示例8: test_summary_pdf_nometadata
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_options [as 别名]
def test_summary_pdf_nometadata(self, p, request):
s = Static()
s.set_task({
"category": "file",
"package": "pdf",
"target": __file__,
})
s.set_options({
"pdf_timeout": 10,
})
s.file_path = __file__
p._get_report.return_value = {
"static": s.run(),
}
r = AnalysisRoutes.detail(request, 1, "static").content
assert "No PDF metadata could be extracted!" in r
示例9: test_pdf_endian
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_options [as 别名]
def test_pdf_endian(self):
s = Static()
s.set_task({
"category": "file",
"package": "pdf",
"target": "pdf-endianerror.pdf"
})
s.file_path = "tests/files/pdf-endianerror.pdf"
s.set_options({
"pdf_timeout": 30,
})
r = s.run()
assert len(r["pdf"][0]["urls"]) == 63
assert r["pdf"][0]["urls"][54] == (
u"http://yourmirror.net/kali-security\u548c"
u"http://yourmirror.net/kali-images"
)
示例10: test_pdf_mock
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_options [as 别名]
def test_pdf_mock(self, p):
set_cwd(tempfile.mkdtemp())
s = Static()
s.set_task({
"category": "file",
"package": "pdf",
"target": "pdf0.pdf",
})
s.set_options({
"pdf_timeout": 30,
})
s.file_path = "tests/files/pdf0.pdf"
p.return_value = ["hello"]
assert s.run()["pdf"] == ["hello"]
p.assert_called_once_with(
mock.ANY, ("tests/files/pdf0.pdf",), timeout=30
)
示例11: test_summary_pdf_metadata
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_options [as 别名]
def test_summary_pdf_metadata(self, p, request):
s = Static()
s.set_task({
"category": "file",
"package": "pdf",
"target": "pdf-sample.pdf",
})
s.set_options({
"pdf_timeout": 10,
})
s.file_path = "tests/files/pdf-sample.pdf"
p._get_report.return_value = {
"static": s.run(),
}
r = AnalysisRoutes.detail(request, 1, "static").content
assert "Microsoft Word 8.0" in r
assert "This is a test PDF file" in r
示例12: test_pdf_attach
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_options [as 别名]
def test_pdf_attach(self):
set_cwd(tempfile.mkdtemp())
s = Static()
s.set_task({
"category": "file",
"package": "pdf",
"target": "pdf_attach.pdf",
})
s.set_options({
"pdf_timeout": 30,
})
s.file_path = "tests/files/pdf_attach.pdf"
obj, = s.run()["pdf"]
assert len(obj["javascript"]) == 1
assert "exportDataObject" in obj["javascript"][0]["orig_code"]
assert len(obj["attachments"]) == 1
assert obj["attachments"][0]["filename"] == "789IVIIUXSF110.docm"
assert "kkkllsslll" in obj["openaction"]