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-clients/#content]> 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-clients/#content] > >> 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-clients/#content] > >> 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 fineWhere/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
[Please keep replies on the mailing list] On Wed, Mar 18, 2020 at 02:46:07PM -0400, habib dan aouta wrote:> I installed Libnbd-1.0.0. I downloaded it from this link > http://download.libguestfs.org/libnbd/1.0-stable/ > <http://download.libguestfs.org/libnbd/1.0-stable/> and then > uncompressed it on linux ubuntu and then I followed the steps on the > GitHub readme to run with AFL-fuzz on this link > https://github.com/libguestfs/libnbd/blob/master/fuzzing/README > <https://github.com/libguestfs/libnbd/blob/master/fuzzing/README> .Since fuzzing is a relatively experimental feature it's probably best to start with the git repository: https://github.com/libguestfs/libnbd To build from git you will need a few extra dependencies, but it's all described in the README. Anyway after building it from source, the binary for fuzzing can be found in fuzzing/ Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/
Thank you sir appreciate it. I will try it that way. Also, I am trying to fuzz conman (https://www.embedded-computing.com/articles/the-connmanl <https://www.embedded-computing.com/articles/the-connmanl>) and I was wondering if its the same process or not.> On Mar 18, 2020, at 2:52 PM, Richard W.M. Jones <rjones@redhat.com> wrote: > > [Please keep replies on the mailing list] > > On Wed, Mar 18, 2020 at 02:46:07PM -0400, habib dan aouta wrote: >> I installed Libnbd-1.0.0. I downloaded it from this link >> http://download.libguestfs.org/libnbd/1.0-stable/ >> <http://download.libguestfs.org/libnbd/1.0-stable/> and then >> uncompressed it on linux ubuntu and then I followed the steps on the >> GitHub readme to run with AFL-fuzz on this link >> https://github.com/libguestfs/libnbd/blob/master/fuzzing/README >> <https://github.com/libguestfs/libnbd/blob/master/fuzzing/README> . > > Since fuzzing is a relatively experimental feature it's probably best > to start with the git repository: > > https://github.com/libguestfs/libnbd > > To build from git you will need a few extra dependencies, but it's all > described in the README. > > Anyway after building it from source, the binary for fuzzing can be > found in fuzzing/ > > Rich. > > -- > Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones > Read my programming and virtualization blog: http://rwmj.wordpress.com > virt-df lists disk usage of guests without needing to install any > software inside the virtual machine. Supports Linux and Windows. > http://people.redhat.com/~rjones/virt-df/ >
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 failedHmm. 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