Commit Graph

28 Commits

Author SHA1 Message Date
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
Julien Egloff 075f2b10a7 Use logging.info to handle -ts switch properly (#1884)
Co-authored-by: laxa <laxa@ddracepro.net>
2025-02-06 10:09:53 -03:00
gabrielg5 27e7e7478d Updating copyright banner... 2024-08-28 17:52:57 -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
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 a45f331360 Refactored the credentials parsing functions (#1058)
Similar to and on top of #1053, this moves the credentials/account parsing regex to an utils module and reduces duplicated code in example scripts.

The expected credential format is:
`<DOMAIN></USERNAME><:PASSWORD>`

Note that the regular expression used in `exchanger.py` was different (excluded ':' from the hostname) but I didn't found any reason to keep it different from all other scripts.

This PR:
- Moved credentials parsing routine to an utils module.
- Added unit tests for the new function.
- Using the new function across example scripts that accept a credential/account.
2021-04-22 10:02:29 -03:00
Christian Clauss 7532caabc7 Avoid SyntaxWarning on Python >= 3.8
Avoid [SyntaxWarnings on Python >= 3.8](https://docs.python.org/3/whatsnew/3.8.html#porting-to-python-3-8).

% `python3.8`
```
>>> "" is ""
<stdin>:1: SyntaxWarning: "is" with a literal. Did you mean "=="?
```
2020-08-27 21:26:51 +02:00
Arseniy Sharoglazov abb991572d Normalizing [domain/]user[:password] regexps to the right one 2020-04-02 07:33:52 +03:00
asolino 8d4c91481b Print Library's installation path by default when -debug is specified 2020-02-05 19:52:39 -03:00
0xdeaddood 97d2336d81 Add the timestamp option to several scripts
- lookupsid.py, netview.py, ntlmrelayx.py, raiseChild.py, samrdump.py, smbrelayx.py
2019-12-18 09:13:27 -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 4e67af4ef1 netview.py Python3 port 2018-10-09 13:40:20 -03:00
asolino 9d8638cdf1 Print traceback info if running in DEBUG mode 2018-05-04 18:25:44 -03:00
asolino 0b28d94832 Using raise the right way + removing print from traceback.print_exc() 2018-05-03 21:21:36 -03: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 1bdba48374 Adding -dc-ip option to examples
* Allows to specifying the IP address for the DC/kdcHost
* Collateral for https://github.com/CoreSecurity/impacket/issues/160
2016-05-31 21:22:54 -03:00
asolino a8576c0172 Reformatting some code 2016-05-20 21:16:15 -03:00
asolino 8c04d96979 Updating copyright notice. Welcome 2016 2016-01-06 14:08:30 -03:00
asolino 8c094b7998 Adding eXecute permissions to the scripts, fixing https://github.com/CoreSecurity/impacket/issues/71 2015-06-25 09:50:19 -03:00
asolino a28d3d0192 Catching DCERPCException instead of Exception
More realistic since we're then calling get_packet()
2015-06-07 23:00:13 -03:00
asolino 4e32a0d498 Removing some pyCharm's erros/warnings
More scripts/libs changed. Hopefully doesn't break a thing. Test cases are passing
2015-05-25 20:40:17 -03:00
asolino 8b8f8a6947 Pyton imports fixups
1) Removed unnecesary imports, avoid import * whenever possible
2) Copyright updated
3) Minor typos fixed
4) File formats to Unix (LF)
2015-05-23 11:56:59 -03:00
asolino 4c2e64ad3a Second round of logging change.
Now there should be a single logger called 'impacket' the library uses.
By default is has a NullHandler so nothing is printed, but messages are
forwarded to the upstream logger.

If you are a script using the library and want to set the root logger
with a custom formatter, you can import impacket.examples.logger.

After some testing I'll merge it into master
2015-04-25 14:40:42 -03:00
asolino 119e4438dd Changing logging mechanisms everywhere.
Full details coming soon
2015-04-25 14:40:41 -03:00
bethus@gmail.com 82ec2f4f0d The idea of this script is to get a list of the sessions
opened at the remote hosts and keep track of them.
   Coincidentally @mubix did something similar a few years
   ago so credit goes to him (and the script's name ;)).
   Check it out at https://github.com/mubix/netview
   The main difference with our approach is we keep 
   looping over the hosts found and keep track of who logged
   in/out from remote servers. Plus, we keep the connections
   with the target systems and just send a few DCE-RPC packets.

   One VERY IMPORTANT thing is:
   
   YOU HAVE TO BE ABLE TO RESOLV THE DOMAIN MACHINES NETBIOS 
   NAMES. That's usually solved by setting your DNS to the 
   domain DNS (and the right search domain).
   
   Some examples of usage are:

   netview.py -target 192.168.1.10 beto
   
   This will show the sessions on 192.168.1.10 and will authenticate as 'beto'
   (password will be prompted)

   netview.py FREEFLY.NET/beto

   This will download all machines from FREEFLY.NET, authenticated as 'beto'
   and will gather the session information for those machines that appear
   to be up. There is a background thread checking aliveness of the targets
   at all times.

   netview.py -users /tmp/users -domainController freefly-dc.freefly.net -k FREEFLY.NET/beto
  
   This will download all machines from FREEFLY.NET, authenticating using
   Kerberos (that's why domainController parameter is needed), and filter
   the output based on the list of users specified in /tmp/users file.
2015-04-06 15:42:42 +00:00