Skip to content

Commit

Permalink
Initial release (beta).
Browse files Browse the repository at this point in the history
  • Loading branch information
msuhanov committed Jul 3, 2017
0 parents commit 6ad45ea
Show file tree
Hide file tree
Showing 91 changed files with 5,481 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
@@ -0,0 +1,3 @@
Version: 1.0.0-beta1

Initial release (beta).
78 changes: 78 additions & 0 deletions Example
@@ -0,0 +1,78 @@
#!/usr/bin/env python3

from yarp import *

# A primary file is specified here.
primary_path = '<...>/SYSTEM'

# Discover transaction log files to be used to recover the primary file, if required.
transaction_logs = RegistryHelpers.DiscoverLogFiles(primary_path)

# Open the primary file and each transaction log file discovered.
primary_file = open(primary_path, 'rb')

if transaction_logs.log_path is not None:
log_file = open(transaction_logs.log_path, 'rb')
else:
log_file = None

if transaction_logs.log1_path is not None:
log1_file = open(transaction_logs.log1_path, 'rb')
else:
log1_file = None

if transaction_logs.log2_path is not None:
log2_file = open(transaction_logs.log2_path, 'rb')
else:
log2_file = None

# Open the hive and recover it, if required.
hive = Registry.RegistryHive(primary_file)
recovery_result = hive.recover_auto(log_file, log1_file, log2_file)
if recovery_result.recovered:
print('The hive has been recovered')

# Print basic information about the hive.
print('Last written timestamp: {}'.format(hive.last_written_timestamp()))
print('Last reorganized timestamp: {}'.format(hive.last_reorganized_timestamp()))

# Find an existing key.
key = hive.find_key('controlset001\\services')
print('Found a key: {}'.format(key.path()))

# Print information about its subkeys.
for sk in key.subkeys():
print(sk)

# Pick an existing subkey.
key = key.subkey('exfat')

# Print information about it.
print('Found a subkey: {}'.format(key.name()))
print('Last written timestamp: {}'.format(key.last_written_timestamp()))

# Print information about its values.
for v in key.values():
print(v)

# Pick an existing value.
v = key.value('description')

# Print more information about this value.
print('Some information about a specific value:')
print('Value name is \'{}\''.format(v.name()))
print('Value type is {} as a string (or {} as an integer)'.format(v.type_str(), v.type_raw()))
print('Value data is:')
print(v.data())
print('The same data as raw bytes:')
print(v.data_raw())

# Close everything.
hive = None
primary_file.close()
if log_file is not None:
log_file.close()
if log1_file is not None:
log1_file.close()
if log2_file is not None:
log2_file.close()
674 changes: 674 additions & 0 deletions License

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions ReadMe
@@ -0,0 +1,33 @@
yarp: yet another registry parser

1. Project goals: the library and tools

- Parse Windows registry files in a proper way (with forensics in mind).
- Expose values of all fields of underlying registry structures.
- Support for truncated registry files.
- Support for recovering deleted keys and values.
- Support for carving of registry hives.
- Support for transaction log files.

2. Hive version numbers supported

- Full support: 1.1-1.6.
- No support: 1.0.

In general, full support is available for hive files from installations of
Windows NT 3.1 and later versions of Windows NT (including Windows 10);
hive files from installations of pre-release versions of Windows NT 3.1 are
not supported.

3. Documentation

See the docstrings in the module.
For a basic usage example, see the 'Example' file.

4. License

This project is made available under the terms of the GNU GPL, version 3.
See the 'License' file.

