Coder Social home page Coder Social logo

Comments (5)

vielmetti avatar vielmetti commented on August 11, 2024

It looks like libnmap is being updated relatively frequently.

On my Ubuntu 16.04 arm64 system I installed it with pip3 install python-libnmap, and then ran ./vulnscan.py --update from a fresh start and got no errors. I reran the command to update again and also got no errors. Can't replicate the problem. This is using Python 3.5.2, which is back rev from what you are using.

Can you look also at python3-lxml and see what version of that you have?

from reconscan.

tokyoneon avatar tokyoneon commented on August 11, 2024

@vielmetti , thanks for your attention to this! Here's the python3-lxml version:

$ apt-cache policy python3-lxml
python3-lxml:
  Installed: 4.2.5-1
  Candidate: 4.2.5-1
  Version table:
 *** 4.2.5-1 500
		500 http://http.kali.org/kali kali-rolling/main arm64 Packages
		100 /var/lib/dpkg/status

The libnmap version prior to your comment:

$ apt-cache policy python3-libnmap
python3-libnmap:
  Installed: 0.7.0-1
  Candidate: 0.7.0-1
  Version table:
 *** 0.7.0-1 500
		500 http://http.kali.org/kali kali-rolling/main arm64 Packages
		100 /var/lib/dpkg/status

Removed it:

$ apt-get autoremove python3-libnmap -y

Installed python-libnmap (v.0.7.0) using pip3:

$ pip3 install python-libnmap

Collecting python-libnmap
  Downloading https://files.pythonhosted.org/packages/72/46/3d2a9431a52110992337dd171c09e75d0c186361068743e013a1c28be80e/python-libnmap-0.7.0.tar.gz
Building wheels for collected packages: python-libnmap
  Running setup.py bdist_wheel for python-libnmap ... done
  Stored in directory: /root/.cache/pip/wheels/13/b2/98/2d7edf7a9dac4f0015b96da1836095d7dfd2367853c5109565
Successfully built python-libnmap
Installing collected packages: python-libnmap
Successfully installed python-libnmap-0.7.0

Tried --update again:

$ ./vulnscan.py --update

[-] Not downloading CPE dictionary: file is less than 24 hours old.
[-] Not downloading CPE aliases: file is less than 24 hours old.
[-] Not downloading CVE entries for year 2002: file already exists.
[-] Not downloading CVE entries for year 2003: file already exists.
[-] Not downloading CVE entries for year 2004: file already exists.
[-] Not downloading CVE entries for year 2005: file already exists.
[-] Not downloading CVE entries for year 2006: file already exists.
[-] Not downloading CVE entries for year 2007: file already exists.
[-] Not downloading CVE entries for year 2008: file already exists.
[-] Not downloading CVE entries for year 2009: file already exists.
[-] Not downloading CVE entries for year 2010: file already exists.
[-] Not downloading CVE entries for year 2011: file already exists.
[-] Not downloading CVE entries for year 2012: file already exists.
[-] Not downloading CVE entries for year 2013: file already exists.
[-] Not downloading CVE entries for year 2014: file already exists.
[-] Not downloading CVE entries for year 2015: file already exists.
[-] Not downloading CVE entries for year 2016: file already exists.
[-] Not downloading CVE entries for year 2017: file already exists.
[-] Not downloading CVE entries for year 2018: file is less than 24 hours old.
[*] Initiating XML parsing...
[*] Parsing file nvd/cpe-dict.xml...
[*] Parsing file nvd/cpe-aliases.lst...
[*] Using curated ExploitDB references.
Traceback (most recent call last):
  File "./vulnscan.py", line 734, in <module>
	update_database()
  File "./vulnscan.py", line 521, in update_database
	(names, aliases, vulns) = parse_nvd_dbs()
  File "./vulnscan.py", line 235, in parse_nvd_dbs
	for line in file:
  File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
	return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 5050: ordinal not in range(128)

Which version of libnmap do you have installed?

from reconscan.

vielmetti avatar vielmetti commented on August 11, 2024

Hm. My Ubuntu 16.04 system provides an older lxml, 3.5.0. I've uninstalled it from the package and am building it with pip3 install lxml which should pick up the latest.

