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

SyntaxWarning: "is not" with a literal. Did you mean "!=?" #61

Open
ranguli opened this issue Jul 12, 2020 · 1 comment
Open

SyntaxWarning: "is not" with a literal. Did you mean "!=?" #61

ranguli opened this issue Jul 12, 2020 · 1 comment

Comments

@ranguli
Copy link

ranguli commented Jul 12, 2020

Ran into this issue on Kali Linux, running Python 3.8.2. I'm not able to replicate it outside of my Kali Linux VM however.

kali@kali:~$ smbmap -H 10.10.10.3
/usr/lib/python3/dist-packages/impacket/smbserver.py:2465: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if jtr_dump_path is not '':
/usr/lib/python3/dist-packages/impacket/smbserver.py:2501: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if jtr_dump_path is not '':
/usr/lib/python3/dist-packages/impacket/smbserver.py:2843: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if jtr_dump_path is not '':
/usr/lib/python3/dist-packages/impacket/smbserver.py:4417: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if credentials_fname is not "":
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:169: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if supportedCiphers[0] in (constants.EncryptionTypes.aes128_cts_hmac_sha1_96.value, constants.EncryptionTypes.aes256_cts_hmac_sha1_96.value) and aesKey is '':
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:302: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None):
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:302: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None):
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:302: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None):
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:579: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:579: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:579: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:607: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:607: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:607: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/smbconnection.py:351: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is '' and nthash is '' and (aesKey is '' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/smbconnection.py:351: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is '' and nthash is '' and (aesKey is '' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/smbconnection.py:351: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is '' and nthash is '' and (aesKey is '' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/dcerpc/v5/ndr.py:1336: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.structure is ():
/usr/lib/python3/dist-packages/impacket/dcerpc/v5/ndr.py:1423: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.structure is ():
/usr/lib/python3/dist-packages/impacket/dcerpc/v5/dcom/wmi.py:2412: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if itemValue is '':
[!] Authentication error on 10.10.10.3

Any ideas what may be causing this?

@ShawnDEvans
Copy link
Owner

ShawnDEvans commented Jul 14, 2020

It seems that these are all just syntax warnings, not errors. You may have verbose logging enabled in your Python environment. I would recommend maybe upgrading Impacket. From what I understand versions prior to .9.21 have issues with NULL sessions. It should be easy, zero length string for username and password, but it fails. If you noodle with the the username you can sometimes coax it into working, try a space:

$ smbmap -H 10.10.10.3 -u ' ' -p ' '

It's a frustratingly inconsistent solution, but in doing testing I found that redefining NULL as a space made a difference. Anyways update Impacket, and try using a space as a username. Good luck and lemme know. I'd love to kill this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants