ScanPe¶
Collects metadata from PE files.
Source code in strelka/src/python/strelka/scanners/scan_pe.py
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 |
|
Features¶
The features of this scanner are detailed below. These features represent the capabilities and the type of analysis the scanner can perform. This may include support for Indicators of Compromise (IOC), the ability to emit files for further analysis, and the presence of extended documentation for complex analysis techniques.
Feature | Support |
---|---|
IOC Support |
|
Emit Files |
|
Extended Docs |
|
Malware Scanner |
|
Image Thumbnails |
Tastes¶
Strelka's file distribution system assigns scanners to files based on 'flavors' and 'tastes'. Flavors describe the type of file, typically determined by MIME types from libmagic, matches from YARA rules, or characteristics of parent files. Tastes are the criteria used within Strelka to determine which scanners are applied to which files, with positive and negative tastes defining files to be included or excluded respectively.
Source Filetype | Include / Exclude |
---|---|
application/x-dosexec |
|
mz_file |
Scanner Fields¶
This section provides a list of fields that are extracted from the files processed by this scanner. These fields include the data elements that the scanner extracts from each file, representing the analytical results produced by the scanner. If the test file is missing or cannot be parsed, this section will not contain any data.
Field Name | Field Type |
---|---|
address_of_entry_point |
int |
base_of_code |
int |
checksum |
int |
compile_time |
str |
debug |
dict |
debug.age |
int |
debug.guid |
bytes |
debug.pdb |
bytes |
debug.type |
str |
dll_characteristics |
str |
elapsed |
str |
file_alignment |
int |
file_info |
dict |
file_info.assembly_version |
str |
file_info.comments |
str |
file_info.company_name |
str |
file_info.file_description |
str |
file_info.file_version |
str |
file_info.fixed |
dict |
file_info.fixed.flags |
list |
file_info.fixed.operating_systems |
list |
file_info.fixed.type |
dict |
file_info.fixed.type.primary |
str |
file_info.fixed.type.sub |
str |
file_info.internal_name |
str |
file_info.legal_copyright |
str |
file_info.legal_trademarks |
str |
file_info.original_filename |
str |
file_info.product_name |
str |
file_info.product_version |
str |
file_info.string |
list |
file_info.var |
dict |
file_info.var.character_set |
str |
file_info.var.language |
NoneType |
flags |
list |
header |
dict |
header.machine |
dict |
header.machine.id |
int |
header.machine.type |
str |
header.magic |
dict |
header.magic.dos |
str |
header.magic.image |
str |
header.subsystem |
str |
image_base |
int |
image_characteristics |
str |
image_version |
float |
linker_version |
float |
major_image_version |
int |
major_linker_version |
int |
major_operating_system_version |
int |
major_subsystem_version |
int |
minor_image_version |
int |
minor_linker_version |
int |
minor_operating_system_version |
int |
minor_subsystem_version |
int |
operating_system_version |
float |
overlay |
dict |
overlay.extracted |
bool |
overlay.size |
int |
resources |
str |
section_alignment |
int |
sections |
str |
size_of_code |
int |
size_of_headers |
int |
size_of_heap_commit |
int |
size_of_heap_reserve |
int |
size_of_image |
int |
size_of_initialized_data |
int |
size_of_stack_commit |
int |
size_of_stack_reserve |
int |
size_of_uninitialized_data |
int |
subsystem_version |
float |
summary |
dict |
summary.resource_md5 |
str |
summary.resource_sha1 |
str |
summary.resource_sha256 |
str |
summary.section_md5 |
str |
summary.section_sha1 |
str |
summary.section_sha256 |
str |
symbols |
dict |
symbols.exported |
list |
symbols.imported |
list |
symbols.libraries |
list |
symbols.table |
list |
total |
dict |
total.libraries |
int |
total.resources |
int |
total.sections |
int |
total.symbols |
int |
Sample Event¶
Below is a sample event generated by this scanner, demonstrating the kind of output that can be expected when it processes a file. This sample is derived from a mock scan event configured in the scanner's test file. If no test file is available, this section will not display a sample event.
test_scan_event = {
"elapsed": 0.001,
"flags": ["no_certs_found"],
"total": {"libraries": 0, "resources": 2, "sections": 2, "symbols": 0},
"summary": {
"resource_md5": unordered(
[
"f4741884351459aa7733725b88e693af",
"b7db84991f23a680df8e95af8946f9c9",
]
),
"resource_sha1": unordered(
[
"5371904ee7671fb0b066d9323eda553269f344f9",
"cac699787884fb993ced8d7dc47b7c522c7bc734",
]
),
"resource_sha256": unordered(
[
"539dc26a14b6277e87348594ab7d6e932d16aabb18612d77f29fe421a9f1d46a",
"d8df3d0358a91b3ef97c4d472b34a60f7cf9ee7f1a6f37058fc3d1af3a156a36",
]
),
"section_md5": unordered(
[
"c3eafa2cd34f98a226e31b8ea3fea400",
"cc14da7fb94ef9b27a926fe95b86b44f",
]
),
"section_sha1": unordered(
[
"3d584b265a558dc22fa6dfa9991ae7eafee5c1a4",
"00104b432a8e7246695843e4f2d7cf2582efa3e6",
]
),
"section_sha256": unordered(
[
"86d9755b2ba9d8ffd765621f09844dd62d0b082fdc4aafa63b3b3f3ae25d9c77",
"bb31a5224e9f78905909655d9c80ba7d63f03910e4f22b296d6b7865e2a477c3",
]
),
},
"debug": {
"type": "rsds",
"guid": b"a66307d0-9b84-b944-bf030bff2d7d1e4a",
"age": 1,
"pdb": b"C:\\Users\\tmcguff\\source\\repos\\HelloWorld\\HelloWorld\\obj\\x64\\Release\\HelloWorld.pdb",
},
"file_info": {
"fixed": {
"flags": [],
"operating_systems": ["WINDOWS32"],
"type": {"primary": "APP", "sub": ""},
},
"string": [],
"var": {"language": None, "character_set": "Unicode"},
"comments": "",
"company_name": ".",
"file_description": "HelloWorld",
"file_version": "1.0.0.0",
"internal_name": "HelloWorld.exe",
"legal_copyright": "Copyright © . 2020",
"legal_trademarks": "",
"original_filename": "HelloWorld.exe",
"product_name": "HelloWorld",
"product_version": "1.0.0.0",
"assembly_version": "1.0.0.0",
},
"header": {
"machine": {"id": 34404, "type": "AMD64"},
"magic": {"dos": "DOS", "image": "64_BIT"},
"subsystem": "WINDOWS_CUI",
},
"base_of_code": 8192,
"address_of_entry_point": 0,
"image_base": 5368709120,
"size_of_code": 2048,
"size_of_initialized_data": 1536,
"size_of_headers": 512,
"size_of_heap_reserve": 1048576,
"size_of_image": 24576,
"size_of_stack_commit": 16384,
"size_of_stack_reserve": 4194304,
"size_of_heap_commit": 8192,
"size_of_uninitialized_data": 0,
"file_alignment": 512,
"section_alignment": 8192,
"checksum": 0,
"major_image_version": 0,
"minor_image_version": 0,
"major_linker_version": 48,
"minor_linker_version": 0,
"major_operating_system_version": 4,
"minor_operating_system_version": 0,
"major_subsystem_version": 4,
"minor_subsystem_version": 0,
"image_version": 0.0,
"linker_version": 48.0,
"operating_system_version": 4.0,
"subsystem_version": 4.0,
"compile_time": "2104-07-18T17:22:04",
"dll_characteristics": unordered(
[
"DYNAMIC_BASE",
"NX_COMPAT",
"NO_SEH",
"TERMINAL_SERVER_AWARE",
]
),
"image_characteristics": unordered(["EXECUTABLE_IMAGE", "LARGE_ADDRESS_AWARE"]),
"resources": unordered(
[
{
"id": 1,
"language": {"sub": "NEUTRAL", "primary": "NEUTRAL"},
"type": "VERSION",
"md5": "f4741884351459aa7733725b88e693af",
"sha1": "5371904ee7671fb0b066d9323eda553269f344f9",
"sha256": "d8df3d0358a91b3ef97c4d472b34a60f7cf9ee7f1a6f37058fc3d1af3a156a36",
},
{
"id": 1,
"language": {"sub": "NEUTRAL", "primary": "NEUTRAL"},
"type": "MANIFEST",
"md5": "b7db84991f23a680df8e95af8946f9c9",
"sha1": "cac699787884fb993ced8d7dc47b7c522c7bc734",
"sha256": "539dc26a14b6277e87348594ab7d6e932d16aabb18612d77f29fe421a9f1d46a",
},
]
),
"sections": unordered(
[
{
"address": {"physical": 1743, "virtual": 8192},
"characteristics": ["CNT_CODE", "MEM_EXECUTE", "MEM_READ"],
"entropy": 4.621214196319175,
"name": ".text",
"size": 2048,
"md5": "cc14da7fb94ef9b27a926fe95b86b44f",
"sha1": "3d584b265a558dc22fa6dfa9991ae7eafee5c1a4",
"sha256": "bb31a5224e9f78905909655d9c80ba7d63f03910e4f22b296d6b7865e2a477c3",
},
{
"address": {"physical": 1472, "virtual": 16384},
"characteristics": ["CNT_INITIALIZED_DATA", "MEM_READ"],
"entropy": 4.09070377434219,
"name": ".rsrc",
"size": 1536,
"md5": "c3eafa2cd34f98a226e31b8ea3fea400",
"sha1": "00104b432a8e7246695843e4f2d7cf2582efa3e6",
"sha256": "86d9755b2ba9d8ffd765621f09844dd62d0b082fdc4aafa63b3b3f3ae25d9c77",
},
]
),
"symbols": {"exported": [], "imported": [], "libraries": [], "table": []},
}