I wonder if your download got corrupted in some way. Can you figure out which file (ExploitDB references, maybe) is tripping the error? If you start afresh with no cache, does the problem persist?

from reconscan.

tokyoneon avatar tokyoneon commented on August 11, 2024

"If you start afresh with no cache, does the problem persist?"

Yeah, I experienced this issue in a fresh Debian (arm64) install, then I tried a new Kali build but same problem. Which makes sense, they're basically the same distro. Unfortunately, I'm unable to use an Ubuntu distro for this particular project I'm working on. Here are some errors I got when trying to install lxml using pip3:

Removed python3-lxml:

$ apt-get autoremove python3-lxml

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  libxslt1.1 python3-bs4 python3-chardet python3-html5lib python3-lxml python3-webencodings
0 upgraded, 0 newly installed, 6 to remove and 27 not upgraded.
After this operation, 10.5 MB disk space will be freed.
Do you want to continue? [Y/n] y

Tried installing lxml:

$ pip3 install lxml 2>&1 >/tmp/pip_errors.txt

  Failed building wheel for lxml
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-tysece02/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);co
de=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-38ne7cqz-record/install-record.txt --single-ver
sion-externally-managed --compile" failed with error code 1 in /tmp/pip-build-tysece02/lxml/

Error file:

$ cat /tmp/pip_errors.txt

Collecting lxml
  Using cached https://files.pythonhosted.org/packages/4b/20/ddf5eb3bd5c57582d2b4652b4bbcf8da301bdfe5d805cb94e805f4d7464d/lxml-4.2.5.tar.gz
Building wheels for collected packages: lxml
  Running setup.py bdist_wheel for lxml: started
  Running setup.py bdist_wheel for lxml: finished with status 'error'
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-tysece02/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp7i2xeirgpip-wheel- --python-tag cp36:
  Building lxml version 4.2.5.
  Building without Cython.
  ERROR: b'/bin/sh: 1: xslt-config: not found\n'
  ** make sure the development packages of libxml2 and libxslt are installed **
  
  Using build configuration of libxslt
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-3.6
  creating build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/sax.py -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/_elementpath.py -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/builder.py -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/ElementInclude.py -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/__init__.py -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/usedoctest.py -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/cssselect.py -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/pyclasslookup.py -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/doctestcompare.py -> build/lib.linux-aarch64-3.6/lxml
  creating build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/__init__.py -> build/lib.linux-aarch64-3.6/lxml/includes
  creating build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/diff.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/ElementSoup.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/html5parser.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/builder.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/__init__.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/usedoctest.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/_setmixin.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/clean.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/soupparser.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/_html5builder.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/_diffcommand.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/formfill.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/defs.py -> build/lib.linux-aarch64-3.6/lxml/html
  creating build/lib.linux-aarch64-3.6/lxml/isoschematron
  copying src/lxml/isoschematron/__init__.py -> build/lib.linux-aarch64-3.6/lxml/isoschematron
  copying src/lxml/etree.h -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/etree_api.h -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/lxml.etree.h -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/lxml.etree_api.h -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/xinclude.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/htmlparser.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/config.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/__init__.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/uri.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/xslt.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/tree.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/xpath.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/relaxng.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/c14n.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/schematron.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/etree_defs.h -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/lxml-version.h -> build/lib.linux-aarch64-3.6/lxml/includes
  creating build/lib.linux-aarch64-3.6/lxml/isoschematron/resources
  creating build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/rng
  copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/rng
  creating build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl
  copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl
  copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl
  creating build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  running build_ext
  building 'lxml.etree' extension
  creating build/temp.linux-aarch64-3.6
  creating build/temp.linux-aarch64-3.6/src
  creating build/temp.linux-aarch64-3.6/src/lxml
  aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc/lxml/includes -I/usr/include/python3.6m -c src/lxml/etree.c -o build/temp.linux-aarch64-3.6/src/lxml/etree.o -w
  In file included from src/lxml/etree.c:662:
  src/lxml/includes/etree_defs.h:14:10: fatal error: libxml/xmlversion.h: No such file or directory
   #include "libxml/xmlversion.h"
			^~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  Compile failed: command 'aarch64-linux-gnu-gcc' failed with exit status 1
  creating tmp
  cc -I/usr/include/libxml2 -c /tmp/xmlXPathInitai1rapxa.c -o tmp/xmlXPathInitai1rapxa.o
  /tmp/xmlXPathInitai1rapxa.c:1:10: fatal error: libxml/xpath.h: No such file or directory
   #include "libxml/xpath.h"
			^~~~~~~~~~~~~~~~
  compilation terminated.
  *********************************************************************************
  Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
  *********************************************************************************
  error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
  
  ----------------------------------------
  Running setup.py clean for lxml
Failed to build lxml
Installing collected packages: lxml
  Running setup.py install for lxml: started
	Running setup.py install for lxml: finished with status 'error'
	Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-tysece02/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-38ne7cqz-record/install-record.txt --single-version-externally-managed --compile:
	Building lxml version 4.2.5.
	Building without Cython.
	ERROR: b'/bin/sh: 1: xslt-config: not found\n'
	** make sure the development packages of libxml2 and libxslt are installed **
	
	Using build configuration of libxslt
	running install
	running build
	running build_py
	creating build
	creating build/lib.linux-aarch64-3.6
	creating build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/sax.py -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/_elementpath.py -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/builder.py -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/ElementInclude.py -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/__init__.py -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/usedoctest.py -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/cssselect.py -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/pyclasslookup.py -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/doctestcompare.py -> build/lib.linux-aarch64-3.6/lxml
	creating build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/__init__.py -> build/lib.linux-aarch64-3.6/lxml/includes
	creating build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/diff.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/ElementSoup.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/html5parser.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/builder.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/__init__.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/usedoctest.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/_setmixin.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/clean.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/soupparser.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/_html5builder.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/_diffcommand.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/formfill.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/defs.py -> build/lib.linux-aarch64-3.6/lxml/html
	creating build/lib.linux-aarch64-3.6/lxml/isoschematron
	copying src/lxml/isoschematron/__init__.py -> build/lib.linux-aarch64-3.6/lxml/isoschematron
	copying src/lxml/etree.h -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/etree_api.h -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/lxml.etree.h -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/lxml.etree_api.h -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/xinclude.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/htmlparser.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/config.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/__init__.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/uri.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/xslt.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/tree.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/xpath.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/relaxng.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/c14n.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/schematron.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/etree_defs.h -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/lxml-version.h -> build/lib.linux-aarch64-3.6/lxml/includes
	creating build/lib.linux-aarch64-3.6/lxml/isoschematron/resources
	creating build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/rng
	copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/rng
	creating build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl
	copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl
	copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl
	creating build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
	copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
	copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
	copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
	copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
	copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
	copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
	running build_ext
	building 'lxml.etree' extension
	creating build/temp.linux-aarch64-3.6
	creating build/temp.linux-aarch64-3.6/src
	creating build/temp.linux-aarch64-3.6/src/lxml
	aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc/lxml/includes -I/usr/include/python3.6m -c src/lxml/etree.c -o build/temp.linux-aarch64-3.6/src/lxml/etree.o -w
	In file included from src/lxml/etree.c:662:
	src/lxml/includes/etree_defs.h:14:10: fatal error: libxml/xmlversion.h: No such file or directory
	 #include "libxml/xmlversion.h"
			  ^~~~~~~~~~~~~~~~~~~~~
	compilation terminated.
	Compile failed: command 'aarch64-linux-gnu-gcc' failed with exit status 1
	cc -I/usr/include/libxml2 -c /tmp/xmlXPathInita2hyqupi.c -o tmp/xmlXPathInita2hyqupi.o
	/tmp/xmlXPathInita2hyqupi.c:1:10: fatal error: libxml/xpath.h: No such file or directory
	 #include "libxml/xpath.h"
			  ^~~~~~~~~~~~~~~~
	compilation terminated.
	*********************************************************************************
	Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
	*********************************************************************************
	error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
	
	----------------------------------------

"Can you figure out which file (ExploitDB references, maybe) is tripping the error?"

Any suggestions for how I might debug that? How would you do that?

from reconscan.

tokyoneon avatar tokyoneon commented on August 11, 2024

Just realized I foolishly removed libxslt in my previous apt command.

Reinstalled:

$ apt-get install libxml2-dev libxslt-dev

Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
The following additional packages will be installed:
  icu-devtools libicu-dev libxslt1.1
