Changeset 1555
- Timestamp:
- 02/17/08 13:25:24 (8 months ago)
- Files:
-
- honeytrap/trunk/configure.in (modified) (18 diffs)
- honeytrap/trunk/src/modules/Makefile.am (modified) (2 diffs)
- honeytrap/trunk/src/modules/htm_submitMWserv.c (modified) (8 diffs)
- honeytrap/trunk/src/modules/htm_submitNebula.c (added)
- honeytrap/trunk/src/modules/htm_submitNebula.h (added)
- honeytrap/trunk/src/sock.c (modified) (2 diffs)
- honeytrap/trunk/tools/htprox.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
honeytrap/trunk/configure.in
r1425 r1555 68 68 69 69 bold () { 70 text=`echo - e "$1" | sed -e "s/%B/${term_bold}/g" -e "s/%b/${term_norm}/g" 2>/dev/null`71 echo "$text"70 text=`echo -ne "$1" | sed -e "s/%B/${term_bold}/g" -e "s/%b/${term_norm}/g" 2>/dev/null` 71 echo -n "$text" 72 72 } 73 73 … … 303 303 bold " %BError%b - libpcap headers not found. Install them or use the following options:" 304 304 echo 305 bold " %B--with-libpcap-includes=%b\133location of libpcap header files\135" 305 echo 306 bold " %B--with-libpcap-includes=%b" 307 echo -e "\x5blocation of libpcap header files\x5d" 306 308 echo 307 309 exit 1 … … 317 319 bold " %BError%b - libpcap library not found. Install it or use the following options:" 318 320 echo 319 bold " %B--with-libpcap-libraries=%b\133location of libpcap shared library files\135" 321 echo 322 bold " %B--with-libpcap-libraries=%b" 323 echo -e "\5blocation of libpcap shared library files\x5d" 320 324 echo 321 325 exit 1 … … 343 347 bold " %BError%b - libnetfilter_queue headers not found. Install them or use the following options:" 344 348 echo 345 bold " %B--with-libnfq-includes=%b\133location of libnetfilter_queue header files\135" 349 echo 350 bold " %B--with-libnfq-includes=%b" 351 echo -e "\x5blocation of libnetfilter_queue header files\x5d" 346 352 echo 347 353 exit … … 357 363 bold " %BError%b - libnetfilter_queue library not found. Install it or use the following options:" 358 364 echo 359 bold " %B--with-libnfq-libraries=%b\133location of libnetfilter_queue shared library files\135" 365 echo 366 bold " %B--with-libnfq-libraries=%b" 367 echo -e "\x5blocation of libnetfilter_queue shared library files\x5d" 360 368 echo 361 369 exit … … 382 390 bold " %BError%b - libipq headers not found. Install them or use the following options:" 383 391 echo 384 bold " %B--with-libipq-includes=%b\133location of libipq header files\135" 392 echo 393 bold " %B--with-libipq-includes=%b" 394 echo -e "\x5blocation of libipq header files\x5d" 385 395 echo 386 396 exit … … 396 406 bold " %BError%b - libipq library not found. Install it or use the following options:" 397 407 echo 398 bold " %B--with-libipq-libraries=%b\133location of libipq shared library files\135" 408 echo 409 bold " %B--with-libipq-libraries=%b" 410 echo -e "\x5blocation of libipq shared library files\x5d" 399 411 echo 400 412 exit … … 413 425 bold " %BError%b - No connection monitor selected. Please reconfigure with one of the following:" 414 426 echo 427 echo 415 428 bold " %B--with-stream-mon=%bnfq receive packets via netfilter's NFQUEUE target (Linux only, recommended)" 429 echo 416 430 bold " %B--with-stream-mon=%bipq receive packets via netfilter's QUEUE target (Linux only)" 431 echo 417 432 bold " %B--with-stream-mon=%bpcap receive packets using a built-in pcap sniffer" 433 echo 418 434 echo 419 435 exit 1 … … 458 474 bold " %BError%b - libclamav headers not found. Install them or use the following options:" 459 475 echo 460 bold " %B--with-libclamav-includes=%b\133location of libclamav header filesi\135" 476 echo 477 bold " %B--with-libclamav-includes=%b" 478 echo -e "\x5blocation of libclamav header files\x5d" 461 479 echo 462 480 exit … … 472 490 bold " %BError%b - libclamav library not found. Install it or use the following options:" 473 491 echo 474 bold " %B--with-libclamav-libraries=%b\133location of libclamav shared library files\135" 492 echo 493 bold " %B--with-libclamav-libraries=%b" 494 echo -e "\x5blocation of libclamav shared library files\x5d" 475 495 echo 476 496 exit … … 490 510 bold " Use %B--enable-devmodules%b to build it anyway." 491 511 echo 512 echo 492 513 exit 493 514 fi … … 511 532 bold " %BError%b - libemu headers not found. Install them or use the following options:" 512 533 echo 513 bold " %B--with-libemu-includes=%b\133location of libemu header files\135" 534 echo 535 bold " %B--with-libemu-includes=%b" 536 echo -e "\x5blocation of libemu header files\x5d" 514 537 echo 515 538 exit … … 525 548 bold " %BError%b - libemu library not found. Install it or use the following options:" 526 549 echo 527 bold " %B--with-libemu-libraries=%b\133location of libemu shared library files\135" 550 echo 551 bold " %B--with-libemu-libraries=%b" 552 echo -e "\x5blocation of libemu shared library files\x5d" 528 553 echo 529 554 exit … … 545 570 bold " Use %B--enable-devmodules%b to build it anyway." 546 571 echo 572 echo 547 573 exit 548 574 fi … … 570 596 bold " %BError%b - libcurl headers not found. Install them or use the following options:" 571 597 echo 572 bold " %B--with-libcurl-includes=%b\133location of libcurl header files\135" 598 echo 599 bold " %B--with-libcurl-includes=%b" 600 echo -e "\x5blocation of libcurl header files\x5d" 573 601 echo 574 602 exit … … 584 612 bold " %BError%b - libcurl library not found. Install it or use the following options:" 585 613 echo 586 bold " %B--with-libcurl-libraries=%b\133location of libcurl shared library files\135" 614 echo 615 bold " %B--with-libcurl-libraries=%b" 616 echo -e "\x5blocation of libcurl shared library files\x5d" 587 617 echo 588 618 exit … … 590 620 else 591 621 with_submit_mwserv=" " 622 fi 623 624 625 626 AC_ARG_WITH(submit-nebula, 627 [ --with-submit-nebula submit attacks to a nebula server]) 628 AM_CONDITIONAL(BUILD_SUBMIT_NEBULA_PLUGIN, test x$with_submit_nebula = xyes) 629 if test "$with_submit_nebula" = "yes"; then 630 if test "$enable_devmodules" != "X"; then 631 echo 632 echo " The submitNebula plugin is still unstable and should not be used in production setups." 633 bold " Use %B--enable-devmodules%b to build it anyway." 634 echo 635 echo 636 exit 637 fi 638 639 with_submit_nebula="X" 640 641 AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname)) 642 643 AC_ARG_WITH(zlib_includes, 644 [ --with-zlib-includes=DIR zlib include directory], 645 [with_zlib_includes="$withval"],[with_zlib_includes=no]) 646 647 AC_ARG_WITH(zlib_libraries, 648 [ --with-zlib-libraries=DIR zlib library directory], 649 [with_zlib_libraries="$withval"],[with_zlib_libraries=no]) 650 651 if test "$with_zlib_includes" != "no"; then 652 CFLAGS="${CFLAGS} -I${with_zlib_includes}" 653 fi 654 HZ="yes" 655 AC_CHECK_HEADER(zlib.h,, HZ="no") 656 if test "$HZ" = "no"; then 657 echo 658 bold " %BError%b - zlib headers not found. Install them or use the following options:" 659 echo 660 echo 661 bold " %B--with-zlib-includes=%b" 662 echo -e "\x5blocation of zlib header files\x5d" 663 echo 664 exit 665 fi 666 667 if test "$with_zlib_libraries" != "no"; then 668 LDFLAGS="${LDFLAGS} -L${with_zlib_libraries}" 669 fi 670 LZ="yes" 671 AC_CHECK_LIB(z, compress, LZ="yes", LZ="no") 672 if test "$LZ" = "no"; then 673 echo 674 bold " %BError%b - zlib library not found. Install it or use the following options:" 675 echo 676 echo 677 bold " %B--with-zlib-libraries=%b" 678 echo -e "\x5blocation of zlib shared library files\x5d" 679 echo 680 exit 681 fi 682 else 683 with_submit_nebula=" " 592 684 fi 593 685 … … 782 874 bold " ----- %Bhoneytrap configuration%b -----" 783 875 echo 876 echo 784 877 echo " General options" 785 878 bold " (%B$enable_debug%b) Debugging" 879 echo 786 880 bold " (%B$enable_profile%b) Profiling" 881 echo 787 882 bold " (%B$enable_devmodules%b) Unstable Modules" 883 echo 788 884 bold " (%B$with_efence%b) Electric Fence" 885 echo 789 886 echo 790 887 echo " Connection monitor" 791 888 bold " (%B$with_ipq_mon%b) Linux ip_queue (ipq)" 889 echo 792 890 bold " (%B$with_ipfw_mon%b) FreeBSD ipfw (ipfw)" 891 echo 793 892 bold " (%B$with_nfq_mon%b) Linux libnetfilter_queue (nfq)" 893 echo 794 894 bold " (%B$with_pcap_mon%b) Libpcap (pcap)" 895 echo 795 896 echo 796 897 echo " Optional plugins" 797 898 bold " (%B$with_clamav%b) ClamAV" 899 echo 798 900 bold " (%B$with_cpuemu%b) cpuEmu" 901 echo 799 902 bold " (%B$with_cspm%b) CSPM" 903 echo 800 904 bold " (%B$with_postgres%b) PostgeSQL" 905 echo 801 906 bold " (%B$with_spamsum%b) SpamSum" 907 echo 802 908 bold " (%B$with_submit_mwserv%b) submitMwserv" 909 echo 910 bold " (%B$with_submit_nebula%b) submitNebula" 911 echo honeytrap/trunk/src/modules/Makefile.am
r1489 r1555 35 35 if BUILD_SUBMIT_MWSERV_PLUGIN 36 36 lib_LTLIBRARIES += htm_submitMWserv.la 37 endif 38 39 if BUILD_SUBMIT_NEBULA_PLUGIN 40 lib_LTLIBRARIES += htm_submitNebula.la 37 41 endif 38 42 … … 80 84 endif 81 85 86 if BUILD_SUBMIT_NEBULA_PLUGIN 87 htm_submitNebula_la = htm_submitNebula.c htm_submitNebula.h 88 htm_submitNebula_la_LDFLAGS = -module -no-undefined -avoid-version -lz 89 endif 90 82 91 83 92 if BUILD_CSPM_PLUGIN honeytrap/trunk/src/modules/htm_submitMWserv.c
r1506 r1555 175 175 176 176 int check_response(const bstr *response) { 177 printf("--> response is '%s'\n", response->data); 177 178 switch(response_code(response)) { 178 179 case TSS_OK: … … 186 187 return(TSS_ERROR); 187 188 case TSS_UNKNOWN: 189 default: 188 190 logmsg(LOG_ERR, 1, "SubmitMWServ - Server returned status UNKNOWN.\n"); 189 191 return(TSS_UNKNOWN); 190 default:191 return(0);192 192 } 193 193 … … 205 205 FD_ZERO(&wfds); 206 206 FD_ZERO(&efds); 207 printf("--> selecting...\n"); 207 208 208 209 max_fd = 0; … … 232 233 break; 233 234 default: 234 if (FD_ISSET(sigpipe[0], &rfds) && (check_sigpipe() == -1)) exit(EXIT_FAILURE); 235 printf("--> got data.\n"); 236 if (FD_ISSET(sigpipe[0], &rfds) && (check_sigpipe() == -1)) { 237 fprintf(stderr, "SubmitMWServ Error - Select failed.\n"); 238 exit(EXIT_FAILURE); 239 } 235 240 236 241 handles = 0; … … 238 243 while(curl_multi_perform(mhandle, &handles) == CURLM_CALL_MULTI_PERFORM && handles); 239 244 240 if ((resp = check_response(response)) == -1) return(-1); 241 else if (resp == 1) return(1); 245 printf("--> checking response.\n"); 246 switch (resp = check_response(response)) { 247 printf("response is %u\n", resp); 248 case TSS_UNKNOWN: 249 break; 250 case TSS_OK: 251 return(1); 252 default: 253 return(-1); 254 } 242 255 } 243 256 } … … 265 278 logmsg(LOG_NOISY, 1, "SubmitMWServ - Constructing HTTP form for request type %d.\n", type); 266 279 280 printf("--> adding guid\n"); 267 281 curl_formadd(&pinfo, &pinfo_last, CURLFORM_PTRNAME, "guid", CURLFORM_PTRCONTENTS, guid, CURLFORM_END); 282 printf("--> adding maintainer\n"); 268 283 curl_formadd(&pinfo, &pinfo_last, CURLFORM_PTRNAME, "maintainer", CURLFORM_PTRCONTENTS, maintainer, CURLFORM_END); 284 printf("--> adding secret\n"); 269 285 curl_formadd(&pinfo, &pinfo_last, CURLFORM_PTRNAME, "secret", CURLFORM_PTRCONTENTS, secret, CURLFORM_END); 270 286 287 if (uri) { 288 printf("--> adding uri\n"); 271 289 curl_formadd(&pinfo, &pinfo_last, CURLFORM_PTRNAME, "uri", 272 290 CURLFORM_PTRCONTENTS, uri, CURLFORM_CONTENTSLENGTH, strlen(uri), CURLFORM_END); 291 } 273 292 293 printf("--> adding data\n"); 274 294 curl_formadd(&pinfo, &pinfo_last, CURLFORM_PTRNAME, "data", 275 295 CURLFORM_PTRCONTENTS, data, … … 326 346 memset(&response, 0, sizeof(bstr)); 327 347 348 printf("--> uri is %s\n", uri); 328 349 if ((pinfo = init_handle(&multihandle, &curlhandle, 329 350 attack->download[i].dl_payload.data, attack->download[i].dl_payload.size, … … 332 353 return(0); 333 354 } 355 printf("--> handle initialized\n"); 334 356 335 357 if (transfer_data(multihandle, &response) == TSS_OK) 336 358 logmsg(LOG_NOTICE, 1, "SubmitMWServ - Sample is already present at %s, skipping submission.\n", mwserv_url); 337 elseif (338 359 else 339 360 logmsg(LOG_ERR, 1, "SubmitMWServ Error - Hash test failed.\n"); honeytrap/trunk/src/sock.c
r1489 r1555 62 62 if ((bind(fd, (struct sockaddr *) server_addr, sizeof(struct sockaddr_in))) != 0) { 63 63 /* we already got one server process */ 64 logmsg(LOG_DEBUG, 1, "Unable to bind to port %u/tcp: %m.\n", port);64 logmsg(LOG_DEBUG, 1, "Unable to bind to port %u/tcp: %m.\n", ntohs(port)); 65 65 #ifdef USE_IPQ_MON 66 66 /* hand packet processing back to the kernel */ … … 91 91 /* if bind() did not fail for 'port already in use' but for some other reason, 92 92 * we're in troubles and want a verbose error message */ 93 if (errno != 98) logmsg(LOG_NOISY, 1, "Warning - Could not bind to port %u/tcp: %m.\n", port);93 if (errno != 98) logmsg(LOG_NOISY, 1, "Warning - Could not bind to port %u/tcp: %m.\n", ntohs(port)); 94 94 exit(EXIT_FAILURE); 95 95 #endif honeytrap/trunk/tools/htprox.c
r1118 r1555 18 18 */ 19 19 20 #include <arpa/inet.h> 21 #include <errno.h> 22 #include <netdb.h> 23 #include <signal.h> 20 24 #include <stdio.h> 21 25 #include <stdlib.h> 22 26 #include <string.h> 23 27 #include <strings.h> 24 #include <netdb.h>25 #include <signal.h>26 28 #include <sys/socket.h> 27 #include <arpa/inet.h>28 29 #include <unistd.h> 29 30 extern int h_errno;31 extern int errno;32 30 33 31
