LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-29-2018, 09:07 AM   #1
//////
Member
 
Registered: Nov 2005
Location: Land of Linux :: Finland
Distribution: Arch Linux && OpenBSD 7.4 && Pop!_OS && Kali && Qubes-Os
Posts: 824

Rep: Reputation: 350Reputation: 350Reputation: 350Reputation: 350
[ compiling pyv8 ] error: command 'gcc' failed with exit status 1 [ fedora server 27 ]


hello all.

i am trying to compile pyv8 but i cant because i get an error.

Code:
In file included from /home/thug/pyv8/build/v8_r19632/src/elements.h:32:0,
                 from /home/thug/pyv8/build/v8_r19632/src/objects-inl.h:38,
                 from /home/thug/pyv8/build/v8_r19632/src/v8.h:62,
                 from src/V8Internal.h:7,
                 from src/Utils.cpp:12:
/home/thug/pyv8/build/v8_r19632/src/objects.h: At global scope:
/home/thug/pyv8/build/v8_r19632/src/objects.h:6440:44: error: left operand of shift expression ‘(-1 << 3)’ is negative [-fpermissive]
   static const int kElementsKindMask = (-1 << kElementsKindShift) &
                                        ~~~~^~~~~~~~~~~~~~~~~~~~~~
/home/thug/pyv8/build/v8_r19632/src/objects.h:8631:36: error: left operand of shift expression ‘(-8 << 26)’ is negative [-fpermissive]
       (~kMaxCachedArrayIndexLength << kArrayIndexHashLengthShift) |
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: command 'gcc' failed with exit status 1
i am following these steps :

Code:
$ git clone https://github.com/buffer/pyv8.git
$ cd pyv8
~/pyv8 $ python setup.py build # <-- here i get the error
~/pyv8 $ sudo python setup.py install
anyone with a clue what to do next?
 
