Re: [Libguestfs] Fuzzing Questions
On Wed, Mar 18, 2020 at 01:46:14PM -0400, habib dan aouta wrote:
Hello Richard,
Hope you are doing well. My name is Habib and I am current student at the University of North Carolina at Charlotte(U.S). I am currently following your Libnbd client fuzzing tutorial from the Wordpress articles
[https://rwmj.wordpress.com/2019/10/09/using-american-fuzzy-lop-on-network-cl...]
and I am having issues compiling the Libnbd-wrapper.c file. After some research I am missing the Libnbd.so library file that I cannot seems to find anywhere. It will be nice if you can provide some help. Thank you for your time and consideration.
Not much to go on. What did you try? What error did you see? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
So I installed Libnbd which worked fined and then I was trying to run Libnbd-fuzz-wrapper.c and with afl using : afl-fuzz -i fuzzing/testcase_dir -o fuzzing/sync_dir -M fuzz01 \./fuzzing/libnbd-fuzz-wrapper @@ when I try that command it gives me an error saying Libnbd-fuzz-wrapper.c is not an EFL binary. Then I tried to compile Libnbd-fuzz-wrapper.c first into an executable file and then I get the following error: libnbd-fuzz-wrapper.c:130:3: warning: implicit declaration of function 'nbd_connect_socket' [-Wimplicit-function-declaration] nbd_connect_socket (nbd, sock); I also added the #include<libnbd.h> into the Libnbd-fuzz-wrapper.c but still getting the same error. Finally I ran this command : ld -lnbd —verbose and I found out libnbd library is missing attempt to open //usr/local/lib/x86_64-linux-gnu/libnbd.so failed attempt to open //usr/local/lib/x86_64-linux-gnu/libnbd.a failed attempt to open //lib/x86_64-linux-gnu/libnbd.so failed attempt to open //lib/x86_64-linux-gnu/libnbd.a failed attempt to open //usr/lib/x86_64-linux-gnu/libnbd.so failed attempt to open //usr/lib/x86_64-linux-gnu/libnbd.a failed attempt to open //usr/local/lib64/libnbd.so failed attempt to open //usr/local/lib64/libnbd.a failed attempt to open //lib64/libnbd.so failed attempt to open //lib64/libnbd.a failed attempt to open //usr/lib64/libnbd.so failed attempt to open //usr/lib64/libnbd.a failed attempt to open //usr/local/lib/libnbd.so failed attempt to open //usr/local/lib/libnbd.a failed attempt to open //lib/libnbd.so failed attempt to open //lib/libnbd.a failed attempt to open //usr/lib/libnbd.so failed attempt to open //usr/lib/libnbd.a failed attempt to open //usr/x86_64-linux-gnu/lib64/libnbd.so failed attempt to open //usr/x86_64-linux-gnu/lib64/libnbd.a failed attempt to open //usr/x86_64-linux-gnu/lib/libnbd.so failed attempt to open //usr/x86_64-linux-gnu/lib/libnbd.a failed ld: cannot find -lnbd
On Mar 18, 2020, at 1:56 PM, Richard W.M. Jones <rjones@redhat.com> wrote:
On Wed, Mar 18, 2020 at 01:46:14PM -0400, habib dan aouta wrote:
Hello Richard,
Hope you are doing well. My name is Habib and I am current student at the University of North Carolina at Charlotte(U.S). I am currently following your Libnbd client fuzzing tutorial from the Wordpress articles
[https://rwmj.wordpress.com/2019/10/09/using-american-fuzzy-lop-on-network-cl...]
and I am having issues compiling the Libnbd-wrapper.c file. After some research I am missing the Libnbd.so library file that I cannot seems to find anywhere. It will be nice if you can provide some help. Thank you for your time and consideration.
Not much to go on. What did you try? What error did you see?
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
On 3/18/20 1:24 PM, habib dan aouta wrote:
So I installed Libnbd which worked fined and then I was trying to run Libnbd-fuzz-wrapper.c and with afl using : afl-fuzz -i fuzzing/testcase_dir -o fuzzing/sync_dir -M fuzz01 \./fuzzing/libnbd-fuzz-wrapper @@
when I try that command it gives me an error saying Libnbd-fuzz-wrapper.c is not an EFL binary. Then I tried to compile Libnbd-fuzz-wrapper.c first into an executable file and then I get the following error: libnbd-fuzz-wrapper.c:130:3: warning: implicit declaration of function 'nbd_connect_socket' [-Wimplicit-function-declaration] nbd_connect_socket (nbd, sock);
I also added the #include<libnbd.h> into the Libnbd-fuzz-wrapper.c but still getting the same error.
Finally I ran this command : ld -lnbd —verbose and I found out libnbd library is missing attempt to open //usr/local/lib/x86_64-linux-gnu/libnbd.so failed
Hmm. That does not happen on Linux, but IS a typical error message on Cygwin. POSIX says that file names beginning with //name are implementation-defined; Linux defines them to resolve to /name, Cygwin defines them to be access to a file on the remote machine 'name' (as a nod to Windows \\server\share\file). If there is no remote machine named //usr in your network, that would explain not only this message, but also the message about libnbd-fuzz-wrapper not being an ELF binary (Windows uses pe-coff rather than ELF file format for its binaries, and I have no idea if afl can even begin to work with pe-coff). But since you didn't give us details about your platform, I'm shooting in the dark. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
So I installed Libnbd which worked fined and then I was trying to run Libnbd-fuzz-wrapper.c and with afl using : afl-fuzz -i fuzzing/testcase_dir -o fuzzing/sync_dir -M fuzz01 \./fuzzing/libnbd-fuzz-wrapper @@ when I try that command it gives me an error saying Libnbd-fuzz-wrapper.c is not an EFL binary. Then I tried to compile Libnbd-fuzz-wrapper.c first into an executable file and then I get the following error: libnbd-fuzz-wrapper.c:130:3: warning: implicit declaration of function 'nbd_connect_socket' [-Wimplicit-function-declaration] nbd_connect_socket (nbd, sock); I also added the #include<libnbd.h> into the Libnbd-fuzz-wrapper.c but still getting the same error. Finally I ran this command : ld -lnbd —verbose and I found out libnbd library is missing attempt to open //usr/local/lib/x86_64-linux-gnu/libnbd.so failed attempt to open //usr/local/lib/x86_64-linux-gnu/libnbd.a failed attempt to open //lib/x86_64-linux-gnu/libnbd.so failed attempt to open //lib/x86_64-linux-gnu/libnbd.a failed attempt to open //usr/lib/x86_64-linux-gnu/libnbd.so failed attempt to open //usr/lib/x86_64-linux-gnu/libnbd.a failed attempt to open //usr/local/lib64/libnbd.so failed attempt to open //usr/local/lib64/libnbd.a failed attempt to open //lib64/libnbd.so failed attempt to open //lib64/libnbd.a failed attempt to open //usr/lib64/libnbd.so failed attempt to open //usr/lib64/libnbd.a failed attempt to open //usr/local/lib/libnbd.so failed attempt to open //usr/local/lib/libnbd.a failed attempt to open //lib/libnbd.so failed attempt to open //lib/libnbd.a failed attempt to open //usr/lib/libnbd.so failed attempt to open //usr/lib/libnbd.a failed attempt to open //usr/x86_64-linux-gnu/lib64/libnbd.so failed attempt to open //usr/x86_64-linux-gnu/lib64/libnbd.a failed attempt to open //usr/x86_64-linux-gnu/lib/libnbd.so failed attempt to open //usr/x86_64-linux-gnu/lib/libnbd.a failed ld: cannot find -lnbd
On Mar 18, 2020, at 1:56 PM, Richard W.M. Jones <rjones@redhat.com> wrote:
On Wed, Mar 18, 2020 at 01:46:14PM -0400, habib dan aouta wrote:
Hello Richard,
Hope you are doing well. My name is Habib and I am current student at the University of North Carolina at Charlotte(U.S). I am currently following your Libnbd client fuzzing tutorial from the Wordpress articles
[https://rwmj.wordpress.com/2019/10/09/using-american-fuzzy-lop-on-network-cl...]
and I am having issues compiling the Libnbd-wrapper.c file. After some research I am missing the Libnbd.so library file that I cannot seems to find anywhere. It will be nice if you can provide some help. Thank you for your time and consideration.
Not much to go on. What did you try? What error did you see?
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
On Wed, Mar 18, 2020 at 02:28:37PM -0400, habib dan aouta wrote:
So I installed Libnbd which worked fine
Where/how did you install libnbd? Which version?
and then I was trying to run Libnbd-fuzz-wrapper.c and with afl using : afl-fuzz -i fuzzing/testcase_dir -o fuzzing/sync_dir -M fuzz01 \./fuzzing/libnbd-fuzz-wrapper @@
when I try that command it gives me an error saying Libnbd-fuzz-wrapper.c is not an EFL binary. Then I tried to compile Libnbd-fuzz-wrapper.c first into an executable file and then I get the following error:
If you build libnbd from source then libnbd-fuzz-wrapper should be built (in the fuzzing/ directory). You shouldn't need to compile it by hand. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
participants (3)
-
Eric Blake -
habib dan aouta -
Richard W.M. Jones