Commit Graph

44 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
trietend e9a47ffc2b allow to pass commands to mssqlclient.py via command line (#1770)
* allow to pass commands to mssqlclient.py via command line

* Changed parameter name and nargs value as suggested

Co-authored-by: Gabriel Gonzalez <gabriel.gonzalez@fortra.com>

* Update examples/mssqlclient.py

---------

Co-authored-by: Gabriel Gonzalez <gabriel.gonzalez@fortra.com>
2024-12-06 08:26:10 -03:00
gabrielg5 27e7e7478d Updating copyright banner... 2024-08-28 17:52:57 -03:00
Palkovsky 82267d842c mssqlclient: Add -target-ip (#1648)
* mssqlclient: Enable Kerberos authentication without DNS lookup

* Group connection parameters under 'connection'
2024-01-16 00:06:39 -03:00
Gabriel Gonzalez 9b4a139405 Updated Copyright to 2023 2023-07-31 11:48:28 -03:00
Sylvain Heiniger 31db305578 Make class SQLSHELL accessible outside of the mssqlclient.py example (#1535)
* Make class SQLSHELL accessible outside of the mssqlclient.py example

* Separate mssqlshell.py from mssqlclient.py

* Fix import

* Add interactive SQL shell to MSSQL attack in ntlmrelayx
2023-05-09 18:29:35 -03:00
leandro d4c06e7f16 Merge pull request #1397 from Mayfly277/master
mssqlclient.py commands and prompt improvements
2023-02-16 01:35:20 -03:00
Gabriel Gonzalez 8799a1a2c4 Update file banners to reflect Fortra ownership 2022-12-14 17:28:23 -03:00
Mayfly277 86a5cbf8a1 mssqlclient.py commands and promt improvements 2022-09-12 23:24:54 +02:00
João Melo 02c0dbcc77 fix typo that made sp_start_job unusable
commands are found by prepending the `do_` prefix to the function name, and `sp_start_job` function name is missing the `do_` prefix so it is impossible to call it.
2022-05-01 19:34:50 +01: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
Arseniy Sharoglazov 2deb6ed449 Fixing store_true default value 2020-09-12 00:33:14 +03:00
asolino 8d4c91481b Print Library's installation path by default when -debug is specified 2020-02-05 19:52:39 -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 948deadebe mssqlclient.py, mssqlinstance.py Python3 ports
- tds.py ported as well
2018-10-12 16:39:47 -03:00
asolino 9d8638cdf1 Print traceback info if running in DEBUG mode 2018-05-04 18:25:44 -03:00
Michael Kissner ff03fbfd25 Job set to always delete 2018-02-06 20:37:07 +01:00
Michael Kissner 84335395b7 Added alternative method to execute cmd's on MSSQL 2018-02-06 20:20:38 +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 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 8c04d96979 Updating copyright notice. Welcome 2016 2016-01-06 14:08:30 -03:00
Saurabh Harit 6913c13270 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:52:20 -05: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 6ff37c74c9 Catching exceptions when login in. 2015-06-24 18:01:07 -03:00
asolino b28a55bc4d Adding Kerberos support to TDS (MSSQL)
- Pass the hash/ticket/key support
- mssqlclient.py: added -k, -aesKey flags
2015-06-24 17:29:25 -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 d5238f0817 Adding small description when calling the scripts w/no arguments 2015-03-20 19:25:53 +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 5eeeb4cf23 Changed command line.. -windows-auth is enough to specify windows auth will be used (no need to put True) 2013-10-17 20:21:17 +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 2e692c3cfb Added commands to the shell:
1) lcd {path}                 - changes the current local directory to {path}
2) enable_xp_cmdshell         - you know what it means
3) disable_xp_cmdshell        - you know what it means
4) xp_cmdshell {cmd}          - executes cmd using xp_cmdshell
5) ! {cmd}                    - executes a local shell cmd

Just to show what can be done..
2012-07-23 18:05:18 +00:00
bethus@gmail.com 1a0ed117f1 Added -file option to specify a file with commands 2012-07-21 23:08:49 +00:00
bethus@gmail.com 8dde582908 Don't get into the SQL Shell if auth failed 2012-07-21 21:38:10 +00:00
bethus@gmail.com 9c52f90527 Oops.. w/o printing the error 2012-07-20 23:40:40 +00:00
bethus@gmail.com c2594c95f2 Don't exit if something goes wrong 2012-07-20 23:39:51 +00:00
bethus@gmail.com cba4a5862e Windows auth by default is False 2012-07-20 20:53:05 +00:00
bethus@gmail.com 931a714a65 A simple MSSQL client 2012-07-20 20:51:48 +00:00