the-useless-one / pywerview

A (partial) Python rewriting of PowerSploit's PowerView
GNU General Public License v3.0
890 stars 113 forks source link

port to Python 3 #36

Closed blshkv closed 3 years ago

blshkv commented 4 years ago

This bug blocks https://github.com/byt3bl33d3r/CrackMapExec/issues/317

Thank you.

blshkv commented 4 years ago
Installing pywerview script to /var/tmp/portage/dev-python/pywerview-0.2.0/image/_python3.6/usr/lib/python-exec/python3.6
  File "/usr/lib64/python3.6/site-packages/pywerview/cli/main.py", line 455
    print x
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(x)?

Sorry: TabError: inconsistent use of tabs and spaces in indentation (helpers.py, line 187)
  File "/usr/lib64/python3.6/site-packages/pywerview/functions/net.py", line 646
    except Exception, e:
                    ^
SyntaxError: invalid syntax

  File "/usr/lib64/python3.6/site-packages/pywerview/functions/gpo.py", line 427
    except IndexError, AttributeError:
                     ^
SyntaxError: invalid syntax

  File "/usr/lib64/python3.6/site-packages/pywerview/requester.py", line 79
    except ldap.LDAPSessionError, e:
                                ^
SyntaxError: invalid syntax
the-useless-one commented 4 years ago

Hi @blshkv,

This pull request is porting pywerview to Python 3, but as you can see, there are some problems that prevent me from merging it and from fully migrating to Python 3. I understand the frustration for crackmapexec, I'll try to fix it as soon as I can.

GIJack commented 4 years ago

This is really needed for CME. plz port

ClaudyFaucan commented 4 years ago

Agreed with GIJack, pls port quick.

the-useless-one commented 4 years ago

Hi @GIJack and @ClaudyFaucan,

I know it's frustrating, but the port to Python 3 is still blocked, because we're experiencing encoding problems. I opened an issue in pyasn1 regarding the default encoding, but have not received an answer, yet.

If no answer comes, we'll see about doing a semi-functional port to Python 3, but I'd like to avoid that.

GIJack commented 4 years ago

At very least can you change the shebang to python2?

Also, have you considered porting to python-six if three is out of the question, or does six not work?

How hard would it be to fork pyasn1?

edit: We appreciate the time you've spent on this.

the-useless-one commented 3 years ago

Closing, as port to Python3 is done.