Changeset 1636

Show
Ignore:
Timestamp:
06/27/08 21:30:14 (2 months ago)
Author:
till
Message:

honeytrap
- replace SavePostgres? with SubmitPostgres?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • honeytrap/trunk/configure.in

    r1555 r1636  
    741741 
    742742 
    743  
    744 AC_ARG_WITH(postgres, 
    745         [  --with-postgres                 store attack data in PostgreSQL database]) 
    746 AM_CONDITIONAL(BUILD_POSTGRES_PLUGIN, test x$with_postgres = xyes) 
    747 if test "$with_postgres" = "yes"; then 
    748   with_postgres="X" 
     743AC_ARG_WITH(submit-postgres, 
     744        [  --with-submit-postgres          store attack data in PostgreSQL database]) 
     745AM_CONDITIONAL(BUILD_SUBMIT_POSTGRES_PLUGIN, test x$with_submit_postgres = xyes) 
     746if test "$with_submit_postgres" = "yes"; then 
     747        if test "$enable_devmodules" != "X"; then 
     748                echo 
     749                echo "   The submitPostgres plugin is still unstable and should not be used in production setups." 
     750                bold "   Use %B--enable-devmodules%b to build it anyway." 
     751                echo 
     752                echo 
     753                exit 
     754        fi 
     755 
     756  with_submit_postgres="X" 
    749757  AC_ARG_WITH(libpq_includes, 
    750758    [  --with-libpq-includes=DIR       libpq include directory], 
     
    764772    bold "   %BError%b - libpq headers not found. Install them or use the following options:" 
    765773    echo 
    766     bold "   %B--with-libpq-includes=%b\133location of libpq header files\135
     774    bold "   %B--with-libpq-includes=%b\x5blocation of libpq header files\x5d
    767775    echo 
    768776    exit 
     
    778786    bold "   %BError%b - libpq library not found. Install it or use the following options:" 
    779787    echo 
    780     bold "   %B--with-libpq-libraries=%b\133location of libpq shared library files\135
     788    bold "   %B--with-libpq-libraries=%b\x5blocation of libpq shared library files\x5d
    781789    echo 
    782790    exit 
     
    785793  AC_DEFINE([USE_POSTGRES_DB], [], [Define to store attacks in PostgreSQL database]) 
    786794else 
    787   with_postgres=" " 
     795  with_submit_postgres=" " 
    788796fi 
    789797 
     
    902910bold "    (%B$with_cspm%b)  CSPM" 
    903911echo 
    904 bold "    (%B$with_postgres%b)  PostgeSQL" 
     912bold "    (%B$with_submit_postgres%b)  PostgeSQL" 
    905913echo 
    906914bold "    (%B$with_spamsum%b)  SpamSum" 
  • honeytrap/trunk/src/modules/Makefile.am

    r1555 r1636  
    2121endif 
    2222 
    23 if BUILD_POSTGRES_PLUGIN 
    24 lib_LTLIBRARIES += htm_SavePostgres.la 
    25 endif 
    26  
    2723if BUILD_CPUEMU_PLUGIN 
    2824lib_LTLIBRARIES += htm_cpuEmu.la 
     
    3935if BUILD_SUBMIT_NEBULA_PLUGIN 
    4036lib_LTLIBRARIES += htm_submitNebula.la 
     37endif 
     38 
     39if BUILD_SUBMIT_POSTGRES_PLUGIN 
     40lib_LTLIBRARIES += htm_submitPostgres.la 
    4141endif 
    4242 
     
    6464endif 
    6565 
    66 if BUILD_POSTGRES_PLUGIN 
    67 htm_SavePostgres_la_SOURCES = htm_SavePostgres.c htm_SavePostgres.h 
    68 htm_SavePostgres_la_LDFLAGS = -module -no-undefined -avoid-version -lpq 
    69 endif 
    70  
    7166if BUILD_CPUEMU_PLUGIN 
    7267htm_cpuEmu_la_SOURCES = htm_cpuEmu.c htm_cpuEmu.h 
     
    8984endif 
    9085 
     86if BUILD_SUBMIT_POSTGRES_PLUGIN 
     87htm_submitPostgres_la = htm_submitPostgres.c htm_submitPostgres.h 
     88htm_submitPostgres_la_LDFLAGS = -module -no-undefined -avoid-version -lpq 
     89endif 
     90 
    9191 
    9292if BUILD_CSPM_PLUGIN 
  • honeytrap/trunk/src/modules/htm_cpuEmu.c

    r1634 r1636  
    467467                        dup2(psiStartInfo->hStdError,  fileno(stderr)); 
    468468 
    469                         system("/bin/sh -c \"cd ~/.wine/drive_c/; wine 'c:\\windows\\system32\\cmd_orig.exe' \""); 
     469//                      system("/bin/sh -c \"cd ~/.wine/drive_c/; WINEDEBUG=-all wine 'c:\\windows\\system32\\cmd_orig.exe' \""); 
     470                        system("WINEDEBUG=-all wine 'c:\\windows\\system32\\cmd_orig.exe'"); 
    470471                         
    471472                        exit(EXIT_SUCCESS); 
     
    480481uint32_t user_hook_accept(struct emu_env *env, struct emu_env_hook *hook, ...) { 
    481482        va_list         vl; 
    482         int             s; 
    483         struct sockaddr *saddr; 
    484         socklen_t       *saddrlen; 
    485          
     483        int             s, sockfd; 
     484        struct sockaddr *saddr, daddr; 
     485        socklen_t       *saddrlen, socklen; 
     486//      Attack          *a; 
     487        char            shost[16], dhost[16]; 
     488 
     489        memset(shost, 0, 16); 
     490        memset(dhost, 0, 16); 
    486491 
    487492        logmsg(LOG_NOISY, 1, "CPU Emulation - Hooking accept() call.\n"); 
     
    495500        va_end(vl); 
    496501 
    497         return accept(s, saddr, saddrlen); 
     502        if ((sockfd = accept(s, saddr, saddrlen)) == -1) { 
     503                logmsg(LOG_ERR, 1, "CPU Emulation Error - Unable to accept incoming connection: %s.\n", strerror(errno)); 
     504                exit(EXIT_FAILURE); 
     505        } 
     506        logmsg(LOG_NOISY, 1, "-------------------------------------\n"); 
     507 
     508        socklen = sizeof(struct sockaddr); 
     509        if (getpeername(s, &saddr, &socklen) == -1) { 
     510                logmsg(LOG_ERR, 1, "CPU Emulation Error - Unable to get peer information: %s.\n", strerror(errno)); 
     511                exit(EXIT_FAILURE); 
     512        } 
     513 
     514        if ((inet_ntop(AF_INET, saddr, shost, 16) == NULL) || 
     515            (inet_ntop(AF_INET, &daddr, dhost, 16) == NULL)) { 
     516                logmsg(LOG_ERR, 1, "CPU Emulation Error - Unable to convert IP address: %s.\n", strerror(errno)); 
     517                exit(EXIT_FAILURE); 
     518        }  
     519 
     520        logmsg(LOG_NOISY, 1, "CPU Emulation - Connection accepted: %s:%u <- %s:%u.\n", shost, ((struct sockaddr_in *)saddr)->sin_port, dhost, ((struct sockaddr_in *)&daddr)->sin_port); 
     521 
     522 
     523/* 
     524        if ((a = new_virtattack(*(struct in_addr*) &, *(struct in_addr*) &a->m_action.m_connectback.m_remotehost, 0, a->m_action.m_connectback.m_remoteport, TCP)) == NULL) { 
     525                logmsg(LOG_ERR, 1, "CSPM Error - Unable to create virtual attack for connectback session.\n"); 
     526                exit(EXIT_FAILURE); 
     527        } 
     528*/ 
     529         
     530 
     531 
     532        return sockfd; 
    498533} 
    499534