---
(c) Maxim Suhanov
Binary file not shown.
Binary file not shown.
Empty file.
Binary file added hives_for_tests/BadListHive
Binary file not shown.
Binary file added hives_for_tests/BadLogHive1/BadLogHive
Binary file not shown.
Binary file added hives_for_tests/BadLogHive1/BadLogHive.LOG1
Binary file not shown.
Empty file.
Binary file added hives_for_tests/BadLogHive2/BadLogHive
Binary file not shown.
Binary file added hives_for_tests/BadLogHive2/BadLogHive.LOG1
Binary file not shown.
Empty file.
Binary file added hives_for_tests/BadLogHive3/BadLogHive
Binary file not shown.
Binary file added hives_for_tests/BadLogHive3/BadLogHive.LOG1
Binary file not shown.
Binary file added hives_for_tests/BadLogHive3/BadLogHive.LOG2
Binary file not shown.
Binary file added hives_for_tests/BadSubkeyHive
Binary file not shown.
Binary file added hives_for_tests/BigDataHive
Binary file not shown.
Binary file added hives_for_tests/BogusKeyNamesHive
Binary file not shown.
Binary file added hives_for_tests/Carving/0
Binary file not shown.
Binary file added hives_for_tests/Carving/512
Binary file not shown.
Binary file added hives_for_tests/CompHive
Binary file not shown.
Binary file added hives_for_tests/DeletedDataHive
Binary file not shown.
Binary file added hives_for_tests/DeletedTreeHive
Binary file not shown.
Binary file added hives_for_tests/DeletedTreeNoRootFlagHive
Binary file not shown.
Binary file added hives_for_tests/DeletedTreePartialPathHive
Binary file not shown.
Empty file added hives_for_tests/Discovery/1/aa
Empty file.
Empty file.
Empty file.
Empty file.
Empty file added hives_for_tests/Discovery/2/AA
Empty file.
Empty file.
Empty file.
Empty file added hives_for_tests/Discovery/3/AA
Empty file.
Empty file.
Empty file.
Empty file added hives_for_tests/Discovery/4/AA
Empty file.
Empty file.
Empty file.
Empty file.
Empty file added hives_for_tests/Discovery/5/aa
Empty file.
Binary file added hives_for_tests/DuplicateSubkeysHive
Binary file not shown.
Binary file added hives_for_tests/EffectiveSizeHive
Binary file not shown.
Binary file added hives_for_tests/EmptyHive
Binary file not shown.
Binary file added hives_for_tests/ExtendedASCIIHive
Binary file not shown.
Binary file added hives_for_tests/GarbageHive
Binary file not shown.
Binary file added hives_for_tests/HealedHive
Binary file not shown.
Binary file added hives_for_tests/InvalidParentHive
Binary file not shown.
Binary file added hives_for_tests/ManySubkeysHive
Binary file not shown.
Binary file added hives_for_tests/MultiSzHive
Binary file not shown.
Binary file added hives_for_tests/NewDirtyHive1/NewDirtyHive
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added hives_for_tests/NewDirtyHive2/NewDirtyHive
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added hives_for_tests/NewFlagsHive
Binary file not shown.
Binary file added hives_for_tests/OldDirtyHive/OldDirtyHive
Binary file not shown.
Binary file added hives_for_tests/OldDirtyHive/OldDirtyHive.LOG1
Binary file not shown.
Empty file.
Binary file not shown.
Binary file added hives_for_tests/RemnantsHive
Binary file not shown.
Binary file added hives_for_tests/SlackHive
Binary file not shown.
Binary file added hives_for_tests/StringValuesHive
Binary file not shown.
Binary file added hives_for_tests/TruncatedHive
Binary file not shown.
Binary file added hives_for_tests/TruncatedNameHive
Binary file not shown.
Binary file added hives_for_tests/UnicodeHive
Binary file not shown.
Binary file added hives_for_tests/WrongOrderHive
Binary file not shown.
Binary file added records_for_tests/dummy_db
Binary file not shown.
Binary file added records_for_tests/dummy_lf
Binary file not shown.
Binary file added records_for_tests/dummy_lh
Binary file not shown.
Binary file added records_for_tests/dummy_li
Binary file not shown.
Binary file added records_for_tests/dummy_list
Binary file not shown.
Binary file added records_for_tests/dummy_nk
Binary file not shown.
Binary file added records_for_tests/dummy_ri
Binary file not shown.
Binary file added records_for_tests/dummy_sk
Binary file not shown.
Binary file added records_for_tests/dummy_vk
Binary file not shown.
19 changes: 19 additions & 0 deletions setup.py
@@ -0,0 +1,19 @@
from distutils.core import setup
from yarp import __version__

setup(
name = 'yarp',
version = __version__,
license = 'GPLv3',
packages = [ 'yarp' ],
scripts = [ 'yarp-carver', 'yarp-print', 'yarp-timeline' ],
description = 'Yet another registry parser',
author = 'Maxim Suhanov',
author_email = 'no.spam.c@mail.ru',
classifiers = [
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Development Status :: 4 - Beta'
]
)

0 comments on commit 6ad45ea

Please sign in to comment.