Mike Auty
9824538bd9
Numerous pycharm warnings resolved
...
This includes:
* Better ways of checking empty lists
* Not shadowing builtin functions like filter
* Preventing invalid slash warnings by marking strings as regexps
* Removing unnecessary brackets
* Lowercase variable names
* Adding/updating parameters in docstrings
* Removing unused code (lines not chunks)
* Change in not a member tests
* Changing some methods to static
* Shorting range membership checks
* Missing parameters
* Make some exception handlers more specific
* Don't define a lambda to a variable
* A few more instance checks to help type checkers
2018-12-16 13:21:06 +00:00
Mike Auty
29d41470a4
Mass reformat of typing imports
...
Relented on the strict import of direct objects/classes for the typing
module only. Typing module components can be directly imported because
it makes the code really painful to read and write otherwise.
This is still in-line with the python style guide adopted from Google at
http://google.github.io/styleguide/pyguide.html section 2.2.
2018-12-16 13:04:22 +00:00
Mike Auty
d9369001d4
Ensure we can cache the linux/mac banners.
2018-12-13 21:23:59 +00:00
Mike Auty
6e43d0bab4
Bring the aslr_mask_symbol_table methods in sync (even though mac never uses it).
2018-12-13 15:56:24 +00:00
Mike Auty
5135215c62
Do some tidying and renaming.
2018-12-13 15:56:24 +00:00
Mike Auty
7a462d5f85
Refactor out the shared symbol cache/finder code from linux and mac.
2018-12-13 15:56:24 +00:00
Mike Auty
55286f04cb
Consolidate identical code into a single symbol cache, add mac automagic list and pycharm reformat.
2018-12-13 15:56:24 +00:00
Mike Auty
1a5c9d3af8
Roll symbols.utility into symbols file until we get enough functions we need to split them out again.
2018-12-12 23:38:01 +00:00
Mike Auty
918653e398
Convert aslr_mask_symbol_table to more parameterized form.
2018-12-08 17:55:13 +00:00
Mike Auty
3f2f3cd2f3
Add a reminder to fix up the API in this place.
2018-12-03 21:52:29 +00:00
Mike Auty
e27ba8d089
Fix up naming for objects/symbols_utility imports.
2018-11-08 00:48:38 +00:00
Mike Auty
ac0f1a2cd0
Fix up a remaining typo, and two typing questions.
2018-11-08 00:19:17 +00:00
Mike Auty
db7320e426
Bulk lint and a couple of typos fixed.
2018-11-08 00:19:17 +00:00
Andrew Case and ikelos
c6ca2666b6
Update aslr calculation to correctly handle physical shifts and also to cache results
2018-11-08 00:19:17 +00:00
Andrew Case and ikelos
625952680a
mass convert hasattr -> has_member
2018-11-08 00:19:17 +00:00
Andrew Case and ikelos
b868f41c95
Fix get_path_file call
2018-11-08 00:19:17 +00:00
Andrew Case and ikelos
6254538371
Properly use expeption type
2018-11-08 00:19:17 +00:00
Andrew Case and ikelos
a015e69b84
Update the use of symbols and objects class and add comments about dentry traversal
2018-11-08 00:19:17 +00:00
Andrew Case and ikelos
a8adf4eaea
Fix find_aslr for swapper isgnature and throwing exception instead of returning None
2018-11-08 00:19:17 +00:00
Andrew Case and ikelos
98e472e211
major updates and new plugins
2018-11-08 00:19:17 +00:00
Mike Auty
d829028a36
Apply various type annotation/bug fixes.
2018-10-05 00:16:42 +01:00
Mike Auty
701c56558b
Fix a typo from the big refactor in commit 190ffaf2.
2018-09-28 12:51:55 +01:00
Mike Auty
00a118a06a
Reduce return results from find_requirements.
2018-09-23 22:24:44 +01:00
Mike Auty
190ffaf28b
Refactor where certain types of requirement live (given they're more concrete than interface).
2018-09-20 16:14:57 +01:00
Mike Auty
abee0f8de7
Change the ASLR finding code to return no shift values (and log when it's found none).
2018-09-03 21:48:16 +01:00
Mike Auty
0c46da22c3
Readd the check to ensure we don't stack on top of an existing Intel layer.
2018-09-02 19:03:39 +01:00
Mike Auty
7f966901cf
Ensure the dtb can't get specified from an earlier run around the loop.
2018-09-02 18:28:59 +01:00
Mike Auty
c1dc36a327
Fix up the breakage from the preivous commit.
2018-09-02 18:27:28 +01:00
Mike Auty
29f1a0f216
Change the default state for stacking to ensure layer isn't set unless successful.
2018-09-02 17:42:55 +01:00
Mike Auty
3a6b4ad35c
Add in the has_member method for objects and templates.
2018-08-29 22:54:56 +01:00
Mike Auty
ffa54c45eb
Fix linux invalid keyword argument bug.
2018-06-20 22:15:42 +01:00
Mike Auty
113c23a66d
Last of the typing fix-ups.
2018-06-04 23:55:38 +01:00
Mike Auty
9512cbe9eb
Commit metadata changeset.
...
Layers now accept metadata dictionaries (and chain/stack them on top of
those from lower layers). Metadata can only be set at construction
time, and the metadata dictionary is readonly. The hope is this will
make enumerating metadata keys across the codebase simpler.
The current metadata items that layers hold is:
architecture (Unknown | Intel32 | Intel64)
os (Unknown | Windows | Linux)
pae (bool)
page_map_offset (int)
This patchset may develop further to help enumerate all of these
(through a registration/reporting system).
2018-04-26 12:48:14 +01:00
Mike Auty
e362c50460
Ensure we don't run through signatures when we've found one that gives a layer.
2017-12-13 20:48:52 +00:00
Mike Auty
f40fae197d
Convert to python3.5 syntax (no local type-annotations).
2017-12-13 20:48:52 +00:00
Mike Auty
2cc456e847
Finish off the automagic directory type annotations.
2017-12-13 20:48:52 +00:00
Mike Auty
d7d13eb19c
Add type annotations to most of the automagic files.
2017-12-13 20:48:52 +00:00
Mike Auty
3a215c185e
Ensure the linux caching happens early, so the user doesn't have to run it twice.
2017-11-06 00:17:30 +00:00
Mike Auty
fd582f62e2
Fix a potential exception when earlier automagics don't succeed.
2017-11-04 18:54:52 +00:00
Mike Auty
d9d67efa3a
Add in the capability to stash linux_banners.
...
Since the stacker and Linux automagic will always be different objects
(even if they're the same class), and we don't want to add OS specific
code to the stacker, this is the simplest way of allowing the Linux
symbol automagic to get information from the dtb finding stacker.
2017-11-04 17:09:59 +00:00
Mike Auty
dab5caf104
Paths from the banner cache are already URIs, so we don't need to reconvert them.
2017-11-04 15:52:02 +00:00
Mike Auty
01043b9f3e
Rework isf_filename to isf_url since we can load it from a remote location if required.
2017-11-04 15:47:52 +00:00
Mike Auty
946fbd5e61
Use the convenience function built for exactly this circumstance.
2017-09-04 01:26:40 +01:00
Mike Auty
710043f508
Fix up the ASLR finding to compensate for older task_struct structures.
2017-09-03 23:16:22 +01:00
Mike Auty
a4bb32d797
Rework the linux automagic to include utility functions for finding the ASLR and KASLR shifts.
2017-09-03 21:51:11 +01:00
Mike Auty
6265fc4e2d
Catch errors if the stacker didn't manage to stack correctly.
2017-08-31 01:04:01 +01:00
Mike Auty
efdd961313
Prevent exceptions if there are no linux symboltables.
2017-08-11 00:05:50 +01:00
Mike Auty
9c8add5d5c
Ensure the dtb is not uninitialized.
2017-07-30 21:10:12 +01:00
Mike Auty
b7c8c8a058
Improve the docstrings for automagic.
2017-07-29 12:53:35 +01:00
Mike Auty
d34b344507
Ensure linux doesn't bog down windows searching.
2017-07-20 19:54:10 +01:00