Old 01-29-2018, 05:20 PM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,781

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
Looks like a bug in the source, possibly when that was written the compiler was less strict so it didn't trigger an error. I believe the [-fpermissive] at the end of the message indicates you can pass that flag to the compiler to turn the error into a warning. Try adding
Code:
extra_compile_args += ['-fpermissive']
to setup.py, around line 249 should probably work (though I'm not very familiar with such setup code).

https://gcc.gnu.org/onlinedocs/gcc-7...ex-fpermissive
Quote:
-fpermissive
Downgrade some diagnostics about nonconformant code from errors to warnings. Thus, using -fpermissive will allow some nonconforming code to compile.

Last edited by ntubski; 01-30-2018 at 07:07 AM. Reason: link to more recent gcc docs
 
1 members found this post helpful.
Old 01-30-2018, 02:17 AM   #3
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,863
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
@OP: You could edit the problematic lines in object.h Eg.:
Code:
Old: int whatnot = -1 << 7;
New: int whatnot = ((unsigned)-1) << 7;
 
1 members found this post helpful.
Old 01-30-2018, 06:53 AM   #4
//////
Member
 
Registered: Nov 2005
Location: Land of Linux :: Finland
Distribution: Arch Linux && OpenBSD 7.4 && Pop!_OS && Kali && Qubes-Os
Posts: 824

Original Poster
Rep: Reputation: 350Reputation: 350Reputation: 350Reputation: 350
thanks.
i got it to compile a little further with ntubski's code. throws a different error.

Code:
[thug@thug pyv8]$ sudo python setup.py build
WARN: V8_HOME doesn't exists or point to a wrong folder, 
/usr/lib/python2.7/site-packages/setuptools/dist.py:347: UserWarning: Normalizing '1.0-dev' to '1.0.dev0'
  normalized_version,
running build
====================
INFO: Patching the GYP scripts
INFO: skip to patch the Google v8 build/standalone.gypi file 
====================
INFO: building Google v8 with GYP for x64 platform with release mode
--------------------
INFO: build v8 from SVN ...
DEBUG: > make -j 8 objectprint=off i18nsupport=off verifyheap=off debuggersupport=on regexp=native vtunejit=off extrachecks=off visibility=on snapshot=on strictaliasing=on liveobjectlist=off backtrace=on gdbjit=off disassembler=off werror=no library=shared x64.release
ERROR: build v8 from SVN failed: code=2
<-- snip -->

<-- snip -->
g++ -pthread -shared -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld build/temp.linux-x86_64-2.7/src/Utils.o build/temp.linux-x86_64-2.7/src/Exception.o build/temp.linux-x86_64-2.7/src/Context.o build/temp.linux-x86_64-2.7/src/Engine.o build/temp.linux-x86_64-2.7/src/Wrapper.o build/temp.linux-x86_64-2.7/src/Debug.o build/temp.linux-x86_64-2.7/src/Locker.o build/temp.linux-x86_64-2.7/src/AST.o build/temp.linux-x86_64-2.7/src/PrettyPrinter.o build/temp.linux-x86_64-2.7/src/PyV8.o -L/usr/local/lib -L/home/thug/pyv8/build/v8_r19632/out/x64.release/obj.target/tools/gyp/ -L/usr/lib64 -lboost_python -lboost_thread -lboost_system -lrt -lv8_base.x64 -lv8_snapshot -lpython2.7 -o build/lib.linux-x86_64-2.7/_PyV8.so -fPIC -lrt
/bin/ld: cannot find -lv8_snapshot
collect2: error: ld returned 1 exit status
error: command 'g++' failed with exit status 1
i got it to compile after ...
Code:
V8_SNAPSHOT_ENABLED = False
... i edited that code in setup.py at line number 63.
not sure if it was right thing to do.

Code:
[thug@thug thug]$ sudo thug -h

Synopsis:
    Thug: Pure Python honeyclient implementation

    Usage:
        thug [ options ] url

    Options:
        -h, --help              	Display this help information
        -V, --version           	Display Thug version
        -i, --list-ua           	Display available user agents
        -u, --useragent=        	Select a user agent (use option -b for values, default: winxpie60)
        -e, --events=           	Enable comma-separated specified DOM events handling
        -w, --delay=            	Set a maximum setTimeout/setInterval delay value (in milliseconds)
        -n, --logdir=           	Set the log output directory
        -o, --output=           	Log to a specified file
        -r, --referer           	Specify a referer
        -p, --proxy=            	Specify a proxy (see below for format and supported schemes)
        -m, --attachment        	Set the attachment mode
        -l, --local             	Analyze a locally saved page
        -x, --local-nofetch     	Analyze a locally saved page and prevent remote content fetching
        -v, --verbose           	Enable verbose mode
        -d, --debug             	Enable debug mode
        -q, --quiet             	Disable console logging
        -a, --ast-debug         	Enable AST debug mode (requires debug mode)
        -g, --http-debug        	Enable HTTP debug mode
        -t, --threshold         	Maximum pages to fetch
        -j, --extensive         	Extensive fetch of linked pages
        -O, --connect-timeout   	Set the connect timeout (in seconds, default: 10 seconds)
        -T, --timeout=          	Set the analysis timeout (in seconds, default: 600 seconds)
        -c, --broken-url        	Set the broken URL mode
        -y, --vtquery           	Query VirusTotal for samples analysis
        -s, --vtsubmit          	Submit samples to VirusTotal
        -b, --vt-apikey=        	VirusTotal API key to be used at runtime
        -z, --web-tracking      	Enable web client tracking inspection
        -k, --no-honeyagent     	Disable HoneyAgent support

        Plugins:
        -A, --adobepdf=         	Specify Adobe Acrobat Reader version (default: 9.1.0)
        -P, --no-adobepdf       	Disable Adobe Acrobat Reader plugin
        -S, --shockwave=        	Specify Shockwave Flash version (default: 10.0.64.0)
        -R, --no-shockwave      	Disable Shockwave Flash plugin
        -J, --javaplugin=       	Specify JavaPlugin version (default: 1.6.0.32)
        -K, --no-javaplugin     	Disable Java plugin
        -L, --silverlight       	Specify SilverLight version (default: 4.0.50826.0)
        -N, --no-silverlight    	Disable SilverLight plugin

        Classifiers:
        --htmlclassifier=       	Specify a list of additional (comma separated) HTML classifier rule files
        --urlclassifier=        	Specify a list of additional (comma separated) URL classifier rule files
        --jsclassifier=         	Specify a list of additional (comma separated) JS classifier rule files
        --vbsclassifier=        	Specify a list of additional (comma separated) VBS classifier rule files
        --sampleclassifier=     	Specify a list of additional (comma separated) Sample classifier rule files
        --textclassifier=       	Specify a list of additional (comma separated) Text classifier rule files
        --htmlfilter=           	Specify a list of additional (comma separated) HTML filter files
        --urlfilter=            	Specify a list of additional (comma separated) URL filter files
        --jsfilter=             	Specify a list of additional (comma separated) JS filter files
        --vbsfilter=            	Specify a list of additional (comma separated) VBS filter files
        --samplefilter=         	Specify a list of additional (comma separated) Sample filter files
        --textfilter=           	Specify a list of additional (comma separated) Text filter files

        Logging:
        -F, --file-logging      	Enable file logging mode (default: disabled)
        -Z, --json-logging      	Enable JSON logging mode (default: disabled)
        -M, --maec11-logging    	Enable MAEC11 logging mode (default: disabled)
        -G, --elasticsearch-logging	Enable ElasticSearch logging mode (default: disabled)
        -D, --mongodb-address=  	Specify address and port of the MongoDB instance (format: host:port)
        -Y, --no-code-logging   	Disable code logging
        -U, --no-cert-logging   	Disable SSL/TLS certificate logging

    Proxy Format:
        scheme://[username:password@]host:port (supported schemes: http, socks4, socks5)

[thug@thug thug]$ sudo thug --list-ua
[sudo] password for thug: 

Synopsis:
    Thug: Pure Python honeyclient implementation

    Available User-Agents:
	winxpie60             Internet Explorer 6.0	(Windows XP)
	winxpie61             Internet Explorer 6.1	(Windows XP)
	winxpie70             Internet Explorer 7.0	(Windows XP)
	winxpie80             Internet Explorer 8.0	(Windows XP)
	winxpchrome20         Chrome 20.0.1132.47	(Windows XP)
	winxpfirefox12        Firefox 12.0		(Windows XP)
	winxpsafari5          Safari 5.1.7		(Windows XP)
	win2kie60             Internet Explorer 6.0	(Windows 2000)
	win2kie80             Internet Explorer 8.0	(Windows 2000)
	win7ie80              Internet Explorer 8.0	(Windows 7)
	win7ie90              Internet Explorer 9.0	(Windows 7)
	win7ie100             Internet Explorer 10.0	(Windows 7)
	win7chrome20          Chrome 20.0.1132.47	(Windows 7)
	win7chrome40          Chrome 40.0.2214.91	(Windows 7)
	win7chrome45          Chrome 45.0.2454.85	(Windows 7)
	win7chrome49          Chrome 49.0.2623.87	(Windows 7)
	win7firefox3          Firefox 3.6.13		(Windows 7)
	win7safari5           Safari 5.1.7		(Windows 7)
	win10ie110            Internet Explorer 11.0	(Windows 10)
	osx10chrome19         Chrome 19.0.1084.54	(MacOS X 10.7.4)
	osx10safari5          Safari 5.1.1		(MacOS X 10.7.2)
	linuxchrome26         Chrome 26.0.1410.19	(Linux)
	linuxchrome30         Chrome 30.0.1599.15	(Linux)
	linuxchrome44         Chrome 44.0.2403.89	(Linux)
	linuxchrome54         Chrome 54.0.2840.100	(Linux)
	linuxfirefox19        Firefox 19.0		(Linux)
	linuxfirefox40        Firefox 40.0		(Linux)
	galaxy2chrome18       Chrome 18.0.1025.166	(Samsung Galaxy S II, Android 4.0.3)
	galaxy2chrome25       Chrome 25.0.1364.123	(Samsung Galaxy S II, Android 4.0.3)
	galaxy2chrome29       Chrome 29.0.1547.59	(Samsung Galaxy S II, Android 4.1.2)
	nexuschrome18         Chrome 18.0.1025.133	(Google Nexus, Android 4.0.4)
	ipadchrome33          Chrome 33.0.1750.21	(iPad, iOS 7.1)
	ipadchrome35          Chrome 35.0.1916.41	(iPad, iOS 7.1.1)
	ipadchrome37          Chrome 37.0.2062.52	(iPad, iOS 7.1.2)
	ipadchrome38          Chrome 38.0.2125.59	(iPad, iOS 8.0.2)
	ipadchrome39          Chrome 39.0.2171.45	(iPad, iOS 8.1.1)
	ipadchrome45          Chrome 45.0.2454.68	(iPad, iOS 8.4.1)
	ipadchrome46          Chrome 46.0.2490.73	(iPad, iOS 9.0.2)
	ipadchrome47          Chrome 47.0.2526.70	(iPad, iOS 9.1)
	ipadsafari7           Safari 7.0		(iPad, iOS 7.0.4)
	ipadsafari8           Safari 8.0		(iPad, iOS 8.0.2)
	ipadsafari9           Safari 9.0		(iPad, iOS 9.1)

[thug@thug thug]$
atleast i can use the honeyclient and pass options to the thug.
thank you to both of you.

next i need to configure thug.

//////
 
Old 01-30-2018, 07:43 AM   #5
//////
Member
 
Registered: Nov 2005
Location: Land of Linux :: Finland
Distribution: Arch Linux && OpenBSD 7.4 && Pop!_OS && Kali && Qubes-Os
Posts: 824

Original Poster
Rep: Reputation: 350Reputation: 350Reputation: 350Reputation: 350
Code:
[thug@thug ~]$ sudo thug -u linuxchrome54 -w 20000 -o /home/thug/logs/thug.log -v -t 10 -F 118.24.0.[xx]/qxxxx.exe
[sudo] password for thug: 
[2018-01-30 15:38:26] [window open redirection] about:blank -> http://118.24.0.[xx]/qxxxx.exe
[2018-01-30 15:38:28] [HTTP] URL: http://118.24.0.[xx]/qxxxx.exe (Status: 200, Referer: None)
[2018-01-30 15:38:28] [HTTP] URL: http://118.24.0.[xx]/qxxxx.exe (Content-type: application/octet-stream, MD5: 43800e15dcb111a2cf8b9da694e50fea)
[2018-01-30 15:38:28] Thug analysis logs saved at ../logs/f5e7b639e18747270db89121533b0cc6/20180130153826
[thug@thug ~]$
got it configured. i obfuscated the malware serving url.
now to automate virustotal submission etc.
 
  


Reply

Tags
pyv8



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
autoreconf failed with exit status 1. How an I fix this error? P. eleazar Linux - Newbie 9 07-21-2016 10:53 AM
collect2: error: ld returned 1 exit status , for make install gcc-4.8.1 in gcc-pass1 cola Linux From Scratch 1 02-16-2014 10:51 PM
[SOLVED] RPM: error: %post(jboss-eap6-test-6.0.1-14.noarch) scriptlet failed, exit status 1 thomas2004ch Linux - Software 4 08-31-2013 12:16 PM
Install pyscard package on Ubuntu : error gcc failed with status 1 astrame Linux - Newbie 3 06-29-2009 04:57 PM
error: command 'gcc' failed with exit status 1 yuri16 Linux - Software 1 04-21-2009 01:27 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration