Skip to content

Commit

Permalink
Merge branch 'fortra:master' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
GeisericII authored Aug 3, 2024
2 parents f553b93 + 6d8dd85 commit 18d2593
Show file tree
Hide file tree
Showing 17 changed files with 598 additions and 322 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,11 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10","3.11"]
experimental: [false]
os: [ubuntu-latest]
include:
- python-version: "3.6"
experimental: false
os: ubuntu-20.04
- python-version: "3.11-dev"
- python-version: "3.12-dev"
experimental: true
os: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
Expand Down
26 changes: 23 additions & 3 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ https://github.com/fortra/impacket/commits/master
1. Library improvements
* Removed dsinternals dependency (@anadrianmanrique)
* Fixed srvs.hNetrShareEnum returning erronous shares (@cnotin)
* Fixed lmhash computing to support non standard characters in the password (@anadrianmanrique)
* Assorted fixes when processing Unicode data (@alexisbalbachan)
* Added `[MS-GKDI]` Group Key Distribution Protocol implementation (@zblurx)
* Fixed incorrect padding in SMBSessionSetupAndX_Extended_ResponseData (@rtpt-erikgeiser)

2. Examples improvements
* [secretsdump.py](examples/secretsdump.py):
Expand All @@ -26,21 +30,37 @@ https://github.com/fortra/impacket/commits/master
* NTLMRelayX Multirelay fixes for target handling (@alexisbalbachan)
* Writes certificates to file rather than outputting b64 to console (@RazzburyPi)
* Improved ability to continue relaying to ADCS web enrollment endpoint in order to request multiple certificates for different users (@RazzburyPi)
* Fixed compatibility issue with other SMB clients connecting to the SOCKS proxy created by ntlmrelayx (@jfjallid)
* Allow configuration of the SOCKS5 address and port (@rtpt-erikgeiser)
* Fixed implementation of MSSQLShell (@gabrielg5)
* [getST.py](examples/getST.py):
* Added -self, -altservice and -u2u for S4U2self abuse, S4U2self+u2u, and service substitution (@ShutdownRepo)
* [reg.py](examples/reg.py):
* Start remote registry as unprivileged user in reg.py (@dadevel)
* [smbclient.py](examples/smbclient.py): Added ability to provide an output file that the smbclient mini shell will write commands and output to (@RazzburyPi)
* Allowing adding Binary values (@dc3l1ne)
* Add missing Null byte for REG_SZ values (@PfiatDe)
* [smbclient.py](examples/smbclient.py):
* Added ability to provide an output file that the smbclient mini shell will write commands and output to (@RazzburyPi)
* Fixed path parse issue when running `tree` command (@trietend)
* [DumpNTLMInfo.py](examples/DumpNTLMInfo.py):
* Allow execution on non-default ports (@jeffmcjunkin)
* Fixed KeyError exception when running with a Windows 2003 target (@XiaoliChan)
* [findDelegation.py](examples/findDelegation.py):
* Added new column to show if SPN exists (@p0dalirius)
* [mssqlclient.py](examples/mssqlclient.py):
* Added `-target-ip` parameter to allow Kerberos authentication without much change in the DNS configuration of the local machine (@Palkovsky)
* [mssqlshell.py](examples/mssqlshell.py):
* Switching back to original DB after running `enum_impersonate` command (@exploide)

3. New examples
* [describeTicket.py](examples/describeTicket.py): Ticket describer and decrypter. (@ShutdownRepo)
* [GetADComputers.py](examples/GetADComputers.py): Query's DC via LDAP and returns the COMPUTER objects and the useful attributes such as full dns name, operating system name and version. (@F-Masood)
* [readLAPS.py](examples/readLAPS.py): Tries to read all the LAPS password from the current domain computers. (@F-Masood)
* [GetLAPSPassword.py](examples/GetLAPSPassword.py): Extract LAPS passwords from LDAP (@zblurx and @dru1d-foofus)
* [dacledit.py](examples/dacledit.py): This script can be used to read, write, remove, backup, restore ACEs (Access Control Entries) in an object DACL (Discretionary Access Control List). (@_nwodtuhs) (@BlWasp_) (@Wlayzz)

As always, thanks a lot to all these contributors that make this library better every day (up to now):

@tomspencer @anadrianmanrique @ShutdownRepo @dadevel @gjhami @NtAlexio2 @F-Masood @BlWasp @gabrielg5 @XiaoliChan @omry99 @Wlayzz @themaks @alexisbalbachan @RazzburyPi
@tomspencer @anadrianmanrique @ShutdownRepo @dadevel @gjhami @NtAlexio2 @F-Masood @BlWasp @gabrielg5 @XiaoliChan @omry99 @Wlayzz @themaks @alexisbalbachan @RazzburyPi @jeffmcjunkin @p0dalirius @dc3l1ne @jfjallid @Palkovsky @rtpt-erikgeiser @trietend @zblurx @dru1d-foofus @PfiatDe

## Impacket v0.11.0 (Aug 2023):
Expand Down
12 changes: 9 additions & 3 deletions examples/lookupsid.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class LSALookupSid:
}

def __init__(self, username='', password='', domain='', port = None,
hashes = None, domain_sids = False, maxRid=4000):
hashes = None, domain_sids = False, use_kerberos = False, maxRid=4000):

self.__username = username
self.__password = password
Expand All @@ -50,6 +50,7 @@ def __init__(self, username='', password='', domain='', port = None,
self.__lmhash = ''
self.__nthash = ''
self.__domain_sids = domain_sids
self.__doKerberos = use_kerberos
if hashes is not None:
self.__lmhash, self.__nthash = hashes.split(':')

Expand All @@ -61,6 +62,7 @@ def dump(self, remoteName, remoteHost):
logging.info('StringBinding %s'%stringbinding)
rpctransport = transport.DCERPCTransportFactory(stringbinding)
rpctransport.set_dport(self.__port)
rpctransport.set_kerberos(self.__doKerberos)

if self.KNOWN_PROTOCOLS[self.__port]['set_host']:
rpctransport.setRemoteHost(remoteHost)
Expand Down Expand Up @@ -168,7 +170,11 @@ def __bruteForce(self, rpctransport, maxRid):

group.add_argument('-hashes', action="store", metavar = "LMHASH:NTHASH", help='NTLM hashes, format is LMHASH:NTHASH')
group.add_argument('-no-pass', action="store_true", help='don\'t ask for password (useful when proxying through smbrelayx)')

group.add_argument('-k', action="store_true",
help='Use Kerberos authentication. Grabs credentials from ccache file '
'(KRB5CCNAME) based on target parameters. If valid credentials '
'cannot be found, it will use the ones specified in the command '
'line')
if len(sys.argv)==1:
parser.print_help()
sys.exit(1)
Expand All @@ -190,7 +196,7 @@ def __bruteForce(self, rpctransport, maxRid):
if options.target_ip is None:
options.target_ip = remoteName

lookup = LSALookupSid(username, password, domain, int(options.port), options.hashes, options.domain_sids, options.maxRid)
lookup = LSALookupSid(username, password, domain, int(options.port), options.hashes, options.domain_sids, options.k, options.maxRid)
try:
lookup.dump(remoteName, options.target_ip)
except:
Expand Down
Loading

0 comments on commit 18d2593

Please sign in to comment.