Hi Kumar. It seems difficult to install OSSEC in Windows. Are you compiling the version 2.8.2 for a particular reason?
I tried to compile OSSEC 2.8.2 in my lab and I got some linker errors on memory allocation, I have not found a solution. I have downloaded the version 2.8.3 and I have got some errors but at less some binaries were compiled. There are errors on ossec-agent, ossec-rootcheck and setup-windows. I have resolved it in the following way: 1. After run gen_win.cmd, open (ossec)\src\win-pkg\headers\shared.h with an editor and comment the line 86: // #include <ws2tcpip.h> 2. Edit also the file win-pkg\make.bat and add -lshlapi (how appears on line 6) to lines 4, 5, and 7 (where are compiled the problematic binaries). 3. Now launch make.bat and every executable would appear. I get every binary but I was not able to compile the installer, I think the cause of this is that ossec-lua and ossec-luac are not compiled by make.bat. If you need the installer, maybe you could try to add the proper lines to compile these files. I hope it will help you. Best regards. Victor Fernandez. On Wednesday, April 6, 2016 at 9:08:55 PM UTC+2, Kumar Mg wrote: > > Hi, > > We are in the process of getting the OSSEC agents compiled on different > platforms (UNIX and Windows). To start with we were getting the Windows > agent compilation and was trying it out in the Windows 7 as well as Windows > 2008 versions. Followed the steps mentioned here - > http://ossec-docs.readthedocs.org/en/latest/manual/installation/compile-ossec-on-windows.html > . > > The win-pkg folders were created and it failed with following messages at > the time of make.sh. > > > > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg>make.bat > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg>echo > Maki > ng windows agent > Making windows agent > > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg>"C:\MinGW > \bin\windres.exe" -i icofile.rc -o icon.o > > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg>"C:\MinGW > \bin\gcc.exe" -o "ossec-agent" -Wall -DARGV0=\"ossec-agent\" -DCLIENT > -DWIN32 - > DOSSECHIDS icon.o os_regex/*.c os_net/*.c os_xml/*.c zlib-1.2.8/*.c > config/*.c s > hared/*.c os_execd/*.c os_crypto/blowfish/*.c os_crypto/md5/*.c > os_crypto/sha1/* > .c os_crypto/md5_sha1/*.c os_crypto/shared/*.c rootcheck/*.c *.c -I. > -Iheaders/ > -lwsock32 > rootcheck/win-common.c: In function '__os_winreg_querykey': > rootcheck/win-common.c:212:11: warning: variable 'sub_key_name_b' set but > not us > ed [-Wunused-but-set-variable] > TCHAR sub_key_name_b[MAX_KEY_LENGTH +1]; > ^ > In file included from run_realtime.c:45:0: > headers/shared.h:181:0: warning: "os_calloc" redefined > #define os_calloc(x,y,z) ((z = calloc(x,y)))?(void)1:ErrorExit(MEM_ERROR, > ARGV0 > ) > ^ > run_realtime.c:29:0: note: this is the location of the previous definition > #define os_calloc(x,y,z) (z = calloc(x,y))?(void)1:ErrorExit(MEM_ERROR, > ARGV0) > ^ > In file included from run_realtime.c:45:0: > headers/shared.h:183:0: warning: "os_strdup" redefined > #define os_strdup(x,y) ((y = strdup(x)))?(void)1:ErrorExit(MEM_ERROR, > ARGV0) > ^ > run_realtime.c:30:0: note: this is the location of the previous definition > #define os_strdup(x,y) (y = strdup(x))?(void)1:ErrorExit(MEM_ERROR, ARGV0) > ^ > seechanges.c: In function 'seechanges_addfile': > seechanges.c:347:5: warning: implicit declaration of function 'symlink' > [-Wimpli > cit-function-declaration] > if (symlink(old_location, old_tmp) == -1) { > ^ > C:\Users\ossec\AppData\Local\Temp\cc4a5eCY.o:seechanges.c:(.text+0x6f5): > undefin > ed reference to `symlink' > C:\Users\ossec\AppData\Local\Temp\cc4a5eCY.o:seechanges.c:(.text+0x75f): > undefin > ed reference to `symlink' > C:\Users\ossec\AppData\Local\Temp\cc4a5eCY.o:seechanges.c:(.text+0x7c9): > undefin > ed reference to `symlink' > collect2.exe: error: ld returned 1 exit status > > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg>"C:\MinGW > \bin\gcc.exe" -o "ossec-rootcheck" -Wall -DARGV0=\"ossec-rootcheck\" > -DCLIENT - > DWIN32 icon.o os_regex/*.c os_net/*.c os_xml/*.c config/*.c shared/*.c > win_servi > ce.c rootcheck/*.c -Iheaders/ -I. -lwsock32 > rootcheck/rootcheck-config.c: In function 'Read_Rootcheck_Config': > rootcheck/rootcheck-config.c:69:18: warning: variable 'xml_time' set but > not use > d [-Wunused-but-set-variable] > const char *(xml_time[])={xml_rootcheck, "frequency", NULL}; > ^ > rootcheck/win-common.c: In function '__os_winreg_querykey': > rootcheck/win-common.c:212:11: warning: variable 'sub_key_name_b' set but > not us > ed [-Wunused-but-set-variable] > TCHAR sub_key_name_b[MAX_KEY_LENGTH +1]; > ^ > > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg>"C:\MinGW > \bin\gcc.exe" -o "manage_agents" -Wall -DARGV0=\"manage-agents\" -DCLIENT > -DWIN > 32 -DMA os_regex/*.c zlib-1.2.8/*.c os_zlib.c shared/*.c > os_crypto/blowfish/*.c > os_crypto/md5/*.c os_crypto/shared/*.c addagent/*.c -Iheaders/ -I. > -lwsock32 -ls > hlwapi > > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg>"C:\MinGW > \bin\gcc.exe" -o setup-windows -Wall os_regex/*.c > -DARGV0=\"setup-windows\" -DCL > IENT -DWIN32 win_service.c shared/file_op.c shared/debug_op.c > setup/setup-win.c > setup/setup-shared.c -Iheaders/ -I. -lwsock32 > > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg>"C:\MinGW > \bin\gcc.exe" -o setup-syscheck -Wall os_regex/*.c os_xml/*.c > setup/setup-sysche > ck.c setup/setup-shared.c -I. -Iheaders/ > > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg>"C:\MinGW > \bin\gcc.exe" -o setup-iis -Wall os_regex/*.c setup/setup-iis.c -I. > > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg>"C:\MinGW > \bin\gcc.exe" -o add-localfile -Wall os_regex/*.c setup/add-localfile.c -I. > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg>cd > ui\ > > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg\ui>make > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg\ui>echo > > M > aking windows agent UI > Making windows agent UI > > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg\ui>"C:\Mi > nGW\bin\windres.exe" -o resource.o win32ui.rc > > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg\ui>"C:\Mi > nGW\bin\gcc.exe" -o "os_win32ui" -Wall -DARGV0=\"ossec-win32ui\" -DCLIENT > -DWIN3 > 2 resource.o ../os_net/*.c ../os_xml/*.c ../addagent/b64.c > ../shared/validate_op > .c ../shared/debug_op.c ../win_service.c *.c -I../headers/ -I../ > -lcomctl32 -mwi > ndows -lwsock32 > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg\ui>copy > > o > s_win32ui.exe ..\ > 1 file(s) copied. > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg\ui>cd > ../ > > > C:\Users\ossec\Downloads\ossec-hids-2.8.2\ossec-hids-2.8.2\src\win-pkg> > > > > I am not sure if there is anything we missed in the compilation steps. > Have any one else came across similar issue? > > > Thanks > Kumar > -- --- You received this message because you are subscribed to the Google Groups "ossec-list" group. To unsubscribe from this group and stop receiving emails from it, send an email to ossec-list+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.