Suggested packages:
  icu-doc pkg-config
The following NEW packages will be installed:
  icu-devtools libicu-dev libxml2-dev libxslt1-dev libxslt1.1
0 upgraded, 5 newly installed, 0 to remove and 27 not upgraded.
Need to get 10.5 MB/10.7 MB of archives.
After this operation, 49.7 MB of additional disk space will be used.
Do you want to continue? [Y/n]

Tried pip3 again:

$ pip3 install lxml 2>&1 >/tmp/pip_errors2.txt

  Failed building wheel for lxml
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ounyb8b3/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-apn_qgfy-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ounyb8b3/lxml/

$ cat /tmp/pip_errors2.txt

Collecting lxml
  Using cached https://files.pythonhosted.org/packages/4b/20/ddf5eb3bd5c57582d2b4652b4bbcf8da301bdfe5d805cb94e805f4d7464d/lxml-4.2.5.tar.gz
Building wheels for collected packages: lxml
  Running setup.py bdist_wheel for lxml: started
  Running setup.py bdist_wheel for lxml: still running...
  Running setup.py bdist_wheel for lxml: finished with status 'error'
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ounyb8b3/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp97yvcz24pip-wheel- --python-tag cp36:
  Building lxml version 4.2.5.
  Building without Cython.
  Using build configuration of libxslt 1.1.32
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-aarch64-3.6
  creating build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/sax.py -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/_elementpath.py -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/builder.py -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/ElementInclude.py -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/__init__.py -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/usedoctest.py -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/cssselect.py -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/pyclasslookup.py -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/doctestcompare.py -> build/lib.linux-aarch64-3.6/lxml
  creating build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/__init__.py -> build/lib.linux-aarch64-3.6/lxml/includes
  creating build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/diff.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/ElementSoup.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/html5parser.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/builder.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/__init__.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/usedoctest.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/_setmixin.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/clean.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/soupparser.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/_html5builder.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/_diffcommand.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/formfill.py -> build/lib.linux-aarch64-3.6/lxml/html
  copying src/lxml/html/defs.py -> build/lib.linux-aarch64-3.6/lxml/html
  creating build/lib.linux-aarch64-3.6/lxml/isoschematron
  copying src/lxml/isoschematron/__init__.py -> build/lib.linux-aarch64-3.6/lxml/isoschematron
  copying src/lxml/etree.h -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/etree_api.h -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/lxml.etree.h -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/lxml.etree_api.h -> build/lib.linux-aarch64-3.6/lxml
  copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/xinclude.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/htmlparser.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/config.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/__init__.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/uri.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/xslt.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/tree.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/xpath.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/relaxng.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/c14n.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/schematron.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/etree_defs.h -> build/lib.linux-aarch64-3.6/lxml/includes
  copying src/lxml/includes/lxml-version.h -> build/lib.linux-aarch64-3.6/lxml/includes
  creating build/lib.linux-aarch64-3.6/lxml/isoschematron/resources
  creating build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/rng
  copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/rng
  creating build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl
  copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl
  copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl
  creating build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
  running build_ext
  building 'lxml.etree' extension
  creating build/temp.linux-aarch64-3.6
  creating build/temp.linux-aarch64-3.6/src
  creating build/temp.linux-aarch64-3.6/src/lxml
  aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DCYTHON_CLINE_IN_TRACEBACK=0 -I/usr/include/libxml2 -Isrc -Isrc/lxml/includes -I/usr/include/python3.6m -c src/lxml/etree.c -o build/temp.linux-aarch64-3.6/src/lxml/etree.o -w
  aarch64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-aarch64-3.6/src/lxml/etree.o -lxslt -lexslt -lxml2 -lrt -lz -lm -o build/lib.linux-aarch64-3.6/lxml/etree.cpython-36m-aarch64-linux-gnu.so
  /usr/bin/ld: cannot find -lz
  collect2: error: ld returned 1 exit status
  error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
  
  ----------------------------------------
  Running setup.py clean for lxml
