Commit Graph

41 Commits

Author SHA1 Message Date
masterDeus d362ca74e9 Modified reg-key creation to assume persistent key creation with impacket-reg (#2113)
* Added flag functionality to specify that a created registry key should be volatile, and changed the default behavior to instead create non-volatile keys

* Reverted to default behavior and clarified description

- Reverted default behavior back to volatile keys
- Changed --volatile flag to --persistent
- Moved flag verification to subkey creation section
- Added printed warning that key is volatile if --permanent is not set (only in subkey creation)
- Clarified flag description.
2026-03-05 11:07:03 -03:00
omry99 96f362a2ae Fix typo in help message for registry value name (#2096) 2025-12-22 14:51:30 -03:00
Gabriel Gonzalez ae0ec300f8 Techdebt examples bootstrapping v2 (#1928)
* Standardized examples logger init method

* Fixing missing import

* Standardized examples init_ldap_session function #1

* Calling new shared function _ldap3_kerberos_login from example addcomputer

* Removed considering -debug in each example. Now it's handled in utils.

* Standardized EMPTY_LM_HASH in impacket.examples.utils

* Unify parse_identity function (phase 1)

* Standardized parse_identity

* Renamed "_ldap3_kerberos_login" to "ldap3_kerberos_login" (as it is called from outside)

* Standardize "logger" init in regsecrets.py

* Standardized LDAP login into a single function in utils.py:ldap_login
2025-03-26 22:58:39 -03:00
Jannik Vieten 835e17550b Fixed warnings with Python 3.12 (#1695)
* fixed SyntaxWarnings due to invalid escape sequence

* fixed DeprecationWarning since datetime.datetime.utcnow() is deprecated in Python 3.12+

* fixed DeprecationWarning since datetime.datetime.utcfromtimestamp() is deprecated in Python 3.12+
2024-10-24 09:00:11 -03:00
gabrielg5 27e7e7478d Updating copyright banner... 2024-08-28 17:52:57 -03:00
Gabriel Gonzalez 2571ce44d2 Support for adding REG_MULTI_SZ values through reg.py (#1785)
* Support for adding REG_MULTI_SZ values through reg.py

* Fixing default value for "-vd" in reg.py

* Fixing 2x null-bytes handling for REG_MULTI_SZ values in rrp.py

* Fixing check of 2x null-bytes ending REG_MULTI_SZ values

* Fixing how REG_MULTI_SZ are printed to stdout (query, add) - replacing \0 with \n

* Fixing output message when adding a new value in the registry using the "add" command of reg.py
2024-08-06 13:09:06 -03:00
pfiatde 8cb0b0af4e Update reg.py (#1753) 2024-07-23 12:10:13 -03:00
Dc3 608f426571 fix can't add when value is REG_BINARY (#1361)
* fix can't add when value is REG_BINARY

fix the issue that can't add key when value type is REG_BINARY

* Update examples/reg.py

Validate HEX length

Co-authored-by: Gabriel Gonzalez <gabriel.gonzalez@fortra.com>

---------

Co-authored-by: Dc3 <admin@dc3.es>
Co-authored-by: Gabriel Gonzalez <gabriel.gonzalez@fortra.com>
2024-03-26 18:43:39 -03:00
Daniel 2d00fc6a5d start remote registry as unprivileged user in reg.py (#1638)
* start remote registry as unprivileged user in reg.py

Trigger the start of the RemoteRegistry service as unprivileged user by opening the winreg named pipe.

* enable access to HKEY_USERS trough reg.py
2023-11-03 11:30:49 -03:00
Gabriel Gonzalez 9b4a139405 Updated Copyright to 2023 2023-07-31 11:48:28 -03:00
Gabriel Gonzalez 8799a1a2c4 Update file banners to reflect Fortra ownership 2022-12-14 17:28:23 -03:00
0xdeaddood 181827dda0 Merge branch 'add-dc-host-option' into dc-host-option
# Conflicts:
#	examples/GetADUsers.py
#	examples/GetNPUsers.py
#	examples/GetUserSPNs.py
#	examples/findDelegation.py
#	examples/raiseChild.py
2022-06-24 15:47:40 -03:00
0xdeaddood 7a18ef5c8b About to tag a release 2022-05-04 11:33:16 -03:00
Shutdown 9fee58daf0 Added a backup method saving SAM SYSTEM and SECURITY "at once"
Co-authored-by: scopedsecurity <zachhanley@gmail.com>
2022-02-17 01:49:48 +01:00
Shutdown ae1903d38b Fixed access denied on SECURITY hive
Co-authored-by: scopedsecurity <zachhanley@gmail.com>
2022-02-17 01:09:11 +01:00
Shutdown cfed931afe Adding save function for Backup Operators to Domain Admin exploitation 2022-02-16 15:18:46 +01:00
Gifts f40f86e846 Fix argument help to include HKCR (HKEY_CLASSES_ROOT)
Added relevant example to update empty value of Key.
2021-10-14 15:39:13 +03:00
Gifts 8c5eb3f53f Refactoring duplicate code to __strip_root_key function 2021-10-13 19:22:35 +03:00
Gifts cb84aaa28e Implementing reg.py DELETE functionality. 2021-09-22 21:12:47 +03:00
Gifts c588e99e9c Implementing reg.py ADD functionality in order to be able to modify remote registry.
Currently, modification of (Default) key is not implemented.
2021-09-22 15:46:33 +03:00
Martin Gallo cd4fe47cfc Arrange tagline, copyright and license notes across all source files
This was a pending change to:
- Use the same tagline, copyright and license notice across files.
- Remove authors' contacts that are no longer valid (due to affiliation changes).
- Update repository location.
- Update license file with missing licenses (althought those were already in source files).

This doesn't include any change on the source code, nor any change on current copyright or licenses. Just formatting and phrasing to make our and distro's maintainers life easier.
2021-07-20 10:04:27 -03:00
Martin Gallo adb230256d Refactored the target parsing functions (#1053)
In reviewing #1051 (and related #347) we found out that there's some ugly duplicated code that's better suited for an utils function.

The expected target format is:
`<DOMAIN></USERNAME><:PASSWORD>@HOSTNAME`

This PR:
- Moved target parsing routine to an utils module.
- Added unit tests for the new function.
- Using the new function across example scripts that accept a target.
2021-04-22 09:11:33 -03:00
Roman Maksimov cfe14a8741 fix string formatting 2020-05-13 14:21:00 +03:00
asolino 8d4c91481b Print Library's installation path by default when -debug is specified 2020-02-05 19:52:39 -03:00
asolino 553881b9da Merge branch 'master' into python36 2018-12-05 12:16:54 -03:00
asolino c328de8252 Changing Copyright notice 2018-12-05 12:14:55 -03:00
asolino 989c19cc91 RPC RRP port for Python3
- test_rrp.py passing (PY2 / PY3)
- reg.exe example working
2018-10-03 14:06:29 -03:00
luz.paz 0e96b60b92 Misc. typos
Found via `codespell -q 3 -I ../impacket-word-whitelist.txt` through downstream `curl`
2018-03-16 09:42:21 -04:00
Martin Gallo 4152e128b8 Replaced shebang with a virtualenv friendly one
Replaced all instances of `#!/usr/bin/python` with `#!/usr/bin/env python` so impacket's examples and scripts can be run inside a virtualenv without having to call python.
2017-01-11 12:43:54 -03:00
asolino c049506e43 Minor cosmetic changes 2016-09-13 23:54:50 -03:00
asolino 07723c6f12 Adding HKEY_CLASSES_ROOT query support 2016-07-28 15:20:48 -03:00
asolino 5ae1231c4d Adding query -ve parameter
* Queries for the default value or empty value name
* Some code correction
2016-07-17 19:37:46 -03:00
asolino d15d01c2fa Bugfixes
* Changing logic for __print_all_subkeys_and_entries() method
* Striping NULL character when printing lpNameOut
* Better error control when an exception is triggered
2016-07-08 22:04:41 -03:00
asolino 04310006e4 Restoring the right order in enableRegistry() and adding a warning message
* In case we cannot check the RemoteRegistry status. We'll continue and hope for the best
2016-07-06 22:01:29 -03:00
asolino 1a29f0ae3c Fixed bug where KeyName wasn't printed correctly when -s switch used 2016-07-06 21:14:55 -03:00
asolino f27c39da23 Continuing if there are keys that cannot be opened 2016-07-06 20:58:01 -03:00
asolino e08966ef10 Continuing if we cannot connect to SCMR to check RemoteRegistry state
* Maybe a low level user connecting? :-o!
2016-07-06 20:36:30 -03:00
asolino b13acf3e64 Automatically enables/starts/stops/disables the RemoteRegistry service when needed
* Also part of https://github.com/CoreSecurity/impacket/issues/127 requests
* Commented actions yet not implemented
2016-07-04 19:10:59 -03:00
asolino 4e3ebc43c0 Minor cosmetic changes
* Copyright notices
* Variable renamings
* Reusing library code
* minor logic flow changed
2016-07-04 15:47:05 -03:00
mporto e950f158f3 Typo 2016-06-24 12:23:18 -03:00
mporto 6f999e5756 Reg example with partial query functionality 2016-06-24 12:20:43 -03:00