Volatillity missing MODULE LICENSE() - volatility

I'm trying to make a profile in Volatility 2. I tried on Debian, Kali and Ubuntu 120.04 and Ubuntu 18 (gcc 7.5.0). I tried to update the headers, export pathes etc.. but still I have the same error . I tried also to dowload a profile from github but they are too old ( i didn't found nothing new - just Ubuntu 14) . I also checked module.h info but didn't find antything helpfull. Any idea what i can do?
make -C //lib/modules/4.15.0-162-generic/build CONFIG_DEBUG_INFO=y M="/root/volatility-master/tools/linux" modules
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-162-generic'
CC [M] /root/volatility-master/tools/linux/module.o
Building modules, stage 2.
MODPOST 1 modules
WARNING: modpost: missing MODULE_LICENSE() in /root/volatility-master/tools/linux/module.o
see include/linux/module.h for more information
CC /root/volatility-master/tools/linux/module.mod.o
LD [M] /root/volatility-master/tools/linux/module.ko
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-162-generic'
dwarfdump -di module.ko > module.dwarf
make -C //lib/modules/4.15.0-162-generic/build M="/root/volatility-master/tools/linux" clean
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-162-generic'
CLEAN /root/volatility-master/tools/linux/.tmp_versions
CLEAN /root/volatility-master/tools/linux/Module.symvers
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-162-generic'

Related

Buildroot plugin file is compiled for the target architecture altough used later in Makefile

