Commit Graph

598 Commits

Author SHA1 Message Date
asolino 1a2195354d Adding -debug switch
* Useful for all I'm working on.
* Might also be useful to you ;)
2017-10-24 19:14:43 -03:00
asolino 35f539d53b Finishing gracefully when hitting CTRL-C 2017-10-16 09:41:48 -04:00
asolino 20a0821fe1 Minor clarifications in the initial documentation
* Mainly to differentiate it from smbrelayx.py
2017-10-16 09:40:33 -04:00
asolino 41232fdee1 Adding SOCKS support for HTTP->SMB scenario
* Already added to ntlmrelayx.py, forgot to add that here in the first place
2017-10-16 09:39:58 -04:00
Jim Shaver 3800dc1e50 Added support for DES Kerberoast 2017-10-12 11:14:22 -05:00
asolino 4cf3b07141 Merge branch 'Kerberoast-AES-final' of https://github.com/elitest/impacket into elitest-Kerberoast-AES-final 2017-09-26 10:49:40 -03:00
Symeon 21edeca04f Bug fix: Make psexec service start manual
Add also a "-service-name" parameter where a user can name the service.
2017-09-18 10:47:10 +01:00
asolino b852457d29 If stdout is redirected, default to UTF-8 encoding
* This was preventing using tee or redirect output to a file
* Reported by @tlathm in https://github.com/CoreSecurity/impacket/issues/319
2017-09-16 11:20:27 -03:00
asolino 859317dfff Do not logoff when the login didn't work
* It would raise USER_SESSION_DELETED and break this script functionality.
2017-09-15 16:32:59 -03:00
asolino 314b4ebfd3 Clarifications when receiving ERROR_DS_NAME_ERROR_NOT_UNIQUE
* Might help users how to get over this issue.
* If somebody knows how to avoid this from happening ping me.
2017-09-15 16:06:17 -03:00
Alberto Solino babb63e79a Merge pull request #313 from CoreSecurity/relay-experimental
Relay experimental
2017-09-12 18:32:06 -03:00
Jim Shaver 9943cf1af9 Added support for AES Kerberoast tickets 2017-09-10 18:15:27 -05:00
Federico Martinez 441afa723f returncode set to 1 when there is an error
If the connection fails, the exitcode is now set to 1. The behavior for KeyboardInterrupt is still only logging.
2017-08-31 12:25:18 -03:00
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
asolino 5c64e6c81e Adding plugin support for SOCKS functionality
- There a base class called SocksRelay that should be used as base class for SOCKS protocol plugins
- Any new plugin should be added to the impacket/examples/ntlmrelayx/servers/socksplugins directory
- These plugins will be automatically loaded when the SOCKS proxy is loaded.
- The idea is to add SockRelay plugins for any protocol we want (e.g. MSSQL, LDAP, HTTP, etc)
- Lots of testing needed.
2017-07-29 02:39:38 -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