Commit Graph

584 Commits

Author SHA1 Message Date
asolino 3e0938ef28 Improved support for Unicode Strings inside and ENCODED_STRING value
* In those cases where a list of items was parsed, there were some inconsistencies
* Should address https://github.com/CoreSecurity/impacket/issues/304
* Further testing is needed to be sure we're not breaking anything else.
2017-08-15 17:54:16 -03:00
asolino 049f2831f5 Matching output with rpcdump.py 2017-08-11 14:27:01 -03:00
asolino 9325006d90 Making output a little bit nicer
* Instead of printing the UUID tuple, I break it down in UUID and version
2017-08-07 15:53:04 -03:00
asolino 1a3beb60f2 Changing Service Creation flags
* Following @ldionmarcil advise (https://github.com/byt3bl33d3r/CrackMapExec/pull/197) to avoid issues with multiple server's reboot in those cases where the service couldn't be deleted for some reason.
2017-08-07 11:07:33 -03:00
Ronnie Flathers 71dae11519 changed option name to reflect more than just users 2017-07-18 17:11:33 -05:00
Ronnie Flathers b04f2cb6d7 added no-pass and domain-users options 2017-07-18 17:57:29 -05:00
asolino cf14e7cd77 Clarifications in the script's comments 2017-07-14 17:52:39 -03:00
Ronnie Flathers 0ae4ab0147 added command line switch '-all-users' 2017-07-14 12:47:06 -05:00
Ronnie Flathers 59b99e76c0 removed email=* filter, added objectCategory filter) 2017-07-13 16:22:45 -05:00
asolino a1523f32ee Not needed anymore 2017-07-07 12:07:13 -03:00
asolino d285faf2ea Adding SOCKS proxy support for relayed connections
* Use -socks switch when running smbrelayx.py
* SOCKS4 and SOCKS5 should work
* Bypass logoff attempts and sends keep alive packets to keep connections open
* Lots of things to improve, mainly dynamic subscriptions of port handlers so we
can add protocol handlers easier (e.g. MSSQL, HTTP, etc)
* Testing needed. Porting to ntlmrelayx.py soon.
2017-07-05 11:59:25 -03:00
asolino b755ca4d7c Adding -target-ip switch.
- This allows to specify both the dc-ip and the target-ip. In theory we wouldn't need DNS resolve.
- Might help addressing https://github.com/CoreSecurity/impacket/issues/285
2017-06-29 11:40:25 -03:00
asolino b3826dee41 Print stacktrace messages if DEBUG logging is enabled
- This will make things easier for troubleshooting, for example https://github.com/CoreSecurity/impacket/issues/285
2017-06-29 09:45:38 -03:00
asolino 371a9a80c8 First try at supporting RPC_IN_DATA / RPC_OUT_DATA
* Testing needed.. Might break things
* Whenever it's ready I'll add it to ntlmrelayx.py
2017-06-15 13:46:15 -03:00
asolino a5af417c70 Changing default encoding if -codec if not specified
* Should fix https://github.com/CoreSecurity/impacket/issues/260
2017-06-09 12:04:39 -03:00
asolino 5f8f84e948 Better (hopefully) codec support 2017-06-09 11:16:45 -03:00
asolino 287cb2fe2c Support for samba 3.5.x
* In those versions, the first byte is stripped, hence we're sending a '/' extra at the beginning of the buffer
* Doesn't seem to affect 4.x versions
* Also, have in mind that in 3.5.x you need to create a .so exporting init_samba_module(), whereas in 4.x it is samba_init_module()
2017-06-07 16:27:40 -03:00
asolino 9733943d58 Adding -exec-method
* Allows to chose different exec methods when -use-vss mode is chosen:
1. smbexec (default): Creates a service executing the desired commands
2. wmiexec: Executes commands through Win32Process.Create() API
3. mmcexec: Executes commands through DCOM MMC object (Kerberos not supported here)
2017-06-03 19:29:26 -03:00
asolino ea6df99e49 Opening the file as binary to make Windows happy
* Thanks @gentilkiwi for the tests
* More verbose message when receiving the answer from the server
2017-05-30 22:18:23 -03:00
asolino aa23896d95 If no command is specified we should exit.
* There's no interactive shell with this script. Command is needed
2017-05-30 18:00:55 -03:00
asolino 32e71ef236 Adding sambaPipe example
This script will exploit CVE-2017-7494, uploading and executing the shared library specified by the user through
the -so parameter.

