Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse_target doesn't accept target specifier with back slash delineated Domain\Username format #1527

Open
xchg-rax-rax opened this issue Apr 16, 2023 · 0 comments · May be fixed by #1581
Open
Assignees
Labels
waiting for response Further information is needed from people who opened the issue or pull request

Comments

@xchg-rax-rax
Copy link

parse_target in impacket/impacket/examples/utils.py is the function responsible for parsing the target specifier (eg. ARCHETYPE/sql_svc:M3g4c0rp123@10.129.203.99) from the command line arguments of the tools in examples.

The canonical format for a domain+user specifier used by windows is DOMAIN\Username with the domain and a username separated by a backslash.
The current implementation of parse_target only accepts specifiers of the form DOMAIN/Username, with a forward slash, and will misinterpret the domain to be part of the username in the event that a backslash is used instead.

The regular expression used to parse the command line argument should be modified to accept both formats.

This could be achieve by replacing the one currently used with the following:

(?:(?:([^\/\\@:]*)[\/\\])?([^@:]*)(?::([^@]*))?@)?(.*)
@alexisbalbachan alexisbalbachan self-assigned this Jun 28, 2023
@gabrielg5 gabrielg5 added the waiting for response Further information is needed from people who opened the issue or pull request label Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for response Further information is needed from people who opened the issue or pull request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants