Commit Graph

58 Commits

Author SHA1 Message Date
p0dalirius d4d60954ae Updated prompt regex
Removed debug comments
2021-10-08 12:18:08 +02:00
p0dalirius e0751ae142 Fixes #1079 psexec.py decoding problems on multi bytes characters, with py2 support 2021-10-03 14:02:18 +02:00
p0dalirius f0a3917d58 Fixes #1079 psexec.py decoding problems on multi bytes characters 2021-10-03 13:26:36 +02: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
Sam Free5ide cb9f7bf8f6 Rename get and put actions 2021-03-13 21:14:37 +03:00
5alt 6c7229fccb Fix reading binary file error while using custom exe file
Replace all `open(self.__exeFile)` to `open(self.__exeFile, 'rb')`
2020-09-02 13:29:05 +08:00
asolino afe746d2e2 Adding keytab support to secretsdump and remote exec scripts
- Added a loadKeysFromKeytab() class method into keytab.py for easier usage from the scripts.
2020-02-25 15:37:00 -03:00
asolino 8d4c91481b Print Library's installation path by default when -debug is specified 2020-02-05 19:52:39 -03:00
Alberto Solino fb723db3c0 Merge pull request #728 from GoSecure/more_flags
Added flags to SMBExec and PSExec to bypass badly made detection use cases
2020-01-07 16:47:48 -03:00
Maxime Nadeau e2fe6938dc Possibility to rename the PSExec uploaded binary name to avoid entropy-based detection use cases 2019-12-19 13:16:09 -05:00
0xdeaddood 0f6713f891 Add the timestamp option to the remote execution scripts 2019-12-18 08:17:41 -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 7eeff437c7 More code cleanup homework
- Optimizing imports
- Removing unused variables
- Still a lot to do.
- Test cases passing OK
2018-12-04 17:07:52 -03:00
asolino ec77ea3d06 Code cleanup homework
- Optimizing imports
- Removing unused variables
- Still a lot to do.
- Test cases passing OK
2018-12-04 14:47:16 -03:00
asolino 73d69315ad psexec.py (and related libs) port to Python3 2018-10-03 14:31:37 -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
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
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
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 01b0ae8e93 Better error control
* We should re-write ServiceInstall tho.. It's kind of messy
2016-09-13 23:15:23 -03:00
asolino 267ee5e065 Adding -port parameter to support 445/tcp and 139/tcp as destination ports
* 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
2016-07-01 16:07:33 -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
Saurabh Harit 827a5594bf Fixed the issue where a password with '@' breaks authentication
Since impacket scripts use '@' as delimiter between the password and the IP address, a password with '@' (eg. 16char@Password) breaks the authentication.
2015-11-20 02:51:17 -05:00
asolino 1a1e770bf8 Adding cp437 encoding/decoding
* Still not a final solution for will work much better on some foreign OSes
2015-09-23 10:58:57 -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 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 6fc56f05b9 psexec.py now defaults to executing cmd.exe if no command is specified
I don't know why I didn't do this before but more than one of you
fell on that little detail.
There might be a reson tho :s.. testing needed!
2015-05-01 18:53:22 -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 ff6a318df3 Adding -debug flag 2015-03-26 21:15:50 +00:00
bethus@gmail.com 25188dad4b Fixes kerberosLogin calling way 2015-03-20 19:46:52 +00:00
bethus@gmail.com 5a2a246f3d Adding TGT, TGS when receiving get_credentials() data 2015-03-20 19:21:09 +00:00
bethus@gmail.com f2ff812d3b Adding support for pass the key 2015-01-30 17:52:36 +00:00
bethus@gmail.com 29d18e8cfd Updated copyright 2015-01-20 22:53:16 +00:00
bethus@gmail.com bbce63a34a Clarifying target could be an IP address or targetName 2015-01-14 16:32:03 +00:00
bethus@gmail.com 700bbb6d9f Kerberos support (incl. ccache) for psexec.
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>
2015-01-09 00:03:02 +00:00
bethus@gmail.com 51208f4ed3 Added get_dce_rpc() method to the DCERPCTransport. Now clients don't need to cast a transport to a DCERPC_v5 or V4. That is handled by this method.
I'm changing the examples to reflect this move.
2013-10-29 16:04:19 +00:00
bethus@gmail.com 6cb08415db Removed the protocols options from the command line. It will try both 445 and 139 2013-10-17 19:55:31 +00:00
bethus f7d705ad1d Finally.. If no password is specified, it is asked to the user.. so you don't populate your history with passwords ;) 2013-09-23 22:34:53 +00:00
bethus@gmail.com 62cce192d3 Fix for http://code.google.com/p/impacket/issues/detail?id=29 2013-06-18 18:48:16 +00:00
bethus@gmail.com 9d2c14e0d7 dded option -c that would upload a file and execute it. Testing needed 2013-05-29 00:38:30 +00:00
bethus@gmail.com 02c3d7b751 Reading the StdErr pipe using readFile() now.. Makes it work 2012-09-06 04:26:22 +00:00
bethus@gmail.com 7909c32920 global dialect variable added, once the first SMB connection is made, we hold the chosen dialect there, speeds up the process for w2k and xp 2012-08-25 22:09:27 +00:00