Binaries are not executing after AFL installation in qemu mode - ubuntu-14.04

I have recently installed AFL and then its qemu mode, for which I required following packages.
'sudo apt-get install libtool automake bison libglib2.0-dev zlib1g-dev'
With these packages installed qemu installation worked fine. But after its installation whenever I tried to run binary with it, it generated AFL FORK SERVER HANDSHAKE FAILED error. I run my binary independently and it generated this error
cannot execute binary file: Exec format error.
I searched and found out this error is because of conflicting architectures which isn't in my case as I have build and run on same machine. Compiling with libtool also hasnot been a success libtool --mode=compile gcc -c one.c -o testlib.o.
I am also unable to execute any binary I create as default permissions are -rw-rw-r--, so I have to change their mods after creating them. This was not happening before above packages and installations. I even un-installed libtool but no success.
Any suggestions?

This has nothing to do with the libtool installation. I was making a silly mistake by using gcc -c test.c -o test.o which was not performing linking, see this. All I did is use command gcc test.c -o test.o and everything worked fine.

Related

Compile python3 script with Cython | CentOs 6.x

I've previously compiled the script with cython on ubuntu and it works fine on all ubuntu os but it doesnt works on centos, it failes with this error: error while loading shared libraries: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory.
So I tried to compile the script on centos but when I try to compile the C source code generated by Cython with the following command gcc -Os -I /usr/include/python3.6m -o a.o script.c -lpython3.6m -lpthread -lm -lutil -ldl
I get this error script.c:4:20: error: Python.h: No such file or directory
script.c:6:6: error: #error Python headers needed to compile C extensions, please install development version of Python..
I've tried to install python3 dev libs but seems like they don't exist for CentOs 6, and search for someone who has the same problem but I haven't found anything usefull so far.
I think I can solve the issuse by installing python3-devel.
SOLUTION: https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-centos-7
for centos 6 install ius repo like this:
yum install https://repo.ius.io/ius-release-el6.rpm https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm -y (source: https://ius.io/setup)

netinet/sctp.h: No such file or directory

I'm unable to include in any of my files. It always fails during compilation.
I got the lksctp-tools package installed.
I run
gcc -Wall -lsctp -o client admin.c deserializer.c input_parser.c main.c receive_response.c send_request.c serializer.c utils.c
And I get:
main.c:2:10: fatal error: netinet/sctp.h: No such file or directory
#include <netinet/sctp.h>
^~~~~~~~~~~~~~~~
compilation terminated.
I'm using Fedora, I don't know if that changes anything.
However the project seems to work fine on CLion.
On ubuntu need to install libsctp-dev.
sudo apt install libsctp-dev
ok turns out I had to do the following:
yum install lksctp-tools-dev
For Amazon Linux 2:
yum -y install lksctp-tools-devel

Compilation error for RISCV gcc when try to include -lcrypto

I am running openssl benchmarks on Ubuntu Linux. Initially, there was some problem with the missing library. Later I fixed it by installing the library with the installation command sudo apt-get install libssl-dev. When I compiled using gcc command gcc sha256t.c -o sha -lcrypto, it generates binary but when compiled using RISCV gcc command riscv64-unknown-elf-gcc sha256.S -o sha.riscv -lcrypto, it throws the following link error.
/home/user_name/fpga-zynq/rocket-chip/riscv-tools/riscv/lib/gcc/riscv64-unknown-elf/6.1.0/../../../../riscv64-unknown-elf/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status.
How to link the -lcrypto in this case.
You need a libcrypto compiled for the riscv64 architecture.
What you installed with sudo apt-get install libssl-dev is a libcrypto compiled for your host architecture (likely x86_64), it cannot be used for cross-compiling.
If you can't find a pre-built libcrypto for riscv64, you might have to compile it yourself, with that same riscv64 cross-compiler you're using.
Automating this is what yocto or buildroot is all about.

How to install Petite Chez Scheme on Ubuntu?