The script will use SMB1 or SMB2/3 depending on the target's availability. Also, the target share pathname is
retrieved by using NetrShareEnum() API with info level 2.

Example:

./sambaPipe.py -so poc/libpoc.linux64.so bill@10.90.1.1

It will upload the libpoc.linux64.so file located in the poc directory against the target 10.90.1.1. The username
to use for authentication will be 'bill' and the password will be asked.

./sambaPipe.py -so poc/libpoc.linux64.so 10.90.1.1

Same as before, but anonymous authentication will be used.
2017-05-29 15:48:41 -03:00
asolino 0cc150e599 Setting some parameters as required
* Since they are required ;)
2017-04-21 12:48:07 -03:00
asolino cf246b593f Forgot to decode the stdin command received by the user.
* Should address https://github.com/CoreSecurity/impacket/issues/260
2017-04-01 17:08:39 -04:00
asolino 6b7514a0d8 Using the same SMB Connection when binding to EPM and MIMI
* No need to create two separate ones
* Fixed a bug in EPM that would disconnect the SMB Server
2017-03-21 21:00:45 -03:00
asolino 067c871807 Doing epm search thru SMB if possible 2017-03-21 18:26:21 -03:00
asolino e9ed12e6aa Forgot to switch to Kerberos (in the right way) when -k is specified
* Also, when possible, use ncacn_np
2017-03-21 16:47:35 -03:00
asolino b7c35ec9b6 Mini shell to control a remote mimikatz RPC server developed by @gentilkiwi
* Inital version. Several interesting things to add in the future :)
2017-03-19 16:14:22 -03:00
asolino 0e80fa9137 Adding getArch.py example
This script will connect against a target (or list of targets) machine/s and gather the OS architecture type
installed.
The trick has been discovered many years ago and is actually documented by Microsoft here:
https://msdn.microsoft.com/en-us/library/cc243948.aspx#Appendix_A_53
and doesn't require any authentication at all.

Have in mind this trick will *not* work if the target system is running Samba. Don't know what happens with macOS.
2017-03-14 13:13:47 -03:00
asolino 441e915529 Adding -codec parameter
* Sets encoding used (codec) from the target's output (default "ascii").
If errors are detected, run chcp.com at the target, map the result with
https://docs.python.org/2.4/lib/standard-encodings.html and then execute
wmiexec.py again with -codec and the corresponding codec.
Especially useful when running this script against non-english systems.

* It can be used also by other protocols, since the encoding chosen is set in the NTLMRelayxConfig instance.

* Adds on top https://github.com/CoreSecurity/impacket/commit/589490d8c8cd2bba10321c8fce9f2e1fa8c3a408#commitcomment-21015813 that was only for smbrelayx.py
2017-02-24 11:55:00 -03:00
asolino c814049996 Adding support LDAP paged search support to GetADUsers.py
* Will now work when there are more than 1000 records
* Also fixes a small bug in the library when decoding the cookies
2017-02-23 10:21:43 -03:00
asolino 589490d8c8 Adding -codec parameter
* Sets encoding used (codec) from the target's output (default "ascii").
If errors are detected, run chcp.com at the target, map the result with
https://docs.python.org/2.4/lib/standard-encodings.html and then execute
wmiexec.py again with -codec and the corresponding codec.
Especially useful when running this script against non-english systems.

* Addresses https://github.com/CoreSecurity/impacket/issues/254
2017-02-22 10:10:55 -03:00
asolino 6c34701623 Adding -codec parameter
* Sets encoding used (codec) from the target's output (default "ascii").
If errors are detected, run chcp.com at the target, map the result with
https://docs.python.org/2.4/lib/standard-encodings.html and then execute
wmiexec.py again with -codec and the corresponding codec.