Failed to build lxml
Installing collected packages: lxml
  Running setup.py install for lxml: started
	Running setup.py install for lxml: still running...
	Running setup.py install for lxml: finished with status 'error'
	Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ounyb8b3/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-apn_qgfy-record/install-record.txt --single-version-externally-managed --compile:
	Building lxml version 4.2.5.
	Building without Cython.
	Using build configuration of libxslt 1.1.32
	running install
	running build
	running build_py
	creating build
	creating build/lib.linux-aarch64-3.6
	creating build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/sax.py -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/_elementpath.py -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/builder.py -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/ElementInclude.py -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/__init__.py -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/usedoctest.py -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/cssselect.py -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/pyclasslookup.py -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/doctestcompare.py -> build/lib.linux-aarch64-3.6/lxml
	creating build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/__init__.py -> build/lib.linux-aarch64-3.6/lxml/includes
	creating build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/diff.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/ElementSoup.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/html5parser.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/builder.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/__init__.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/usedoctest.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/_setmixin.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/clean.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/soupparser.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/_html5builder.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/_diffcommand.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/formfill.py -> build/lib.linux-aarch64-3.6/lxml/html
	copying src/lxml/html/defs.py -> build/lib.linux-aarch64-3.6/lxml/html
	creating build/lib.linux-aarch64-3.6/lxml/isoschematron
	copying src/lxml/isoschematron/__init__.py -> build/lib.linux-aarch64-3.6/lxml/isoschematron
	copying src/lxml/etree.h -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/etree_api.h -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/lxml.etree.h -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/lxml.etree_api.h -> build/lib.linux-aarch64-3.6/lxml
	copying src/lxml/includes/etreepublic.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/xinclude.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/xmlerror.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/htmlparser.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/config.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/__init__.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/xmlschema.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/uri.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/xslt.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/tree.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/xmlparser.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/dtdvalid.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/xpath.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/relaxng.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/c14n.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/schematron.pxd -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/etree_defs.h -> build/lib.linux-aarch64-3.6/lxml/includes
	copying src/lxml/includes/lxml-version.h -> build/lib.linux-aarch64-3.6/lxml/includes
	creating build/lib.linux-aarch64-3.6/lxml/isoschematron/resources
	creating build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/rng
	copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/rng
	creating build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl
	copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl
	copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl
	creating build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
	copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
	copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
	copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
	copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
	copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
	copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.linux-aarch64-3.6/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
	running build_ext
	building 'lxml.etree' extension
	creating build/temp.linux-aarch64-3.6
	creating build/temp.linux-aarch64-3.6/src
	creating build/temp.linux-aarch64-3.6/src/lxml
	aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DCYTHON_CLINE_IN_TRACEBACK=0 -I/usr/include/libxml2 -Isrc -Isrc/lxml/includes -I/usr/include/python3.6m -c src/lxml/etree.c -o build/temp.linux-aarch64-3.6/src/lxml/etree.o -w
	aarch64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-aarch64-3.6/src/lxml/etree.o -lxslt -lexslt -lxml2 -lrt -lz -lm -o build/lib.linux-aarch64-3.6/lxml/etree.cpython-36m-aarch64-linux-gnu.so
	/usr/bin/ld: cannot find -lz
	collect2: error: ld returned 1 exit status
	error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
	
	----------------------------------------

So, tried installing the depends using pip3:

$ apt-get remove libxml2-dev libxslt-dev

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libxslt1-dev' instead of 'libxslt-dev'
The following packages were automatically installed and are no longer required:
  icu-devtools libicu-dev libxslt1.1
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  libxml2-dev libxslt1-dev
0 upgraded, 0 newly installed, 2 to remove and 27 not upgraded.
After this operation, 5889 kB disk space will be freed.
Do you want to continue? [Y/n] 

$ pip3 search libxslt

libxml2-python (2.6.21)    - libxml2 and libxslt package
m3-libxml2-python (2.6.9)  - libxml2 and libxslt package
plone.recipe.lxml (0.4)    - Recipe that builds lxml and dependencies (libxslt, libxml2).


$ pip3 install libxml2-python 

Collecting libxml2-python
  Could not find a version that satisfies the requirement libxml2-python (from versions: )
No matching distribution found for libxml2-python

$ pip3 install libxml2 

Collecting libxml2
  Could not find a version that satisfies the requirement libxml2 (from versions: )
No matching distribution found for libxml2

I'm not sure what I'm getting wrong here...? @RoliSoft

from reconscan.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.