How to install Petite Chez Scheme on Ubuntu?
I run Ubuntu 15.10 and try to install pcsv8.4-a6le.tar.gz (non-threaded, 64 bit) for Linux.
After having unpacked this tar in /usr/locale, I enter the commands
sudo ./configure
sudo make install
from within the custom directory.
However, instead of a clean install, I get the following errors (which I hope someone can help me out with):
nlykkei#nlykkei-Studio-XPS-1640:/usr/local/csv8.4/custom$ sudo make install
if [ yes = no ]; then if [ ! -f ./scheme ]; then /bin/rm -f ./scheme; ln -s ../bin/a6le/scheme ./scheme; fi; fi
if [ ! -f ./petite ]; then /bin/rm -f ./petite; ln -s ./scheme ./petite; fi
/bin/rm -f ./scheme
echo "const char *S_date_stamp = \"`date +%m%d%Y%H%M%S`\";" > datestamp.c
gcc -m64 -rdynamic -o ./scheme datestamp.c ../boot/a6le/kernel.o ../boot/a6le/custom.o -lm -ldl -lncurses -lrt
/usr/bin/ld: cannot find -lncurses
collect2: error: ld returned 1 exit status
Mf-a6le:22: recipe for target 'scheme' failed
make[2]: *** [scheme] Error 1
Makefile:47: recipe for target 'buildpetite' failed
make[1]: *** [buildpetite] Error 2
Mf-install:64: recipe for target 'install' failed
make: *** [install] Error 2
On recent versions of Ubuntu (and future versions of Debian e.g. "Buster", and other Debian based distros), you can install Chez Scheme directly from the repo(s) by:
sudo apt install chezscheme
Previously you had to install it by compiling from source. Chez Scheme has been open source, for a few years now, and can be compiled from source, if it is not directly installable from the distribution's repo(s). Just download the source code compile and install. This will install not just the "petite" runtime version but also the full compiler. You can compile and install the software with:
./configure
sudo make install
Full build and install instructions are available here.
Pre-requisites for building are:
GNU Make
GCC
Header files and libraries for ncurses
Header files and libraries for X windows
On Ubuntu, install the libncurses5-dev package to get libncurses.so. (You can discover this by visiting http://packages.debian.org/file:libncurses.so (sadly, this doesn't seem to work for http://packages.ubuntu.com/file:libncurses.so).)
You may find other linkage errors if Chez requires other libraries to have development packages installed too. Use the same technique as above.
Go directly building from their Github.
ChezScheme
And then just do
./configure
sudo make install
Prerequisites according to Building are:
GNU Make
gcc
Header files and libraries for ncurses
Header files and libraries for X windows
And yes in case On Ubuntu, install the libncurses5-dev as Chris stated. Did just that and have no errors shown in clean install.
Chez Scheme has been open sourced since this question was asked. Since Bionic (18.04LTS) the full chezscheme is available as a repository.
First do
sudo apt update
then install the package:
sudo apt install chezscheme
This provides both the petite interpreter and the full scheme compiler.
There is also a PPA for trusty and xenial here:
https://launchpad.net/~jonathonf/+archive/ubuntu/lisp?field.series_filter=
Download the RPM package instead and use alien from terminal to produce a deb file:
fakeroot alien PetiteChezScheme-8.4-1.x86_64.rpm
You may need to install fakeroot, alien for this to work:
apt-get install fakeroot alien
Then you'll have a deb file. If you are on a desktop you can just double click the file and it will open Software Center and you can click install and it will fix your dependency problems.

libcurl with libssh2 - one or more libs available at link-time are not available run-time

I get the following error when trying to ./configure libcurl 7.22.0
one or more libs available at link-time are not available run-time. Libs used at link-time: -lssh2 -lssl -lcrypto -lrt -lz
When I ./configure with --without-libssh2 it works just fine.
Steps I have taken:
apt-get install libssl-dev
apt-get install libssh-dev
cd /var
wget http://www.libssh2.org/download/libssh2-1.3.0.tar.gz
tar -zxvf libssh2-1.3.0.tar.gz
cd libssh2-1.3.0
./configure
make
make install
SSL support works fine, by the way. I must have done something wrong with libssh
I have also tried:
./configure --with-libssh2
./configure --with-libssh2-path=/usr/local/lib
./configure --with-libssh2=/usr
./configure --with-libssh2=/usr/local/lib
But it didn't make a difference. I don't know what else to try.
The "libssh-dev" package is completely unrelated and unnecessary since it's a different library not used by libcurl nor libssh2.
The problem you face is probably that "make install" with libssh2 installs the library /usr/local/lib by default and you have not edited /etc/ld.so.conf to load libs from that directory. Edit the file and run ldconfig (both actions as root). Alternatively, install libssh2 into another directory that already is searched in by ld.so.
check while openssl installed successly?
openssl version
if not show version info, set openssl correctly
for example:
ln -s /usr/local/lib64/libssl.so.1.1 /usr/lib64/libssl.so.1.1
ln -s /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1
and continue install curl, it work for me

Resources