Skip to content

Commit

Permalink
Merge master for StartTLS update
Browse files Browse the repository at this point in the history
  • Loading branch information
SAERXCIT committed Apr 30, 2022
2 parents 9fce194 + b37fd99 commit f93922e
Show file tree
Hide file tree
Showing 27 changed files with 1,750 additions and 511 deletions.
24 changes: 24 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Rules to label Pull Requests
version: 1
labels:
- label: "Examples"
files:
- "examples/.*"
- label: "Library"
files:
- "impacket/.*"
- label: "CI/CD & Tests"
files:
- "tests/.*"
- "tox.ini"
- "Dockerfile"
- ".github/.*"
- label: "Setup"
files:
- "setup.py"
- "requirements*.txt"
- "MANIFEST.in"
- label: "Docs"
files:
- "*.md"
- "LICENSE"
2 changes: 0 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ jobs:
python-version: ["3.6", "3.7", "3.8", "3.9"]
experimental: [false]
include:
- python-version: "2.7"
experimental: true
- python-version: "3.10"
experimental: true
continue-on-error: ${{ matrix.experimental }}
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# GitHub Action workflow to label Pull Requests
#

name: Label PRs

on:
- pull_request

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: srvaroa/labeler@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion examples/dpapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ def run(self):
entropy = fp2.read()
fp2.close()
elif self.options.entropy is not None:
entropy = b(self.options.entropy) + b'\x00'
entropy = b(self.options.entropy)
else:
entropy = None

Expand Down
23 changes: 21 additions & 2 deletions examples/exchanger.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ def __init__(self):
self.__handler = None

self.htable = {}
self.anyExistingContainerID = -1

self.props = list()
self.stat = nspi.STAT()
self.stat['CodePage'] = nspi.CP_TELETEX
Expand Down Expand Up @@ -283,6 +285,20 @@ def load_htable_stat(self):
self.htable[MId]['count'] = self.stat['TotalRecs']
self.htable[MId]['start_mid'] = self.stat['CurrentRec']

def load_htable_containerid(self):
if self.anyExistingContainerID != -1:
return

if self.htable == {}:
self.load_htable()

for MId in self.htable:
self.update_stat(MId)

if self.stat['CurrentRec'] > 0:
self.anyExistingContainerID = NSPIAttacks._int_to_dword(MId)
return

def _parse_and_set_htable(self, htable):
self.htable = {}

Expand Down Expand Up @@ -444,6 +460,9 @@ def req_print_table_rows(self, table_MId=None, attrs=[], count=50, eTable=None,
printOnlyGUIDs = False
useAsExplicitTable = False

if self.anyExistingContainerID == -1:
self.load_htable_containerid()

if table_MId == None and eTable == None:
raise Exception("Wrong arguments!")
elif table_MId != None and eTable != None:
Expand Down Expand Up @@ -531,7 +550,7 @@ def req_print_table_rows(self, table_MId=None, attrs=[], count=50, eTable=None,
eTableInt = eTable

resp = nspi.hNspiQueryRows(self.__dce, self.__handler,
ContainerID=0, Count=count, pPropTags=attrs, lpETable=eTableInt)
ContainerID=self.anyExistingContainerID, Count=count, pPropTags=attrs, lpETable=eTableInt)

try:
# Addressing to PropertyRowSet_r must be inside try / except,
Expand Down Expand Up @@ -939,7 +958,7 @@ def localized_arg(bytestring):
guid_known.add_argument('-output-file', action='store', help='Output filename')

dnt_lookup = nspi_attacks.add_parser('dnt-lookup', formatter_class=SmartFormatter, help='Lookup Distinguished Name Tags')
dnt_lookup.add_argument('-lookup-type', choices=['EXTENDED', 'FULL', 'GUIDS'], nargs='?', default='MINIMAL',
dnt_lookup.add_argument('-lookup-type', choices=['EXTENDED', 'FULL', 'GUIDS'], nargs='?', default='EXTENDED',
help='R|Lookup type:\n'
' EXTENDED - Request extended set of fields (default)\n'
' FULL - Request all fields for each row\n'
Expand Down
Loading

0 comments on commit f93922e

Please sign in to comment.