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.
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.
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.
* I create a new parameters group called 'connection' where you can specify the destination port, the domain controller IP and the target IP (if needed)
* We should propagate the same schema over the rest of the scripts (whenever applicable)
* Aiming at addressing https://github.com/CoreSecurity/impacket/issues/172
Since impacket scripts use '@' as delimiter between the password and the IP address, a password with '@' (eg. 16char@Password) breaks the authentication.
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
jack:examples beto$ klist
Credentials cache: FILE:/Users/beto/ccache
Principal: normaluser7@FREEFLY.NET
Issued Expires Principal
Jan 8 20:11:32 2015 Jan 9 06:11:32 2015 krbtgt/FREEFLY.NET@FREEFLY.NET
jack:examples beto$ python psexec.py -k -no-pass freefly.net/normaluser7@freefly-dc cmd.exe
Impacket v0.9.13-dev - Copyright 2002-2015 Core Security Technologies
Trying protocol 445/SMB...
Using Kerberos Cache: /Users/beto/ccache
Using TGT from cache
[*] Requesting shares on freefly-dc.....
[*] Found writable share ADMIN$
[*] Uploading file oaZRkqjh.exe
[*] Opening SVCManager on freefly-dc.....
[*] Creating service gpvj on freefly-dc.....
[*] Starting service gpvj.....
Using Kerberos Cache: /Users/beto/ccache
Using TGT from cache
Using Kerberos Cache: /Users/beto/ccache
[!] Press help for extra shell commands
Using TGT from cache
Using Kerberos Cache: /Users/beto/ccache
Using TGT from cache
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\system32>whoami
nt authority\system
C:\Windows\system32>