- Timestamp:
- 08/15/08 21:21:54 (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/reglookup.1.docbook
r119 r125 27 27 print them out to stdout in a CSV-like format. It has filtering 28 28 options to narrow the focus of the output. This tool is 29 designed to work with on Windows NT/2K/XP/2K3/Vista registries, 30 though your mileage may vary. 29 designed to work with on Windows NT-based registries. 31 30 </para> 32 31 </refsect1> … … 108 107 <listitem> 109 108 <para> 110 Adds f ouradditional columns to output containing111 information from key security descriptors . The columns112 are: owner, group, sacl, dacl.109 Adds five additional columns to output containing 110 information from key security descriptors and rarely used 111 fields. The columns are: owner, group, sacl, dacl, class. 113 112 (This feature's output has not been extensively tested.) 114 113 </para> -
trunk/include/regfi.h
r121 r125 89 89 90 90 /* Constants used for validation */ 91 /* XXX: Can we add clock resolution validation as well as range? It has 92 * been reported that Windows timestamps are never more than a 93 * certain granularity (250ms?), which could be used to help 94 * eliminate false positives. Would need to validate this and 95 * perhaps conservatively implement a check. 96 */ 91 97 /* Minimum time is Jan 1, 1990 00:00:00 */ 92 98 #define REGFI_MTIME_MIN_HIGH 0x01B41E6D … … 108 114 #define NK_TYPE_NORMALKEY 0x0020 109 115 #define NK_TYPE_ROOTKEY 0x002c 110 /* TODO: Unknown type that shows up in Vista registries */116 /* XXX: Unknown type that shows up in Vista registries */ 111 117 #define NK_TYPE_UNKNOWN1 0x1020 112 118 … … 216 222 217 223 /* header information */ 218 /* XXX: should we be looking for types other than the root key type? */219 224 uint16 key_type; 220 225 uint8 magic[REC_HDR_SIZE]; … … 224 229 char* classname; 225 230 char* keyname; 226 uint32 parent_off; /* back pointer in registry hive*/227 uint32 classname_off; 231 uint32 parent_off; /* pointer to parent key */ 232 uint32 classname_off; 228 233 229 234 /* max lengths */ -
trunk/lib/regfi.c
r124 r125 1583 1583 ret_val->values_off = IVAL(nk_header, 0x28); 1584 1584 ret_val->sk_off = IVAL(nk_header, 0x2C); 1585 /* XXX: currently we do nothing with class names. Need to investigate. */1586 1585 ret_val->classname_off = IVAL(nk_header, 0x30); 1587 1586 … … 1594 1593 ret_val->name_length = SVAL(nk_header, 0x48); 1595 1594 ret_val->classname_length = SVAL(nk_header, 0x4A); 1595 1596 1596 1597 1597 if(ret_val->name_length + REGFI_NK_MIN_LENGTH > ret_val->cell_size) … … 1634 1634 } 1635 1635 ret_val->keyname[ret_val->name_length] = '\0'; 1636 1637 1638 /***/ 1639 1640 if(ret_val->classname_length > 0 1641 && ret_val->classname_off != REGF_OFFSET_NONE 1642 && ret_val->classname_off == (ret_val->classname_off & 0xFFFFFFF8)) 1643 { 1644 ret_val->classname = (char*)zalloc(ret_val->classname_length+1); 1645 if(ret_val->classname != NULL) 1646 { 1647 if(!regfi_parse_cell(file->fd, ret_val->classname_off+REGF_BLOCKSIZE, 1648 (uint8*)ret_val->classname, ret_val->classname_length, 1649 &cell_length, &unalloc) 1650 || (cell_length < ret_val->classname_length) 1651 || (strict && unalloc)) 1652 { 1653 /* Being careful not to reject the whole key here even when 1654 * strict and things are obviously wrong, since it appears 1655 * they're commonly obviously wrong. 1656 */ 1657 free(ret_val->classname); 1658 ret_val->classname = NULL; 1659 return ret_val; 1660 } 1661 1662 ret_val->classname[ret_val->classname_length] = '\0'; 1663 /*printf("==> cell_length=%d, classname_length=%d, max_bytes_subkeyclassname=%d\n", cell_length, ret_val->classname_length, ret_val->max_bytes_subkeyclassname);*/ 1664 } 1665 } 1666 /***/ 1667 1636 1668 1637 1669 return ret_val; -
trunk/src/reglookup.c
r121 r125 47 47 48 48 /* XXX: A hack to share some functions with reglookup-recover.c. 49 * Should move these into a proper lylibrary at some point.49 * Should move these into a proper library at some point. 50 50 */ 51 51 #include "common.c" … … 295 295 char* sacl = NULL; 296 296 char* dacl = NULL; 297 char* quoted_classname; 297 298 char mtime[20]; 298 299 time_t tmp_time[1]; … … 320 321 dacl = empty_str; 321 322 322 printf("%s,KEY,,%s,%s,%s,%s,%s\n", full_path, mtime, 323 owner, group, sacl, dacl); 323 if(k->classname != NULL) 324 quoted_classname = quote_string(k->classname, key_special_chars); 325 else 326 quoted_classname = empty_str; 327 328 printf("%s,KEY,,%s,%s,%s,%s,%s,%s\n", full_path, mtime, 329 owner, group, sacl, dacl, quoted_classname); 324 330 325 331 if(owner != empty_str) … … 331 337 if(dacl != empty_str) 332 338 free(dacl); 339 if(quoted_classname != empty_str) 340 free(quoted_classname); 333 341 } 334 342 else … … 582 590 { 583 591 if(print_security) 584 printf("PATH,TYPE,VALUE,MTIME,OWNER,GROUP,SACL,DACL \n");592 printf("PATH,TYPE,VALUE,MTIME,OWNER,GROUP,SACL,DACL,CLASS\n"); 585 593 else 586 594 printf("PATH,TYPE,VALUE,MTIME\n");
Note: See TracChangeset
for help on using the changeset viewer.