Especially useful when running this script against non-english systems.
2017-02-20 17:48:26 -03:00
asolino 2f69f9330d Typo on Ben's surname
:)
2017-02-02 15:38:53 -03:00
asolino 5a6e247585 Adding getPac.py example
This script will get the PAC of the specified target user just having a normal authenticated user credentials.
It does so by using a mix of [MS-SFU]'s S4USelf + User to User Kerberos Authentication.
Original idea (or accidental discovery :) ) of adding U2U capabilities inside a S4USelf by Benjamin Delphi (@gentilkiwi)

References:

U2U: https://tools.ietf.org/html/draft-ietf-cat-user2user-02
[MS-SFU]: https://msdn.microsoft.com/en-us/library/cc246071.aspx
2017-02-02 11:40:54 -03:00
asolino 03c5bc63bc Giving some hints when target is enforcing SPN validation 2017-01-25 09:35:09 -03:00
asolino f0b5b8f617 Be more flexible about the target SPN to use
* When connecting to target systems
* Also, don't give up if the SMBConnection didn't work, we might be still lucky at the DRSUAPI layer
2017-01-24 16:10:29 -03:00
martin_uy 37e40a732e In the context of Issue #69:
* IPv6 interface aligned to IPv4 interface.
2017-01-23 18:53:32 -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 ea9f61d02e Quitting MMC when executing a single command from command-line
* mmc.exe was still running at the target server
2017-01-10 23:15:41 -03:00
asolino a0f5bd265d Adding mmcexec.py example
A similar approach to wmiexec but executing commands through MMC.

Original discovery by Matt Nelson (@enigma0x3):
https://enigma0x3.net/2017/01/05/lateral-movement-using-the-mmc20-application-com-object/
2017-01-10 21:23:22 -03:00
asolino 2e9c5c2f30 Adding -csv switch to output format in CSV
* Partially addresses https://github.com/CoreSecurity/impacket/issues/237
2016-12-10 15:25:55 -03:00
asolino bf745b0e34 Adding PasswordLastSet, USER_DONT_EXPIRE_PASSWORD, USER_ACCOUNT_DISABLED and ScriptPath attributes
* Partially addresses https://github.com/CoreSecurity/impacket/issues/237
2016-12-10 14:58:26 -03:00
Dirkjan Mollema 72f3a7c974 ntlmrelayx - relaying to IMAP 2016-11-23 15:39:51 +01:00
Dirkjan Mollema 0da9b84f9f LDAP attack improvements 2016-11-16 13:06:16 +01:00
asolino 036e5bd778 Adding a -user-status display option
* Changing the (current-disabled) to (status=Enabled/Disabled)
* Moving that data to the end of the line, in alignment to the pwd-last-set display option
* Only supportted in VSS mode. DRSUAPI coming soon
2016-10-24 21:19:24 -03:00
asolino 2485f164fd Fixes anonymous connection flags.
* We shouldn't specify we're sending username / password when we're not.
2016-10-19 13:34:43 -03:00
asolino 8cef002928 Adding MQTT basic structures and example
* Minimalistic MQTT implementation, just focused on connecting, subscribing and publishing
  basic messages on topics.
* Simple MQTT example aimed at playing with different login options. Can be converted into
  a account/password brute forcer quite easily.
2016-10-18 15:22:21 -03:00
Dirk-jan 40e6471434 Added interactive SMB console via local socket 2016-10-06 22:33:12 +02:00
Dirk-jan 13843229ab Merge branch 'master' of github.com:CoreSecurity/impacket into ntlmrelayx-interactive 2016-10-06 19:15:29 +02:00
asolino 0afacbea5a Adding GetADUsers.py example script
This script will gather data about the domain's users and their corresponding email addresses. It will also
include some extra information about last logon and last password set attributes.
You can enable or disable the the attributes shown in the final table by changing the values in line 184 and
headers in line 190.
If no entries are returned that means users don't have email addresses specified.
2016-10-04 19:58:43 -03:00