Changeset 1636
- Timestamp:
- 06/27/08 21:30:14 (2 months ago)
- Files:
-
- honeytrap/trunk/configure.in (modified) (5 diffs)
- honeytrap/trunk/src/modules/Makefile.am (modified) (4 diffs)
- honeytrap/trunk/src/modules/htm_SavePostgres.c (deleted)
- honeytrap/trunk/src/modules/htm_SavePostgres.h (deleted)
- honeytrap/trunk/src/modules/htm_cpuEmu.c (modified) (3 diffs)
- honeytrap/trunk/src/modules/htm_submitPostgres.c (added)
- honeytrap/trunk/src/modules/htm_submitPostgres.h (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
honeytrap/trunk/configure.in
r1555 r1636 741 741 742 742 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" 743 AC_ARG_WITH(submit-postgres, 744 [ --with-submit-postgres store attack data in PostgreSQL database]) 745 AM_CONDITIONAL(BUILD_SUBMIT_POSTGRES_PLUGIN, test x$with_submit_postgres = xyes) 746 if 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" 749 757 AC_ARG_WITH(libpq_includes, 750 758 [ --with-libpq-includes=DIR libpq include directory], … … 764 772 bold " %BError%b - libpq headers not found. Install them or use the following options:" 765 773 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" 767 775 echo 768 776 exit … … 778 786 bold " %BError%b - libpq library not found. Install it or use the following options:" 779 787 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" 781 789 echo 782 790 exit … … 785 793 AC_DEFINE([USE_POSTGRES_DB], [], [Define to store attacks in PostgreSQL database]) 786 794 else 787 with_ postgres=" "795 with_submit_postgres=" " 788 796 fi 789 797 … … 902 910 bold " (%B$with_cspm%b) CSPM" 903 911 echo 904 bold " (%B$with_ postgres%b) PostgeSQL"912 bold " (%B$with_submit_postgres%b) PostgeSQL" 905 913 echo 906 914 bold " (%B$with_spamsum%b) SpamSum" honeytrap/trunk/src/modules/Makefile.am
r1555 r1636 21 21 endif 22 22 23 if BUILD_POSTGRES_PLUGIN24 lib_LTLIBRARIES += htm_SavePostgres.la25 endif26 27 23 if BUILD_CPUEMU_PLUGIN 28 24 lib_LTLIBRARIES += htm_cpuEmu.la … … 39 35 if BUILD_SUBMIT_NEBULA_PLUGIN 40 36 lib_LTLIBRARIES += htm_submitNebula.la 37 endif 38 39 if BUILD_SUBMIT_POSTGRES_PLUGIN 40 lib_LTLIBRARIES += htm_submitPostgres.la 41 41 endif 42 42 … … 64 64 endif 65 65 66 if BUILD_POSTGRES_PLUGIN67 htm_SavePostgres_la_SOURCES = htm_SavePostgres.c htm_SavePostgres.h68 htm_SavePostgres_la_LDFLAGS = -module -no-undefined -avoid-version -lpq69 endif70 71 66 if BUILD_CPUEMU_PLUGIN 72 67 htm_cpuEmu_la_SOURCES = htm_cpuEmu.c htm_cpuEmu.h … … 89 84 endif 90 85 86 if BUILD_SUBMIT_POSTGRES_PLUGIN 87 htm_submitPostgres_la = htm_submitPostgres.c htm_submitPostgres.h 88 htm_submitPostgres_la_LDFLAGS = -module -no-undefined -avoid-version -lpq 89 endif 90 91 91 92 92 if BUILD_CSPM_PLUGIN honeytrap/trunk/src/modules/htm_cpuEmu.c
r1634 r1636 467 467 dup2(psiStartInfo->hStdError, fileno(stderr)); 468 468 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'"); 470 471 471 472 exit(EXIT_SUCCESS); … … 480 481 uint32_t user_hook_accept(struct emu_env *env, struct emu_env_hook *hook, ...) { 481 482 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); 486 491 487 492 logmsg(LOG_NOISY, 1, "CPU Emulation - Hooking accept() call.\n"); … … 495 500 va_end(vl); 496 501 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; 498 533 } 499 534
