Operating System - HP-UX
1833799 Members
3339 Online
110063 Solutions
New Discussion

How do I install chkrootkit in HP-UX 11.0

 
Kojiro Tomoika
New Member

How do I install chkrootkit in HP-UX 11.0

Hi all.
I have tried to install chkrootkit-0.42b on HP-UX 11.0 with gcc v 3.2.
get chkrootkit.tar.gz form ftp://ftp.pangeia.com.br/pub/seg/pac/ and
following steps.
# gzip -d chkrootkit.tar.gz
# tar xvf chkrootkit.tar
# cd chkrootkit-0.42b
# make sense

gcc -O -o chklastlog chklastlog.c
chklastlog.c: In function `main':
chklastlog.c:98: storage size of `lastlog_ent' isn't known
chklastlog.c:173: sizeof applied to an incomplete type
chklastlog.c:174: sizeof applied to an incomplete type
chklastlog.c:176: sizeof applied to an incomplete type
*** Error exit code 1

Someone who can install hkrootkit in HP-UX 11.0 ?
9 REPLIES 9
Balakumar M
Frequent Advisor

Re: How do I install chkrootkit in HP-UX 11.0

Hi,
If you have C Compiler try to compile with it.

There are two possiblity,

1) Down load Source again, and try to complie it.

2) gcc compiler may have problem.

Regards,
Bala

Life is a continues learning process
Stefan Farrelly
Honored Contributor

Re: How do I install chkrootkit in HP-UX 11.0

This is indeed a tough one. Ive tried lots of gcc versions, ANSI C, all dont work. Ive emailed the authors, lets hope they reply with a fix.

For now you can download a precompiled version here;

http://wap.mobile4u.de/chkrootkit-0.39a/

Its not the latest version, but it works fine. Simply select each file and right click SAVE TARGET AS (select type ALL FILES) then when done run ./chkrootkit

(These are 64bit binaries so you must run on an 11.0 64bit machine)

Im from Palmerston North, New Zealand, but somehow ended up in London...
Kojiro Tomoika
New Member

Re: How do I install chkrootkit in HP-UX 11.0

Hi all, thank you for your quick reply.

> Down load Source again, and try to complie it.

I try it, but same error occerd.

> gcc compiler may have problem.

Yes I have HP C Compiler.
Change Makefile and compile with HP C Compiler

# CC = gcc
CC = cc

# make sense
cc -O -o chklastlog chklastlog.c
cc: "chklastlog.c", line 98: error 1574: Unknown size for "lastlog_ent".
.
.

> For now you can download a precompiled version here;
> http://wap.mobile4u.de/chkrootkit-0.39a/

# ./chklastlog
sh: ./chklastlog: Execute permission denied.
# ls -l chklastlog
-rwxr-xr-x 1 root root 7216 Nov 14 16:03 chklastlog

This machine is L2000 that must be 64bit. Hummm.


Tony Tibbenham
Advisor

Re: How do I install chkrootkit in HP-UX 11.0

What did the chkrootkit maintainers say about your compiling problems?
I am attempting to compile chkrootkit 0.43 using cc with a similar lack of success and hope to hear from the maintainers again soon.
Tony Tibbenham
Advisor

Re: How do I install chkrootkit in HP-UX 11.0

I have now got all the chkrootkit programs (v0.43) to compile and run using gcc 3.3.2 on HP-UX 11 except
chklastlog.c
I have searched my entire system for lastlog.h [the header file that defines the lastlog_ent structure]. The file does not exist on my system.

.. where may I find lastlog.h?
J. Les Bemont
New Member

Re: How do I install chkrootkit in HP-UX 11.0

Add this to chklastlog.c:

# ifndef UT_HOSTSIZE
# define UT_HOSTSIZE 16
# endif /* UT_HOSTSIZE */
# ifndef UT_LINESIZE
# define UT_LINESIZE 12
# endif /* UT_LINESIZE */
#endif
#if defined(hpux)
struct lastlog {
time_t ll_time;
char ll_line[UT_LINESIZE];
char ll_host[UT_HOSTSIZE]; /* same as in utmp */
};
#endif /* hpux */

and add the following to CFLAGS:

CFLAGS = -DHAVE_LASTLOG_H -D _XPG4_EXTENDED -Dhpux

This should fix the compile problems.

--Les
Tony Tibbenham
Advisor

Re: How do I install chkrootkit in HP-UX 11.0

worked except for a miss-matched #endif ..
Was the missing #if important?

This just confirmed that my install of HP-UX does not have a lastlog ..
harry d brown jr
Honored Contributor

Re: How do I install chkrootkit in HP-UX 11.0

Using Les Bemont's "fix", I made some additional changes and got it to compile and run:

EDIT chkdirs.c
goto line 39
insert the following (after line 39):
#if defined(hpux)
#include
#endif

-------------------------------------------

EDIT chklastlog.c
goto line 47
insert the following (after line 47):
#ifndef UT_HOSTSIZE
# define UT_HOSTSIZE 16
#endif /* UT_HOSTSIZE */
#ifndef UT_LINESIZE
# define UT_LINESIZE 12
#endif /* UT_LINESIZE */
#if defined(hpux)
#include
struct lastlog {
time_t ll_time;
char ll_line[UT_LINESIZE];
char ll_host[UT_HOSTSIZE]; /* same as in utmp */
};
#endif /* hpux */

-------------------------------------------

EDIT Makefile
goto line 7
replace line 7 with:
CFLAGS = -DHAVE_LASTLOG_H -D_XPG4_EXTENDED -Dhpux

goto line 53
replace line 53 with:
${CC} ${CFLAGS} ${LDFLAGS} -o $@ chkdirs.c

PUT A TAB in FRONT of the ${CC} or the makefile will crap the bed!!!!!!!!!
-------------------------------------------

to "make" the package use either:

make sense

or

gmake sense

then run it like this:
./chkrootkit

live free or die
harry d brown jr
Live Free or Die
harry d brown jr
Honored Contributor

Re: How do I install chkrootkit in HP-UX 11.0

Stefan,

I also emailed the authors with the changes (and a link to this forum) to get it to work, hopefully they get them "in" by their next release ;-)

live free or die
harry d brown jr
Live Free or Die