I am trying to create an package for dietsplash for buildroot, and I've added the files
Config.in
config BR2_PACKAGE_DIETSPLASH
bool "dietsplash"
help
dietsplash is an simple splash screen service for
embedded devices. It has support for animations.
dietsplash.mk
################################################################################
#
# dietsplash
#
################################################################################
DIETSPLASH_VERSION = v0.3
DIETSPLASH_SOURCE = dietsplash-$(DIETSPLASH_VERSION).tar.gz
DIETSPLASH_SITE = git://github.com/lucasdemarchi/dietsplash.git
DIETSPLASH_AUTORECONF = YES
$(eval $(autotools-package))
The github repository is
https://github.com/lucasdemarchi/dietsplash
The output of make is:
>>> dietsplash v0.3 Building
PATH="/media/justus_fluegel/PROJECTS/buildroot/buildroot-2019.11.1/output/host/bin:/media/justus_fluegel/PROJECTS/buildroot/buildroot-2019.11.1/output/host/sbin:/home/justus_fluegel/.pub-cache/bin/:/usr/share/flutter/flutter/bin/cache/dart-sdk/bin/:/usr/share/flutter/flutter/bin/:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/snap/bin:/usr/local/texlive/2019/bin/x86_64-linux" /usr/bin/make -j5 -C /media/justus_fluegel/PROJECTS/buildroot/buildroot-2019.11.1/output/build/dietsplash-v0.3/
make[1]: Entering directory '/media/justus_fluegel/PROJECTS/buildroot/buildroot-2019.11.1/output/build/dietsplash-v0.3'
/usr/bin/make all-am
make[2]: Entering directory '/media/justus_fluegel/PROJECTS/buildroot/buildroot-2019.11.1/output/build/dietsplash-v0.3'
GEN src/background.h
/bin/bash: src/genstaticlogo: cannot execute binary file: Exec format error
Makefile:1017: recipe for target 'src/background.h' failed
make[2]: *** [src/background.h] Error 126
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/media/justus_fluegel/PROJECTS/buildroot/buildroot-2019.11.1/output/build/dietsplash-v0.3'
Makefile:400: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/media/justus_fluegel/PROJECTS/buildroot/buildroot-2019.11.1/output/build/dietsplash-v0.3'
package/pkg-generic.mk:238: recipe for target '/media/justus_fluegel/PROJECTS/buildroot/buildroot-2019.11.1/output/build/dietsplash-v0.3/.stamp_built' failed
make: *** [/media/justus_fluegel/PROJECTS/buildroot/buildroot-2019.11.1/output/build/dietsplash-v0.3/.stamp_built] Error 2
And file of src/genstaticlogo
src/genstaticlogo: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 4.19.0, not stripped
I think the problem is that src/genstaticlogo is compiled for the target but executed by the Makefile.am during the build process. How do I tell make to compile src/genstaticlogo for the build machine and not for the target? Altough the repository is not my work, it's theoretically possible to modify the makefile after download.
Thank you for your help!
You will need to patch the Makefile.am to support cross-compilation. See this old answer for details. In short, you will need something like this in the Makefile.am:
$(genstaticlogo_OBJECTS): CC=$(CC_FOR_BUILD)
$(genstaticlogo_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD)
$(genstaticlogo_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
Since you will be patching Makefile.am, you will also need to set DIETSPLASH_AUTORECONF = YES in the Buildroot dietsplash.mk file.

How to compile tool and samples from within the kernel source tree? (e.g. bpftool, bpf samples)

GOAL: compile samples/bpf, compile bpf/bpftool and use them.
PROBLEM: on a VM with Ubuntu 18.04 bionic with a kernel 4.18.0-25-generic I've installed kernel src code executing apt install linux-source-4.18.0.
Now I cd into /usr/src/linux-source-4.18.0/linux-source-4.18.0/samples/bpf and I run make and the result is
make -C ../../ /usr/src/linux-source-4.18.0/linux-source-4.18.0/samples/bpf/ BPF_SAMPLES_PATH=/usr/src/linux-source-4.18.0/linux-source-4.18.0/samples/bpf
make[1]: Entering directory '/usr/src/linux-source-4.18.0/linux-source-4.18.0'
scripts/kconfig/conf --syncconfig Kconfig
***
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
scripts/kconfig/Makefile:40: recipe for target 'syncconfig' failed
make[3]: *** [syncconfig] Error 1
Makefile:562: recipe for target 'syncconfig' failed
make[2]: *** [syncconfig] Error 2
make[1]: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/kernel.release'. Stop.
make[1]: Leaving directory '/usr/src/linux-source-4.18.0/linux-source-4.18.0'
Makefile:203: recipe for target 'all' failed
make: *** [all] Error 2
If I cd into ../samples/bpf and I run sudo make the result is
Auto-detecting system features:
... libbfd: [ OFF ]
... disassembler-four-args: [ OFF ]
CC map_perf_ring.o
CC xlated_dumper.o
CC perf.o
CC cfg.o
CC common.o
CC cgroup.o
CC main.o
main.c:36:10: fatal error: bfd.h: No such file or directory
#include <bfd.h>
^~~~~~~
compilation terminated.
Makefile:92: recipe for target 'main.o' failed
make: *** [main.o] Error 1
QUESTIONS: what am I missing? After I compile them if I want to write a program which, for example, needs to use bpftool I have to write the program inside the source kernel directory or I can write it everywhere?
Build errors
The first case (Makefile:562: recipe for target 'syncconfig' failed) fails because you run make from the top of the linux kernel repository, and before trying to compile the samples, the build system tries to load a config file to use for your system (but does not find one).
Before trying to build the samples (make -C samples/bpf), you can create a .config file from your current kernel configuration like this:
$ cp /usr/src/linux-headers-$(uname -r)/.config <path to repo>/.config
$ make olddefconfig
Or even simply generate a default config file from scratch:
$ make defconfig
See make help from top directory to see the available make options.
Your second error, regarding bfd.h not found, is that you miss a library. Libbfd on Ubuntu comes with binutils-dev, so apt install binutils-dev should do the trick.
Compiling the programs
Finally, regarding your question on compiling the programs:
You can write and build program from the kernel repository, just by creating a new sample and reusing the existing Makefiles.
You can also write and compile programs outside of the kernel tree. The basic clang (v4.0 or above, if possible v6.0 or above) command to compile them usually looks something like this:
$ clang -O2 -emit-llvm -c my_bpf_prog.c -o - | \
llc -march=bpf -filetype=obj -o my_bpf_prog.o
You can find examples of programs compiled out of the kernel tree in that repository (disclaimer: by my company) or in the XDP tutorial repo.

Installation SystemC 2.3.2 failed

I want to install SystemC 2.3.2 on ubuntu 16.04 So i followd the install file directives:
2. Create a temporary directory, e.g.,
> mkdir objdir
3. Change to the temporary directory, e.g.,
> cd objdir
4. Choose your compiler by setting the CXX environment variable
> export CXX=g++
5. Configure the package for your system, e.g.,
(The configure script is explained below.)
> ../configure
In case you want to install the package in another place than the
top level directory (systemc-2.3.2), configure the package e.g. as
follows:
> ../configure --prefix=/usr/local/systemc-2.3.2
6. Compile the package.
> make
7. At this point you may wish to verify the compiled package by
testing the example suite.
> make check
8. Install the package.
> make install
9. You can now remove the temporary directory, .e.g,
> cd ..
> rm -rf objdir
every step went good until i reached step 8 to install the package ... i get the following error:
user#user-Lenovo-IdeaPad-Y510P:~/systemc-2.3.2/objdir$ make install
Making install in docs
make[1]: Entering directory '/home/anoir/systemc-2.3.2/objdir/docs'
make[2]: Entering directory '/home/anoir/systemc-2.3.2/objdir/docs'
make[2]: Nothing to be done for 'install-exec-am'.
/bin/mkdir -p '/usr/local/systemc-2.3.2/docs'
/bin/mkdir: cannot create directory ‘/usr/local/systemc-2.3.2’: Permission denied
Makefile:380: recipe for target 'install-nobase_docDATA' failed
make[2]: *** [install-nobase_docDATA] Error 1
make[2]: Leaving directory '/home/anoir/systemc-2.3.2/objdir/docs'
Makefile:453: recipe for target 'install-am' failed
make[1]: *** [install-am] Error 2
make[1]: Leaving directory '/home/anoir/systemc-2.3.2/objdir/docs'
Makefile:505: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
I don't understand the problem. What could be my mistake
Default install location need root access. If you don't have it. Try to install it to other location which you have right to access.
For example:
../configure --prefix ${HOME}/SystemC

linux/scripts/recordmcount: No such file or directory

When I try to make a kernel module of Linux, the following error message appears:
/home/mynfs/linux/scripts/recordmcount: No such file or directory
What's wrong with it?
PS: /home/mynfs/linux/ is the directory my source tree is in.
[root#localhost yiran]# make CONFIG_NFS_ACL_SUPPORT=m -C /home/mynfs/linux M=/home/mynfs/linux/fs/nfs_common modules
make: Entering directory `/home/mynfs/linux'
WARNING: Symbol version dump /home/mynfs/linux/Module.symvers
is missing; modules will have no dependencies and modversions.
CC [M] /home/mynfs/linux/fs/nfs_common/nfsacl.o
**/bin/sh: /home/mynfs/linux/scripts/recordmcount: No such file or directory**
make[1]: * [/home/mynfs/linux/fs/nfs_common/nfsacl.o] Error 1
make: * [_module_/home/mynfs/linux/fs/nfs_common] Error 2
make: Leaving directory `/home/mynfs/linux'
[root#localhost yiran]# ls /home/mynfs/linux/scripts | grep recordmcount
recordmcount.c
recordmcount.h
recordmcount.pl
I had the same problem, and just making recordmcount solved it partially. There were other scripts/* modules missing.
The following command built all the modules that were missing for me:
cd $(sysroot)/usr/src/linux (in your case it should be /home/mynfs/linux)
make scripts
Then all the scripts modules were built and I had no further problems compiling kernel modules.
you should build recordmcount by doing
make recordmcount
in /home/mynfs/linux/scripts

installing isolated gcc on server without sudo

I have access to a server (but don't have root permissions on there). To cut a long story short the admin won't upgrade to the newer version of gcc that I need, but has suggested that I can just install it locally.
I'm having some issues doing this, despite trying to follow the guide at http://gcc.gnu.org/install/index.html. I want to use the new versions of GMP, MPFR, and MPC that are installed now on the server.
I first go into my home dir on the server then mkdir mygcc which I then cd into (this is to be the build dir and is not a sub-dir of src dir), from there I do
/home/username/gcc-4.6.3/configure --with-gmp="/software/gmp-5.0.5" --with-
gmp-include="/software/gmp-5.0.5/include" --with-gmp-lib="/software/gmp-5.0.5/lib"
--with-mpfr="/software/mpfr-3.1.1" --with-mpfr-include="/software/mpfr-3.1.1/include"
--with-mpfr-lib="/software/mpfr-3.1.1/lib" --with-mpc-include="/home/username/usr/local
/include" --with-mpc-lib="/home/username/usr/local/lib" --prefix="/home/username/mygcc"
--with-local-prefix="/home/username/usr/local"
the src files that I unzipped are at /home/pmxlh1/gcc-4.6.3.
I also made the directories /home/username/usr/include, /home/username/usr/local etc and set the prefix flags to try and install various things there, but it also fails if I just leave those flags out for the same reasons.
When I get to make however it ends with
checking for suffix of object files... configure: error: in `/home/pmxlh1/mygcc/x86_64-
unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/home/pmxlh1/mygcc'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/pmxlh1/mygcc'
make: *** [all] Error 2
Not sure if I'm going about this the correct way? But basically I want to install it in my home/dir and so that it uses the correct GMP/MPFR/MPC not the old versions that maybe lurking elsewhere on the server.
thanks for any help

Resources