Tib3rius / AutoRecon

AutoRecon is a multi-threaded network reconnaissance tool which performs automated enumeration of services.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SyntaxWarning: Invalid Escape Sequence

Arszilla opened this issue · comments

Hey @Tib3rius,

I have created a provisional Debian package for autorecon - per https://bugs.kali.org/view.php?id=7870. The following files and lines seem to annoy apt, where it displayed a SyntaxWarning highlighting that these lines are using an invalid escape sequence.

  • autorecon/default-plugins/bruteforce-ftp.py:11
  • autorecon/default-plugins/bruteforce-rdp.py:11
  • autorecon/default-plugins/bruteforce-smb.py:11
  • autorecon/default-plugins/enum4linux.py:13
  • autorecon/default-plugins/lookup-sid.py:11
  • autorecon/default-plugins/nbtscan.py:11
  • autorecon/default-plugins/nmap-ftp.py:11
  • autorecon/default-plugins/nmap-mssql.py:11
  • autorecon/default-plugins/nmap-rdp.py:11
  • autorecon/default-plugins/nmap-rmi.py:11
  • autorecon/default-plugins/nmap-smb.py:11
  • autorecon/default-plugins/smb-vuln.py:11
  • autorecon/default-plugins/smbclient.py:11
  • autorecon/default-plugins/smbmap.py:11
  • autorecon/main.py:518
  • autorecon/main.py:1238
  • autorecon/plugins.py:230
  • autorecon/plugins.py:257

Full details below:

/usr/lib/python3/dist-packages/autorecon/default-plugins/bruteforce-ftp.py:11: SyntaxWarning: invalid escape sequence '\-'
  self.match_service_name(['^ftp', '^ftp\-data'])
/usr/lib/python3/dist-packages/autorecon/default-plugins/bruteforce-rdp.py:11: SyntaxWarning: invalid escape sequence '\-'
  self.match_service_name(['^rdp', '^ms\-wbt\-server', '^ms\-term\-serv'])
/usr/lib/python3/dist-packages/autorecon/default-plugins/bruteforce-rdp.py:11: SyntaxWarning: invalid escape sequence '\-'
  self.match_service_name(['^rdp', '^ms\-wbt\-server', '^ms\-term\-serv'])
/usr/lib/python3/dist-packages/autorecon/default-plugins/bruteforce-smb.py:11: SyntaxWarning: invalid escape sequence '\-'
  self.match_service('tcp', 445, '^microsoft\-ds')
/usr/lib/python3/dist-packages/autorecon/default-plugins/enum4linux.py:13: SyntaxWarning: invalid escape sequence '\-'
  self.match_service_name(['^ldap', '^smb', '^microsoft\-ds', '^netbios'])
/usr/lib/python3/dist-packages/autorecon/default-plugins/lookup-sid.py:11: SyntaxWarning: invalid escape sequence '\-'
  self.match_service('tcp', 445, '^microsoft\-ds')
/usr/lib/python3/dist-packages/autorecon/default-plugins/nbtscan.py:11: SyntaxWarning: invalid escape sequence '\-'
  self.match_service_name(['^smb', '^microsoft\-ds', '^netbios'])
/usr/lib/python3/dist-packages/autorecon/default-plugins/nmap-ftp.py:11: SyntaxWarning: invalid escape sequence '\-'
  self.match_service_name(['^ftp', '^ftp\-data'])
/usr/lib/python3/dist-packages/autorecon/default-plugins/nmap-mssql.py:11: SyntaxWarning: invalid escape sequence '\-'
  self.match_service_name(['^mssql', '^ms\-sql'])
/usr/lib/python3/dist-packages/autorecon/default-plugins/nmap-rdp.py:11: SyntaxWarning: invalid escape sequence '\-'
  self.match_service_name(['^rdp', '^ms\-wbt\-server', '^ms\-term\-serv'])
/usr/lib/python3/dist-packages/autorecon/default-plugins/nmap-rdp.py:11: SyntaxWarning: invalid escape sequence '\-'
  self.match_service_name(['^rdp', '^ms\-wbt\-server', '^ms\-term\-serv'])
/usr/lib/python3/dist-packages/autorecon/default-plugins/nmap-rmi.py:11: SyntaxWarning: invalid escape sequence '\-'
  self.match_service_name(['^java\-rmi', '^rmiregistry'])
/usr/lib/python3/dist-packages/autorecon/default-plugins/nmap-smb.py:11: SyntaxWarning: invalid escape sequence '\-'
  self.match_service_name(['^smb', '^microsoft\-ds', '^netbios'])
/usr/lib/python3/dist-packages/autorecon/default-plugins/smb-vuln.py:11: SyntaxWarning: invalid escape sequence '\-'
  self.match_service_name(['^smb', '^microsoft\-ds', '^netbios'])
/usr/lib/python3/dist-packages/autorecon/default-plugins/smbclient.py:11: SyntaxWarning: invalid escape sequence '\-'
  self.match_service_name(['^smb', '^microsoft\-ds', '^netbios'])
/usr/lib/python3/dist-packages/autorecon/default-plugins/smbmap.py:11: SyntaxWarning: invalid escape sequence '\-'
  self.match_service_name(['^smb', '^microsoft\-ds', '^netbios'])
/usr/lib/python3/dist-packages/autorecon/main.py:518: SyntaxWarning: invalid escape sequence '\/'
  match = re.search('(?P<protocol>(tcp|udp))\/(?P<port>\d+)\/(?P<service>[\w\-]+)(\/(?P<secure>secure|insecure))?', forced_service)
/usr/lib/python3/dist-packages/autorecon/main.py:1238: SyntaxWarning: invalid escape sequence '\-'
  match = re.search('^([0-9]+)\-([0-9]+)$', port)
/usr/lib/python3/dist-packages/autorecon/plugins.py:230: SyntaxWarning: invalid escape sequence '\-'
  self.__slug_regex = re.compile('^[a-z0-9\-]+$')
/usr/lib/python3/dist-packages/autorecon/plugins.py:257: SyntaxWarning: invalid escape sequence '\d'
  regex = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/]+)(\s*)(.*)$'

This problem can be fixed by using either:

  1. A raw string (i.e. r'\s+')
  2. Escaping the backslash (i.e. '\\s+')

autorecon has been added to Kali, and Dani has applied a patch to fix this: https://gitlab.com/kalilinux/packages/autorecon/-/commit/0026e00960f7765e1275f450bdafaddb1c186806

I'll leave it open for you to decide on how to address this going forward @Tib3rius :)