├── README.md ├── page_brute-BETA.py └── default_signatures.yar /README.md: -------------------------------------------------------------------------------- 1 | page_brute (beta!) 2 | ========== 3 | 4 | **page_brute.py** is a digital forensic tool purposed to analyze and categorize individual paged memory frames from Windows Page Files by appying YARA-based signatures to fix-sized blocks of pagefile.sys. 5 | 6 | ***This tool can be used to:*** 7 | * Disambiguate evidence within pagefile.sys by logically grouping blocks/pages into categories based on YARA rulesets of forensic artifacts that follow a pattern/convention. 8 | * Identify page files that contain remanants of popular cleartext protocols such as HTTP/FTP, etc to identify network activities. 9 | * Identify potential attacker activities based on popular command syntaxes used during internal propagations. 10 | * Identify evidence of active malware infections based on YARA signatures for known malware. 11 | * Isolate page files that contain signatures/magic values for popular file formats for more precise file carving. 12 | 13 | ##NOTICE: 14 | This tool is currently in beta! This utility and its signature set is subject to change in the near future! For suggestions - email the author via github. 15 | 16 | ##Requires: 17 | * yara & yara-python: http://code.google.com/p/yara-project/downloads/list 18 | * default_signatures.yar (see above) 19 | 20 | ##How does it work? 21 | 1. Given block size, page_brute.py reads in pagefile in fixed-sized blocks (default, 4096 bytes) 22 | 2. For each block, page_brute decides if the block is null - if null, the block is skipped. 23 | 3. If block is not null, the block is applied against compiled yara signatures (defined in -r/--rules argument). 24 | * If -r/--rules not provided, page_brute.py will read from the default ruleset: default_signatures.yar 25 | * Custom rules stored in a folder can also be provided as an argument to -r/--rules (must end in .yar) 26 | 4. If a block matches a YARA signature, the raw block will be stored in the corresponding output directory. 27 | * -o/--scanname defines output folder that raw blocks will be saved. 28 | * If no output is specified, a default folder is created in pwd: PAGE_BRUTE-YYYY-MM-DD-HH:MM:SS-RESULTS 29 | 5. Blocks are labeled by their logical page ID beginning at 0. 30 | * To determine offset, multiply pageID by the page size. 31 | 32 | ***NOTE:*** if a page file matches against multiple signatures, the corresponding page file will be copied to each rule directory. 33 | 34 | ##How do I write signatures? 35 | YARA is a powerful engine that allows you to match groups of strings,binary sequences,and regular expressions with user-defined boolean conditions against pretty much anything. 36 | 37 | To learn more about writing YARA rules, please see the informative user guide here: http://yara-project.googlecode.com/files/YARA%20User%27s%20Manual%201.6.pdf 38 | 39 | ##Current Signatures: 40 | * FTP 41 | * HTTP requests/responses 42 | * IRC 43 | * Administrative/Hidden Share Abuse 44 | * Remote system syntaxes 45 | * HTML 46 | * Javascript 47 | * CMD Shell (this might suck) 48 | * SMTP Message Headers 49 | 50 | ##Usage: 51 | From the help page: 52 | ``` 53 | usage: page_brute-BETA.py [-h] [-f FILE] [-p SIZE] [-o SCANNAME] [-i] 54 | [-r RULEFILE] 55 | 56 | Checks pages in pagefiles for YARA-based rule matches. Useful to identify 57 | forensic artifacts within Windows-based page files and characterize blocks 58 | based on regular expressions. 59 | 60 | optional arguments: 61 | -h, --help show this help message and exit 62 | -r RULEFILE, --rules RULEFILE 63 | File/directory containing YARA signatures (must end 64 | with .yar) 65 | 66 | -f FILE, --file FILE Pagefile or any chunk/block-based binary file 67 | -p SIZE, --size SIZE Size of chunk/block in bytes (Default 4096) 68 | -o SCANNAME, --scanname SCANNAME 69 | Descriptor of the scan session - used for output 70 | directory 71 | -i, --invert Given scan options, match all blocks that DO NOT match 72 | a ruleset 73 | ``` 74 | ###In Action: 75 | ``` 76 | root@system:~/Desktop/page/page_brute# ./page_brute-BETA.py --file=pagefile.sys 77 | [+] - PAGE_BRUTE processing file: pagefile.sys 78 | [+] - Ruleset Compilation Successful. 79 | [+] - PAGE_BRUTE running with the following options: 80 | [-] - FILE: pagefile.sys 81 | [-] - PAGE_SIZE: 4096 82 | [-] - RULES TYPE: DEFAULT 83 | [-] - RULE LOCATION: default_signatures.yar 84 | [-] - INVERSION SCAN: False 85 | [-] - WORKING DIR: PAGE_BRUTE-2013-10-27-01:09:33-RESULTS 86 | ================= 87 | 88 | [!] FLAGGED BLOCK 56: cmdshell 89 | [!] FLAGGED BLOCK 87: cmdshell 90 | [!] FLAGGED BLOCK 1222: webartifact_html 91 | [!] FLAGGED BLOCK 1454: webartifact_html 92 | [!] FLAGGED BLOCK 1782: webartifact_html 93 | [!] FLAGGED BLOCK 2200: webartifact_html 94 | [!] FLAGGED BLOCK 3781: webartifact_html 95 | 96 | root@system:~/Desktop/page/page_brute# ls -lR PAGE_BRUTE-2013-10-27-01\:09\:33-RESULTS/ 97 | PAGE_BRUTE-2013-10-27-01:09:33-RESULTS/: 98 | total 8 99 | drwxr-xr-x 2 root root 4096 Oct 27 01:09 cmdshell 100 | drwxr-xr-x 2 root root 4096 Oct 27 01:09 webartifact_html 101 | 102 | PAGE_BRUTE-2013-10-27-01:09:33-RESULTS/cmdshell: 103 | total 8 104 | -rw-r--r-- 1 root root 4096 Oct 27 01:09 118.page 105 | -rw-r--r-- 1 root root 4096 Oct 27 01:09 77.page 106 | 107 | PAGE_BRUTE-2013-10-27-01:09:33-RESULTS/webartifact_html: 108 | total 20 109 | -rw-r--r-- 1 root root 4096 Oct 27 01:09 1330.page 110 | -rw-r--r-- 1 root root 4096 Oct 27 01:09 1445.page 111 | 112 | root@system:~/Desktop/page/page_brute/PAGE_BRUTE-2013-10-27-01:20:28-RESULTS/webartifact_html# xxd 24606.page 113 | 0000000: 613e 3c2f 7464 3e0d 0a20 2020 2020 2020 a>.. 114 | 0000010: 2020 203c 2f74 723e 0d0a 0d0a 2020 2020 .... 115 | 0000020: 2020 2020 2020 3c74 7220 6964 3d22 446f .. 119 | 0000060: 3c74 643e 3c69 6d67 2069 643d 226e 6f74 Not recomm
124 | 00000b0: 656e 6465 6420 6963 6f6e 2220 636c 6173  ended icon< 126 | 00000d0: 2f74 643e 0d0a 2020 2020 2020 2020 2020 /td>.. 127 | 00000e0: 2020 3c74 6420 7374 796c 653d 2270 6164