fortra / impacket

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

Impacket error with kali 2017.3 "ImportError: cannot import name noValue" #355

Closed sho-luv closed 6 years ago

sho-luv commented 6 years ago

Currently I'm doing the following:

To remove the symbolic links:

ls examples/ | xargs -t -I file rm /usr/local/bin/file

To remove it from the python packages:

rm -rf /usr/local/lib/python2.7/dist-packages/impacket*

Currently it is not working on kali 2017.3 as a fresh install with crackmapexec.

pip install crackmapexec
Collecting crackmapexec
  Using cached crackmapexec-3.1.5-py2-none-any.whl
Requirement already satisfied: pycrypto in /usr/lib/python2.7/dist-packages (from crackmapexec)
Requirement already satisfied: netaddr in /usr/lib/python2.7/dist-packages (from crackmapexec)
Requirement already satisfied: msgpack-python in /usr/lib/python2.7/dist-packages (from crackmapexec)
Requirement already satisfied: gevent>=1.2.0 in /usr/lib/python2.7/dist-packages (from crackmapexec)
Requirement already satisfied: termcolor in /usr/lib/python2.7/dist-packages (from crackmapexec)
Requirement already satisfied: pyOpenSSL in /usr/lib/python2.7/dist-packages (from crackmapexec)
Requirement already satisfied: pyasn1 in /usr/lib/python2.7/dist-packages (from crackmapexec)
Requirement already satisfied: impacket>=0.9.15 in /usr/lib/python2.7/dist-packages (from crackmapexec)
Requirement already satisfied: requests in /usr/lib/python2.7/dist-packages (from crackmapexec)
Installing collected packages: crackmapexec
Successfully installed crackmapexec-3.1.5
root@kali:~/impacket# cme
usage: cme [-h] [-v] [-t THREADS] [-id CRED_ID [CRED_ID ...]]
           [-u USERNAME [USERNAME ...]] [-d DOMAIN | --local-auth]
           [-p PASSWORD [PASSWORD ...] | -H HASH [HASH ...]] [-M MODULE]
           [-o MODULE_OPTION [MODULE_OPTION ...]] [-L] [--show-options]
           [--share SHARE] [--smb-port {139,445}] [--mssql-port PORT]
           [--server {http,https}] [--server-host HOST] [--server-port PORT]
           [--timeout TIMEOUT]
           [--gfail-limit LIMIT | --ufail-limit LIMIT | --fail-limit LIMIT]
           [--verbose] [--sam] [--lsa] [--ntds {vss,drsuapi}] [--ntds-history]
           [--ntds-pwdLastSet] [--wdigest {enable,disable}] [--shares] [--uac]
           [--sessions] [--disks] [--users] [--rid-brute [MAX_RID]]
           [--pass-pol] [--lusers] [--wmi QUERY] [--wmi-namespace NAMESPACE]
           [--spider [FOLDER]] [--content] [--exclude-dirs DIR_LIST]
           [--pattern PATTERN [PATTERN ...] | --regex REGEX [REGEX ...]]
           [--depth DEPTH] [--exec-method {smbexec,wmiexec,atexec}]
           [--force-ps32] [--no-output] [-x COMMAND | -X PS_COMMAND] [--mssql]
           [--mssql-query QUERY] [--mssql-auth {windows,normal}]
           [target [target ...]]

      ______ .______           ___        ______  __  ___ .___  ___.      ___      .______    _______ ___   ___  _______   ______
     /      ||   _  \         /   \      /      ||  |/  / |   \/   |     /   \     |   _  \  |   ____|\  \ /  / |   ____| /      |
    |  ,----'|  |_)  |       /  ^  \    |  ,----'|  '  /  |  \  /  |    /  ^  \    |  |_)  | |  |__    \  V  /  |  |__   |  ,----'
    |  |     |      /       /  /_\  \   |  |     |    <   |  |\/|  |   /  /_\  \   |   ___/  |   __|    >   <   |   __|  |  |
    |  `----.|  |\  \----. /  _____  \  |  `----.|  .  \  |  |  |  |  /  _____  \  |  |      |  |____  /  .  \  |  |____ |  `----.
     \______|| _| `._____|/__/     \__\  \______||__|\__\ |__|  |__| /__/     \__\ | _|      |_______|/__/ \__\ |_______| \______|

                     Swiss army knife for pentesting Windows/Active Directory environments | @byt3bl33d3r

                           Powered by Impacket https://github.com/CoreSecurity/impacket (@agsolino)

                                                       Inspired by:
                                @ShawnDEvans's smbmap https://github.com/ShawnDEvans/smbmap
                                @gojhonny's CredCrack https://github.com/gojhonny/CredCrack
                                @pentestgeek's smbexec https://github.com/pentestgeek/smbexec

                                                      Version: 3.1.5
                                                     Codename: 'Smidge'

positional arguments:
  target                The target IP(s), range(s), CIDR(s), hostname(s), FQDN(s) or file(s) containg a list of targets

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -t THREADS            Set how many concurrent threads to use (default: 100)
  -id CRED_ID [CRED_ID ...]
                        Database credential ID(s) to use for authentication
  -u USERNAME [USERNAME ...]
                        Username(s) or file(s) containing usernames
  -d DOMAIN             Domain name
  --local-auth          Authenticate locally to each target
  -p PASSWORD [PASSWORD ...]
                        Password(s) or file(s) containing passwords
  -H HASH [HASH ...]    NTLM hash(es) or file(s) containing NTLM hashes
  -M MODULE, --module MODULE
                        Payload module to use
  -o MODULE_OPTION [MODULE_OPTION ...]
                        Payload module options
  -L, --list-modules    List available modules
  --show-options        Display module options
  --share SHARE         Specify a share (default: C$)
  --smb-port {139,445}  SMB port (default: 445)
  --mssql-port PORT     MSSQL port (default: 1433)
  --server {http,https}
                        Use the selected server (default: https)
  --server-host HOST    IP to bind the server to (default: 0.0.0.0)
  --server-port PORT    Start the server on the specified port
  --timeout TIMEOUT     Max timeout in seconds of each thread (default: 20)
  --gfail-limit LIMIT   Max number of global failed login attempts
  --ufail-limit LIMIT   Max number of failed login attempts per username
  --fail-limit LIMIT    Max number of failed login attempts per host
  --verbose             Enable verbose output

Credential Gathering:
  Options for gathering credentials

  --sam                 Dump SAM hashes from target systems
  --lsa                 Dump LSA secrets from target systems
  --ntds {vss,drsuapi}  Dump the NTDS.dit from target DCs using the specifed method
                        (drsuapi is the fastest)
  --ntds-history        Dump NTDS.dit password history
  --ntds-pwdLastSet     Shows the pwdLastSet attribute for each NTDS.dit account
  --wdigest {enable,disable}
                        Creates/Deletes the 'UseLogonCredential' registry key enabling WDigest cred dumping on Windows >= 8.1

Mapping/Enumeration:
  Options for Mapping/Enumerating

  --shares              Enumerate shares and access
  --uac                 Checks UAC status
  --sessions            Enumerate active sessions
  --disks               Enumerate disks
  --users               Enumerate users
  --rid-brute [MAX_RID]
                        Enumerate users by bruteforcing RID's (default: 4000)
  --pass-pol            Dump password policy
  --lusers              Enumerate logged on users
  --wmi QUERY           Issues the specified WMI query
  --wmi-namespace NAMESPACE
                        WMI Namespace (default: //./root/cimv2)

Spidering:
  Options for spidering shares

  --spider [FOLDER]     Folder to spider (default: root directory)
  --content             Enable file content searching
  --exclude-dirs DIR_LIST
                        Directories to exclude from spidering
  --pattern PATTERN [PATTERN ...]
                        Pattern(s) to search for in folders, filenames and file content
  --regex REGEX [REGEX ...]
                        Regex(s) to search for in folders, filenames and file content
  --depth DEPTH         Spider recursion depth (default: 10)

Command Execution:
  Options for executing commands

  --exec-method {smbexec,wmiexec,atexec}
                        Method to execute the command. Ignored if in MSSQL mode (default: wmiexec)
  --force-ps32          Force the PowerShell command to run in a 32-bit process
  --no-output           Do not retrieve command output
  -x COMMAND            Execute the specified command
  -X PS_COMMAND         Execute the specified PowerShell command

MSSQL Interaction:
  Options for interacting with MSSQL DBs

  --mssql               Switches CME into MSSQL Mode. If credentials are provided will authenticate against all discovered MSSQL DBs
  --mssql-query QUERY   Execute the specifed query against the MSSQL DB
  --mssql-auth {windows,normal}
                        MSSQL authentication type to use (default: windows)

Y'all got any more of that smidge left?
root@kali:~/impacket# cd examples/
root@kali:~/impacket/examples# python ./secretsdump.py 
Traceback (most recent call last):
  File "./secretsdump.py", line 56, in <module>
    from impacket.examples.secretsdump import LocalOperations, RemoteOperations, SAMHashes, LSASecrets, NTDSHashes
ImportError: No module named secretsdump
root@kali:~/impacket/examples# cd ..
root@kali:~/impacket# python setup.py install
running install
running build
running build_py
running build_scripts
running install_lib
creating /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/ese.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/tds.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/IP6_Address.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/IP6.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/ImpactDecoder.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/IP6_Extension_Headers.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/ICMP6.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/winregistry.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/Dot11Crypto.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/ntlm.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/smb3.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/dhcp.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/smbserver.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/wps.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/nmb.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/helper.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/crypto.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/dns.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/pcap_linktypes.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/dot11.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/smb3structs.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/nt_errors.py -> /usr/local/lib/python2.7/dist-packages/impacket
creating /usr/local/lib/python2.7/dist-packages/impacket/examples
copying build/lib.linux-x86_64-2.7/impacket/examples/secretsdump.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples
copying build/lib.linux-x86_64-2.7/impacket/examples/serviceinstall.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples
copying build/lib.linux-x86_64-2.7/impacket/examples/logger.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples
copying build/lib.linux-x86_64-2.7/impacket/examples/remcomsvc.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples
creating /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx
creating /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/servers
copying build/lib.linux-x86_64-2.7/impacket/examples/ntlmrelayx/servers/socksserver.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/servers
copying build/lib.linux-x86_64-2.7/impacket/examples/ntlmrelayx/servers/smbrelayserver.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/servers
creating /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/servers/socksplugins
copying build/lib.linux-x86_64-2.7/impacket/examples/ntlmrelayx/servers/socksplugins/smb.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/servers/socksplugins
copying build/lib.linux-x86_64-2.7/impacket/examples/ntlmrelayx/servers/socksplugins/__init__.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/servers/socksplugins
copying build/lib.linux-x86_64-2.7/impacket/examples/ntlmrelayx/servers/httprelayserver.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/servers
copying build/lib.linux-x86_64-2.7/impacket/examples/ntlmrelayx/servers/__init__.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/servers
creating /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/utils
copying build/lib.linux-x86_64-2.7/impacket/examples/ntlmrelayx/utils/targetsutils.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/utils
copying build/lib.linux-x86_64-2.7/impacket/examples/ntlmrelayx/utils/config.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/utils
copying build/lib.linux-x86_64-2.7/impacket/examples/ntlmrelayx/utils/tcpshell.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/utils
copying build/lib.linux-x86_64-2.7/impacket/examples/ntlmrelayx/utils/__init__.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/utils
creating /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/clients
copying build/lib.linux-x86_64-2.7/impacket/examples/ntlmrelayx/clients/smbrelayclient.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/clients
copying build/lib.linux-x86_64-2.7/impacket/examples/ntlmrelayx/clients/mssqlrelayclient.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/clients
copying build/lib.linux-x86_64-2.7/impacket/examples/ntlmrelayx/clients/imaprelayclient.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/clients
copying build/lib.linux-x86_64-2.7/impacket/examples/ntlmrelayx/clients/httprelayclient.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/clients
copying build/lib.linux-x86_64-2.7/impacket/examples/ntlmrelayx/clients/__init__.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/clients
copying build/lib.linux-x86_64-2.7/impacket/examples/ntlmrelayx/clients/ldaprelayclient.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/clients
copying build/lib.linux-x86_64-2.7/impacket/examples/ntlmrelayx/__init__.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx
copying build/lib.linux-x86_64-2.7/impacket/examples/__init__.py -> /usr/local/lib/python2.7/dist-packages/impacket/examples
copying build/lib.linux-x86_64-2.7/impacket/hresult_errors.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/cdp.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/Dot11KeyManager.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/pcapfile.py -> /usr/local/lib/python2.7/dist-packages/impacket
creating /usr/local/lib/python2.7/dist-packages/impacket/krb5
copying build/lib.linux-x86_64-2.7/impacket/krb5/pac.py -> /usr/local/lib/python2.7/dist-packages/impacket/krb5
copying build/lib.linux-x86_64-2.7/impacket/krb5/kerberosv5.py -> /usr/local/lib/python2.7/dist-packages/impacket/krb5
copying build/lib.linux-x86_64-2.7/impacket/krb5/crypto.py -> /usr/local/lib/python2.7/dist-packages/impacket/krb5
copying build/lib.linux-x86_64-2.7/impacket/krb5/gssapi.py -> /usr/local/lib/python2.7/dist-packages/impacket/krb5
copying build/lib.linux-x86_64-2.7/impacket/krb5/constants.py -> /usr/local/lib/python2.7/dist-packages/impacket/krb5
copying build/lib.linux-x86_64-2.7/impacket/krb5/ccache.py -> /usr/local/lib/python2.7/dist-packages/impacket/krb5
copying build/lib.linux-x86_64-2.7/impacket/krb5/asn1.py -> /usr/local/lib/python2.7/dist-packages/impacket/krb5
copying build/lib.linux-x86_64-2.7/impacket/krb5/types.py -> /usr/local/lib/python2.7/dist-packages/impacket/krb5
copying build/lib.linux-x86_64-2.7/impacket/krb5/__init__.py -> /usr/local/lib/python2.7/dist-packages/impacket/krb5
copying build/lib.linux-x86_64-2.7/impacket/mqtt.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/uuid.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/spnego.py -> /usr/local/lib/python2.7/dist-packages/impacket
creating /usr/local/lib/python2.7/dist-packages/impacket/dcerpc
creating /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/srvs.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/drsuapi.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/epm.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/lsat.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/even6.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/enum.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/nrpc.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/dcomrt.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/sasec.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/scmr.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/lsad.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/ndr.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/dhcpm.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
creating /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/dcom
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/dcom/scmp.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/dcom
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/dcom/comev.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/dcom
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/dcom/oaut.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/dcom
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/dcom/wmi.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/dcom
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/dcom/vds.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/dcom
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/dcom/__init__.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/dcom
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/samr.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/dtypes.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/tsch.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/transport.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/rrp.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/mgmt.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/wkst.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/mimilib.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/__init__.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/atsvc.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/v5/rpcrt.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5
copying build/lib.linux-x86_64-2.7/impacket/dcerpc/__init__.py -> /usr/local/lib/python2.7/dist-packages/impacket/dcerpc
copying build/lib.linux-x86_64-2.7/impacket/version.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/smb.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/ImpactPacket.py -> /usr/local/lib/python2.7/dist-packages/impacket
creating /usr/local/lib/python2.7/dist-packages/impacket/ldap
copying build/lib.linux-x86_64-2.7/impacket/ldap/ldap.py -> /usr/local/lib/python2.7/dist-packages/impacket/ldap
copying build/lib.linux-x86_64-2.7/impacket/ldap/ldapasn1.py -> /usr/local/lib/python2.7/dist-packages/impacket/ldap
copying build/lib.linux-x86_64-2.7/impacket/ldap/__init__.py -> /usr/local/lib/python2.7/dist-packages/impacket/ldap
copying build/lib.linux-x86_64-2.7/impacket/system_errors.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/NDP.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/eap.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/smbconnection.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/structure.py -> /usr/local/lib/python2.7/dist-packages/impacket
copying build/lib.linux-x86_64-2.7/impacket/__init__.py -> /usr/local/lib/python2.7/dist-packages/impacket
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/ese.py to ese.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/tds.py to tds.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/IP6_Address.py to IP6_Address.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/IP6.py to IP6.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/ImpactDecoder.py to ImpactDecoder.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/IP6_Extension_Headers.py to IP6_Extension_Headers.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/ICMP6.py to ICMP6.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/winregistry.py to winregistry.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/Dot11Crypto.py to Dot11Crypto.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/ntlm.py to ntlm.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/smb3.py to smb3.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dhcp.py to dhcp.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/smbserver.py to smbserver.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/wps.py to wps.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/nmb.py to nmb.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/helper.py to helper.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/crypto.py to crypto.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dns.py to dns.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/pcap_linktypes.py to pcap_linktypes.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dot11.py to dot11.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/smb3structs.py to smb3structs.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/nt_errors.py to nt_errors.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/secretsdump.py to secretsdump.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/serviceinstall.py to serviceinstall.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/logger.py to logger.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/remcomsvc.py to remcomsvc.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/servers/socksserver.py to socksserver.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/servers/smbrelayserver.py to smbrelayserver.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/servers/socksplugins/smb.py to smb.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/servers/socksplugins/__init__.py to __init__.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/servers/httprelayserver.py to httprelayserver.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/servers/__init__.py to __init__.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/utils/targetsutils.py to targetsutils.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/utils/config.py to config.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/utils/tcpshell.py to tcpshell.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/utils/__init__.py to __init__.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/clients/smbrelayclient.py to smbrelayclient.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/clients/mssqlrelayclient.py to mssqlrelayclient.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/clients/imaprelayclient.py to imaprelayclient.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/clients/httprelayclient.py to httprelayclient.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/clients/__init__.py to __init__.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/clients/ldaprelayclient.py to ldaprelayclient.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/ntlmrelayx/__init__.py to __init__.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/examples/__init__.py to __init__.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/hresult_errors.py to hresult_errors.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/cdp.py to cdp.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/Dot11KeyManager.py to Dot11KeyManager.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/pcapfile.py to pcapfile.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/krb5/pac.py to pac.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/krb5/kerberosv5.py to kerberosv5.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/krb5/crypto.py to crypto.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/krb5/gssapi.py to gssapi.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/krb5/constants.py to constants.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/krb5/ccache.py to ccache.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/krb5/asn1.py to asn1.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/krb5/types.py to types.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/krb5/__init__.py to __init__.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/mqtt.py to mqtt.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/uuid.py to uuid.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/spnego.py to spnego.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/srvs.py to srvs.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/drsuapi.py to drsuapi.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/epm.py to epm.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/lsat.py to lsat.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/even6.py to even6.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/enum.py to enum.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/nrpc.py to nrpc.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/dcomrt.py to dcomrt.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/sasec.py to sasec.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/scmr.py to scmr.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/lsad.py to lsad.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/ndr.py to ndr.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/dhcpm.py to dhcpm.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/dcom/scmp.py to scmp.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/dcom/comev.py to comev.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/dcom/oaut.py to oaut.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/dcom/wmi.py to wmi.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/dcom/vds.py to vds.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/dcom/__init__.py to __init__.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/samr.py to samr.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/dtypes.py to dtypes.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/tsch.py to tsch.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/transport.py to transport.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/rrp.py to rrp.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/mgmt.py to mgmt.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/wkst.py to wkst.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/mimilib.py to mimilib.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/__init__.py to __init__.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/atsvc.py to atsvc.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/v5/rpcrt.py to rpcrt.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/dcerpc/__init__.py to __init__.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/version.py to version.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/smb.py to smb.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/ImpactPacket.py to ImpactPacket.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/ldap/ldap.py to ldap.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/ldap/ldapasn1.py to ldapasn1.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/ldap/__init__.py to __init__.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/system_errors.py to system_errors.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/NDP.py to NDP.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/eap.py to eap.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/smbconnection.py to smbconnection.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/structure.py to structure.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/impacket/__init__.py to __init__.pyc
running install_scripts
copying build/scripts-2.7/mimikatz.py -> /usr/local/bin
copying build/scripts-2.7/secretsdump.py -> /usr/local/bin
copying build/scripts-2.7/raiseChild.py -> /usr/local/bin
copying build/scripts-2.7/split.py -> /usr/local/bin
copying build/scripts-2.7/smbclient.py -> /usr/local/bin
copying build/scripts-2.7/karmaSMB.py -> /usr/local/bin
copying build/scripts-2.7/ping6.py -> /usr/local/bin
copying build/scripts-2.7/ifmap.py -> /usr/local/bin
copying build/scripts-2.7/getPac.py -> /usr/local/bin
copying build/scripts-2.7/reg.py -> /usr/local/bin
copying build/scripts-2.7/wmiexec.py -> /usr/local/bin
copying build/scripts-2.7/goldenPac.py -> /usr/local/bin
copying build/scripts-2.7/registry-read.py -> /usr/local/bin
copying build/scripts-2.7/smbtorture.py -> /usr/local/bin
copying build/scripts-2.7/ping.py -> /usr/local/bin
copying build/scripts-2.7/esentutl.py -> /usr/local/bin
copying build/scripts-2.7/mqtt_check.py -> /usr/local/bin
copying build/scripts-2.7/opdump.py -> /usr/local/bin
copying build/scripts-2.7/rpcdump.py -> /usr/local/bin
copying build/scripts-2.7/netview.py -> /usr/local/bin
copying build/scripts-2.7/smbserver.py -> /usr/local/bin
copying build/scripts-2.7/sambaPipe.py -> /usr/local/bin
copying build/scripts-2.7/rdp_check.py -> /usr/local/bin
copying build/scripts-2.7/mssqlinstance.py -> /usr/local/bin
copying build/scripts-2.7/psexec.py -> /usr/local/bin
copying build/scripts-2.7/mssqlclient.py -> /usr/local/bin
copying build/scripts-2.7/atexec.py -> /usr/local/bin
copying build/scripts-2.7/sniff.py -> /usr/local/bin
copying build/scripts-2.7/ticketer.py -> /usr/local/bin
copying build/scripts-2.7/tracer.py -> /usr/local/bin
copying build/scripts-2.7/ntlmrelayx.py -> /usr/local/bin
copying build/scripts-2.7/nmapAnswerMachine.py -> /usr/local/bin
copying build/scripts-2.7/wmiquery.py -> /usr/local/bin
copying build/scripts-2.7/samrdump.py -> /usr/local/bin
copying build/scripts-2.7/smbexec.py -> /usr/local/bin
copying build/scripts-2.7/lookupsid.py -> /usr/local/bin
copying build/scripts-2.7/GetADUsers.py -> /usr/local/bin
copying build/scripts-2.7/sniffer.py -> /usr/local/bin
copying build/scripts-2.7/os_ident.py -> /usr/local/bin
copying build/scripts-2.7/GetUserSPNs.py -> /usr/local/bin
copying build/scripts-2.7/loopchain.py -> /usr/local/bin
copying build/scripts-2.7/getArch.py -> /usr/local/bin
copying build/scripts-2.7/mmcexec.py -> /usr/local/bin
copying build/scripts-2.7/ntfs-read.py -> /usr/local/bin
copying build/scripts-2.7/services.py -> /usr/local/bin
copying build/scripts-2.7/smbrelayx.py -> /usr/local/bin
copying build/scripts-2.7/wmipersist.py -> /usr/local/bin
changing mode of /usr/local/bin/mimikatz.py to 755
changing mode of /usr/local/bin/secretsdump.py to 755
changing mode of /usr/local/bin/raiseChild.py to 755
changing mode of /usr/local/bin/split.py to 755
changing mode of /usr/local/bin/smbclient.py to 755
changing mode of /usr/local/bin/karmaSMB.py to 755
changing mode of /usr/local/bin/ping6.py to 755
changing mode of /usr/local/bin/ifmap.py to 755
changing mode of /usr/local/bin/getPac.py to 755
changing mode of /usr/local/bin/reg.py to 755
changing mode of /usr/local/bin/wmiexec.py to 755
changing mode of /usr/local/bin/goldenPac.py to 755
changing mode of /usr/local/bin/registry-read.py to 755
changing mode of /usr/local/bin/smbtorture.py to 755
changing mode of /usr/local/bin/ping.py to 755
changing mode of /usr/local/bin/esentutl.py to 755
changing mode of /usr/local/bin/mqtt_check.py to 755
changing mode of /usr/local/bin/opdump.py to 755
changing mode of /usr/local/bin/rpcdump.py to 755
changing mode of /usr/local/bin/netview.py to 755
changing mode of /usr/local/bin/smbserver.py to 755
changing mode of /usr/local/bin/sambaPipe.py to 755
changing mode of /usr/local/bin/rdp_check.py to 755
changing mode of /usr/local/bin/mssqlinstance.py to 755
changing mode of /usr/local/bin/psexec.py to 755
changing mode of /usr/local/bin/mssqlclient.py to 755
changing mode of /usr/local/bin/atexec.py to 755
changing mode of /usr/local/bin/sniff.py to 755
changing mode of /usr/local/bin/ticketer.py to 755
changing mode of /usr/local/bin/tracer.py to 755
changing mode of /usr/local/bin/ntlmrelayx.py to 755
changing mode of /usr/local/bin/nmapAnswerMachine.py to 755
changing mode of /usr/local/bin/wmiquery.py to 755
changing mode of /usr/local/bin/samrdump.py to 755
changing mode of /usr/local/bin/smbexec.py to 755
changing mode of /usr/local/bin/lookupsid.py to 755
changing mode of /usr/local/bin/GetADUsers.py to 755
changing mode of /usr/local/bin/sniffer.py to 755
changing mode of /usr/local/bin/os_ident.py to 755
changing mode of /usr/local/bin/GetUserSPNs.py to 755
changing mode of /usr/local/bin/loopchain.py to 755
changing mode of /usr/local/bin/getArch.py to 755
changing mode of /usr/local/bin/mmcexec.py to 755
changing mode of /usr/local/bin/ntfs-read.py to 755
changing mode of /usr/local/bin/services.py to 755
changing mode of /usr/local/bin/smbrelayx.py to 755
changing mode of /usr/local/bin/wmipersist.py to 755
running install_data
running install_egg_info
Writing /usr/local/lib/python2.7/dist-packages/impacket-0.9.16_dev.egg-info
root@kali:~/impacket# cme
Traceback (most recent call last):
  File "/usr/local/bin/cme", line 7, in <module>
    from cme.crackmapexec import main
  File "/usr/local/lib/python2.7/dist-packages/cme/crackmapexec.py", line 10, in <module>
    from cme.connection import Connection
  File "/usr/lib/python2.7/dist-packages/gevent/builtins.py", line 93, in __import__
    result = _import(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/cme/connection.py", line 8, in <module>
    from impacket.smbconnection import SMBConnection, SessionError
  File "/usr/lib/python2.7/dist-packages/gevent/builtins.py", line 93, in __import__
    result = _import(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/impacket/smbconnection.py", line 20, in <module>
    from impacket import smb, smb3, nmb, nt_errors, LOG
  File "/usr/lib/python2.7/dist-packages/gevent/builtins.py", line 93, in __import__
    result = _import(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/impacket/smb.py", line 49, in <module>
    from pyasn1.type.univ import noValue
ImportError: cannot import name noValue
root@kali:~/impacket# secretsdump.py 
Traceback (most recent call last):
  File "/usr/local/bin/secretsdump.py", line 54, in <module>
    from impacket.smbconnection import SMBConnection
  File "/usr/local/lib/python2.7/dist-packages/impacket/smbconnection.py", line 20, in <module>
    from impacket import smb, smb3, nmb, nt_errors, LOG
  File "/usr/local/lib/python2.7/dist-packages/impacket/smb.py", line 49, in <module>
    from pyasn1.type.univ import noValue
ImportError: cannot import name noValue
root@kali:~/impacket# 
asolino commented 6 years ago

Hey @sho-luv

You have an old pyasn1 version installed. Try a new one. For example, this one https://pypi.python.org/pypi/pyasn1/0.3.7

Give it a try and let me know.

sho-luv commented 6 years ago

Yep that fixed it.

Downloaded the latest version with:

wget https://pypi.python.org/packages/5e/5d/4e4364bb8b2a3e8d6c41ec21095aae3ac3396a6fa6983ea7f5551e929661/pyasn1-0.4.2-py2.4.egg#md5=84cf09817d8eb3b8955c5c558abd7ba7

Then I installed it with:

easy_install pyasn1-0.4.2-py2.4.egg 

For anybody else that has this problem

bucky67gto commented 6 years ago

confirmed. this is the fix

larssec commented 4 years ago

I am running into this issue again.
There is an issue with pyasn1-0.4.2-py2.4.egg. image