fortra / impacket

Impacket is a collection of Python classes for working with network protocols.
https://www.coresecurity.com
Other
13.49k stars 3.57k forks source link

[Packaging] Restructure `examples` #1597

Closed cmahnke closed 1 year ago

cmahnke commented 1 year ago

For me as an "end user developer" the most interesting code parts are currently part of examples directory. I would like to reuse this code as a python library, without adding the binary path to sys.path.

Given the example wmiexec.

Please consider using the code to the example python package to be able to use them directly

from impacket.examples.wmiexec import *

The existing files would stay in examples but will import the required functionality from impacket.examples and only contain the command line handling (argparse). This way the command line tools will be kept and the provided (high level) functionality can be used like a library.

0xdeaddood commented 1 year ago

Hi @cmahnke!

That's the spirit of the examples scripts. They are applied examples of the library. You can replicate anything from the scratch using the library.

cmahnke commented 1 year ago

Please reconsider this issue: