Als ich versuchte, Cuckoo Sandbox einzurichten und maec Version 4.0.1.0
mit pip
zu installieren, bekam ich einen Fehler, also habe ich ihn untersucht.
Es ist ein Ergebnis von Versuch und Irrtum, daher denke ich, dass es definitiv eine andere richtige Methode gibt. Bitte lassen Sie es mich wissen.
(※Ich fügte hinzu.)
$ sudo pip install maec==4.0.1.0
Downloading/unpacking maec==4.0.1.0
Downloading maec-4.0.1.0.tar.gz (114kB): 114kB downloaded
Running setup.py (path:/tmp/pip_build_root/maec/setup.py) egg_info for package maec
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/maec/setup.py", line 1, in <module>
import maec
File "maec/__init__.py", line 6, in <module>
import bindings.maec_bundle as bundle_binding
File "maec/bindings/maec_bundle.py", line 12, in <module>
from cybox.bindings import cybox_core
ImportError: No module named cybox.bindings
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/maec/setup.py", line 1, in <module>
import maec
File "maec/__init__.py", line 6, in <module>
import bindings.maec_bundle as bundle_binding
File "maec/bindings/maec_bundle.py", line 12, in <module>
from cybox.bindings import cybox_core
ImportError: No module named cybox.bindings
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/maec
Storing debug log for failure in /home/vagrant/.pip/pip.log
Ich bekomme so einen Fehler.
Wenn ich mir den Fehlerinhalt anschaue, bin ich wütend, dass es keine Cybox gibt, also werde ich Cybox einfügen.
$ sudo pip install cybox
(Weggelassen)
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-2.7/src/lxml
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -I/tmp/pip_build_root/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
x86_64-linux-gnu-gcc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 4
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-unrw2N-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/lxml
Storing debug log for failure in /home/vagrant/.pip/pip.log
Ich bekomme eine Fehlermeldung. Ich werde nacheinander durch Fehler verwirrt, aber schauen wir uns die offizielle Dokumentation an. http://cybox.readthedocs.org/en/latest/installation.html Es scheint einige abhängige Bibliotheken zu geben. Wenn Sie es eingeben, scheint es gelöst zu sein.
$ sudo apt-get install libxml2-dev libxslt1-dev zlib1g-dev
Und wieder installieren.
$ sudo pip install cybox
(Weggelassen)
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-2.7/src/lxml
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -I/tmp/pip_build_root/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
x86_64-linux-gnu-gcc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 4
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-unrw2N-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/lxml
Storing debug log for failure in /home/vagrant/.pip/pip.log
Der Fehler hat sich nicht geändert! Anscheinend scheint "lxml" nicht zu funktionieren, also werde ich diesmal versuchen, "lxml" zu installieren.
Es scheint, dass es mit pip
installiert werden kann, also werde ich es versuchen.
$ sudo pip install lxml
(Weggelassen)
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-2.7/src/lxml
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -I/tmp/pip_build_root/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
x86_64-linux-gnu-gcc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 4
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-7X8_bC-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/lxml
Storing debug log for failure in /home/vagrant/.pip/pip.log
Ich bekomme den gleichen Fehler, also scheint es, dass lxml die Ursache war. In der offiziellen Dokumentation (http://lxml.de/installation.html) gab es eine Möglichkeit, die C-Optimierung zu deaktivieren, um den Build zu beschleunigen, also nur für den Fall. ..
vagrant@vagrant-ubuntu-trusty-64:~$ sudo CFLAGS="-O0" pip install lxml
Downloading/unpacking lxml
Downloading lxml-3.4.0.tar.gz (3.5MB): 3.5MB downloaded
Running setup.py (path:/tmp/pip_build_root/lxml/setup.py) egg_info for package lxml
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.4.0.
Building without Cython.
Using build configuration of libxslt 1.1.28
warning: no previously-included files found matching '*.py'
Installing collected packages: lxml
Running setup.py install for lxml
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.4.0.
Building without Cython.
Using build configuration of libxslt 1.1.28
building 'lxml.etree' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -O0 -fPIC -I/usr/include/libxml2 -I/tmp/pip_build_root/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -O0 build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.linux-x86_64-2.7/lxml/etree.so
building 'lxml.objectify' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -O0 -fPIC -I/usr/include/libxml2 -I/tmp/pip_build_root/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.objectify.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.objectify.o -w
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -O0 build/temp.linux-x86_64-2.7/src/lxml/lxml.objectify.o -lxslt -lexslt -lxml2 -lz -lm -o build/lib.linux-x86_64-2.7/lxml/objectify.so
Successfully installed lxml
Cleaning up...
Es sieht so aus, als wäre es gut. .. War es Moos anstelle von Optimierung? Ich würde gerne mehr herausfinden, aber ich bin müde, also bitte jemanden.
$ sudo pip install cybox
Requirement already satisfied (use --upgrade to upgrade): cybox in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): lxml>=2.3 in /usr/local/lib/python2.7/dist-packages (from cybox)
Downloading/unpacking python-dateutil (from cybox)
Downloading python-dateutil-2.2.tar.gz (259kB): 259kB downloaded
Running setup.py (path:/tmp/pip_build_root/python-dateutil/setup.py) egg_info for package python-dateutil
Requirement already satisfied (use --upgrade to upgrade): six in /usr/lib/python2.7/dist-packages (from python-dateutil->cybox)
Installing collected packages: python-dateutil
Running setup.py install for python-dateutil
Successfully installed python-dateutil
Cleaning up...
Ich habe es endlich verstanden.
Sie sollten in der Lage sein, damit zu gehen!
$ sudo pip install maec==4.0.1.0
Downloading/unpacking maec==4.0.1.0
Downloading maec-4.0.1.0.tar.gz (114kB): 114kB downloaded
Running setup.py (path:/tmp/pip_build_root/maec/setup.py) egg_info for package maec
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/maec/setup.py", line 1, in <module>
import maec
File "maec/__init__.py", line 6, in <module>
import bindings.maec_bundle as bundle_binding
File "maec/bindings/maec_bundle.py", line 5424, in <module>
'Relationships': cybox_core.RelationshipsType,
AttributeError: 'module' object has no attribute 'RelationshipsType'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/maec/setup.py", line 1, in <module>
import maec
File "maec/__init__.py", line 6, in <module>
import bindings.maec_bundle as bundle_binding
File "maec/bindings/maec_bundle.py", line 5424, in <module>
'Relationships': cybox_core.RelationshipsType,
AttributeError: 'module' object has no attribute 'RelationshipsType'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/maec
Storing debug log for failure in /home/vagrant/.pip/pip.log
Anderer Fehler. .. Es ist nicht mehr möglich. .. Als ich mich ermutigte und es herausfand, schien die Version von "cybox" anders zu sein. Es wird gesagt, dass v2.0.1.4 gelöscht werden sollte.
$ wget https://github.com/CybOXProject/python-cybox/archive/v2.0.1.4.tar.gz
$ tar zxvf v2.0.1.4.tar.gz
$ cd python-cybox-2.0.1.4/
$ sudo python setup.py install
(Weggelassen)
Installed /usr/local/lib/python2.7/dist-packages/cybox-2.0.1.4-py2.7.egg
Processing dependencies for cybox==2.0.1.4
Searching for python-dateutil==2.2
Best match: python-dateutil 2.2
Processing python_dateutil-2.2-py2.7.egg
python-dateutil 2.2 is already the active version in easy-install.pth
Using /usr/local/lib/python2.7/dist-packages/python_dateutil-2.2-py2.7.egg
Searching for lxml==3.4.0
Best match: lxml 3.4.0
Processing lxml-3.4.0-py2.7-linux-x86_64.egg
lxml 3.4.0 is already the active version in easy-install.pth
Using /usr/local/lib/python2.7/dist-packages/lxml-3.4.0-py2.7-linux-x86_64.egg
Searching for six==1.5.2
Best match: six 1.5.2
six 1.5.2 is already the active version in easy-install.pth
Using /usr/lib/python2.7/dist-packages
Finished processing dependencies for cybox==2.0.1.4
$ sudo pip install maec==4.0.1.0
Downloading/unpacking maec==4.0.1.0
Downloading maec-4.0.1.0.tar.gz (114kB): 114kB downloaded
Running setup.py (path:/tmp/pip_build_root/maec/setup.py) egg_info for package maec
Requirement already satisfied (use --upgrade to upgrade): lxml>=2.3 in /usr/local/lib/python2.7/dist-packages/lxml-3.4.0-py2.7-linux-x86_64.egg (from maec==4.0.1.0)
Requirement already satisfied (use --upgrade to upgrade): cybox>=2.0.1.0,<2.0.2.0 in /usr/local/lib/python2.7/dist-packages/cybox-2.0.1.4-py2.7.egg (from maec==4.0.1.0)
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /usr/local/lib/python2.7/dist-packages/python_dateutil-2.2-py2.7.egg (from cybox>=2.0.1.0,<2.0.2.0->maec==4.0.1.0)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/lib/python2.7/dist-packages (from python-dateutil->cybox>=2.0.1.0,<2.0.2.0->maec==4.0.1.0)
Installing collected packages: maec
Running setup.py install for maec
Successfully installed maec
Cleaning up...
Oh. .. Ich konnte es endlich installieren. .. Deshalb habe ich es endlich verstanden!
Ich habe den Prozess des Versuchens und Irrtums lange Zeit geschrieben, aber am Ende ist es in der folgenden Reihenfolge.
#Legen Sie die Bibliotheken ab, von denen lxml abhängt
$ sudo apt-get install libxml2-dev libxslt1-dev zlib1g-dev
#Fügen Sie lxml ein
$ sudo CFLAGS="-O0" pip install lxml
#Cybox einfügen
$ wget https://github.com/CybOXProject/python-cybox/archive/v2.0.1.4.tar.gz
$ tar zxvf v2.0.1.4.tar.gz
$ cd python-cybox-2.0.1.4/
$ sudo python setup.py install
#Maec einfügen
$ sudo pip install maec==4.0.1.0
lxml scheint mit apt-get eingefügt zu sein.
$ sudo apt-get install python-lxml
Verwenden Sie diese Option, wenn Sie den obigen Befehl ändern.
#python-Vielleicht nur lxml
$ sudo apt-get install libxml2-dev libxslt1-dev zlib1g-dev python-lxml
#Cybox einfügen
$ wget https://github.com/CybOXProject/python-cybox/archive/v2.0.1.4.tar.gz
$ tar zxvf v2.0.1.4.tar.gz
$ cd python-cybox-2.0.1.4/
$ sudo python setup.py install
#Maec einfügen
$ sudo pip install maec==4.0.1.0
Es wurde stark vereinfacht.
Recommended Posts