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

[FEATURE REQUEST] Add Python2 capable agent #499

Open
Cx01N opened this issue Oct 14, 2021 · 0 comments
Open

[FEATURE REQUEST] Add Python2 capable agent #499

Cx01N opened this issue Oct 14, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@Cx01N
Copy link

Cx01N commented Oct 14, 2021

Is your feature request related to a problem? Please describe.

When migrating Empire from Python 2 to 3, we lost the ability to use Python 2 agents and can only run v3.

Describe the solution you'd like

The ideal solution is to have a single agent that is both Python 2 and 3 compatible.

Describe alternatives you've considered

Two alternative solutions that would also work are 1) have a dedicated python 2 agent that is not compatible with python 3. 2) have a common launcher that calls dedicated python 2 agent code, similar to how the IronPython staging is implemented.

Additional context

One of the libraries to keep in mind that will need to be updated for cross-compatibility is urllib.request. You can patch it in so it is cross-compatible by adding to the launcher.

                launcherBase += """
                if sys.version_info[0] >= 3:
                    import urllib.request as urllib;
                else:
                    import urllib2 as urllib;
                    """

Additional example code is located at dev...python2_agent_v2

@Cx01N Cx01N added enhancement New feature or request hacktoberfest labels Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant