本文整理汇总了Python中cuckoo.processing.static.Static.set_task方法的典型用法代码示例。如果您正苦于以下问题:Python Static.set_task方法的具体用法?Python Static.set_task怎么用?Python Static.set_task使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cuckoo.processing.static.Static
的用法示例。
在下文中一共展示了Static.set_task方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_pdf_metadata
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_task [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_lnk2_generic
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_task [as 别名]
def test_lnk2_generic(self):
s = Static()
s.set_task({
"category": "file",
"package": "generic",
"target": "lnk_2.lnk",
})
s.file_path = "tests/files/lnk_2.lnk"
assert "elf" not in s.run()
示例3: test_office
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_task [as 别名]
def test_office(self):
s = Static()
s.set_task({
"category": "file",
"package": "doc",
"target": "createproc1.docm",
})
s.file_path = "tests/files/createproc1.docm"
r = s.run()["office"]
assert "ThisDocument" in r["macros"][0]["orig_code"]
assert "Sub AutoOpen" in r["macros"][1]["orig_code"]
assert 'process.Create("notepad.exe"' in r["macros"][1]["orig_code"]
示例4: test_phishing0_pdf
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_task [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]
示例5: test_pdf
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_task [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"]
示例6: test_pdf_stringjs
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_task [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"]
示例7: init
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_task [as 别名]
def init(package, *filename):
id_ = task_id()
init_analysis(id_, package, *filename)
init_yara()
s = Static()
s.set_task({
"id": id_,
"category": "file",
"package": package,
"target": filename[-1],
})
s.file_path = cwd("binary", analysis=id_)
e = ExtractManager.for_task(id_)
return s.run(), e.results()
示例8: test_pdf_workercrash
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_task [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"] == []
示例9: test_pdf_ignorefake
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_task [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": [],
}
示例10: test_archive_pdf
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_task [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"]
示例11: test_summary_pdf_nometadata
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_task [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
示例12: test_summary_office2
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_task [as 别名]
def test_summary_office2(self, p, request):
s = Static()
s.set_task({
"category": "file",
"package": "doc",
"target": "createproc1.docm",
})
s.file_path = "tests/files/createproc1.docm"
p._get_report.return_value = {
"static": s.run(),
}
r = AnalysisRoutes.detail(request, 1, "static").content
assert "ThisDocument" in r
assert "Sub AutoOpen" in r
assert "process.Create" in r
assert "notepad.exe" in r
示例13: test_pdf_endian
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_task [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"
)
示例14: test_summary_pdf_metadata
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_task [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
示例15: test_pdf_mock
# 需要导入模块: from cuckoo.processing.static import Static [as 别名]
# 或者: from cuckoo.processing.static.Static import set_task [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
)