[Javanetsim-cvs] IceScan Makefile, 1.2, 1.3 csubtarget.h, 1.35, 1.36 icediscover.h, 1.23, 1.24 iceo
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2006-12-16 20:44:22
|
Update of /cvsroot/javanetsim/IceScan In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12835 Modified Files: Makefile csubtarget.h icediscover.h iceoutput.h icescan.cc nbt_wrapper.h udpscan.h Log Message: Index: icescan.cc =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icescan.cc,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** icescan.cc 16 Dec 2006 20:25:13 -0000 1.31 --- icescan.cc 16 Dec 2006 20:44:18 -0000 1.32 *************** *** 315,319 **** time_t rawtime; ! WSA_DATA wsa; wsa = start_sockets(); --- 315,319 ---- time_t rawtime; ! WSADATA wsa; wsa = start_sockets(); Index: csubtarget.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/csubtarget.h,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** csubtarget.h 16 Dec 2006 17:18:28 -0000 1.35 --- csubtarget.h 16 Dec 2006 20:44:18 -0000 1.36 *************** *** 10,14 **** #include "iceoutput.h" #include "iceparams.h" ! #include "nbt_wrapper.h" #include "iceprotocol.h" #include "icesockets/sock_pcap.h" --- 10,18 ---- #include "iceoutput.h" #include "iceparams.h" ! ! #ifndef WIN32 ! #include "nbt_wrapper.h" ! #endif ! #include "iceprotocol.h" #include "icesockets/sock_pcap.h" *************** *** 130,158 **** // cps.test(hostname.c_str()); } int nbt_scan(){ // NetBIOS scan, -SB ! char output_buf[255]; ! if(par->verbose>0){ sprintf(output_buf, "Starting NetBIOS scan against %s...", hostname.c_str()); out->line(output_buf); } cnbtwrapper wrap(par); ! wrap.test(hostname.c_str(), 137); ! if(par->verbose>0){ ! bzero(output_buf, 255); sprintf(output_buf, "NetBIOS scan finished.", hostname.c_str()); out->line(output_buf); } ! } ! int udp_scan(){ ! // connect scan, -SU char output_buf[255]; --- 134,166 ---- // cps.test(hostname.c_str()); + return 0; } int nbt_scan(){ // NetBIOS scan, -SB ! char output_buf[255]; ! if(par->verbose>0){ sprintf(output_buf, "Starting NetBIOS scan against %s...", hostname.c_str()); out->line(output_buf); } + #ifndef WIN32 cnbtwrapper wrap(par); ! wrap.test(hostname.c_str(), 137); ! #endif ! if(par->verbose>0){ ! Bzero(output_buf, 255); sprintf(output_buf, "NetBIOS scan finished.", hostname.c_str()); out->line(output_buf); } ! return 0; ! } ! int udp_scan(){ ! //udp scan, -SU char output_buf[255]; *************** *** 177,180 **** --- 185,190 ---- scanning_ports.clear(); + + return 0; } *************** *** 209,212 **** --- 219,224 ---- scanning_ports.clear(); + + return 0; } *************** *** 332,336 **** } ! int get_max_fd(){ int max = -1; --- 344,348 ---- } ! int get_max_fd(){ int max = -1; *************** *** 798,802 **** ! bzero(output_buf, 255); if(filtered > 0){ if(show_closed){ --- 810,814 ---- ! Bzero(output_buf, 255); if(filtered > 0){ if(show_closed){ *************** *** 816,820 **** for(int j = 0; j < subtarget_ports.size(); j++){ ! bzero(output_buf, 255); if(subtarget_ports[j].status == PORT_OPEN){ sprintf(output_buf, "%5d/tcp open %s", subtarget_ports[j].port_number, par->isnd->get_tcp_service(subtarget_ports[j].port_number).c_str()); --- 828,832 ---- for(int j = 0; j < subtarget_ports.size(); j++){ ! Bzero(output_buf, 255); if(subtarget_ports[j].status == PORT_OPEN){ sprintf(output_buf, "%5d/tcp open %s", subtarget_ports[j].port_number, par->isnd->get_tcp_service(subtarget_ports[j].port_number).c_str()); Index: nbt_wrapper.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/nbt_wrapper.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** nbt_wrapper.h 16 Dec 2006 17:29:16 -0000 1.5 --- nbt_wrapper.h 16 Dec 2006 20:44:18 -0000 1.6 *************** *** 3,7 **** #include <sys/types.h> ! #include <sys/time.h> #define NBT_MSGSIZE 1024 --- 3,10 ---- #include <sys/types.h> ! ! #ifndef WIN32 ! #include <sys/time.h> ! #endif #define NBT_MSGSIZE 1024 Index: icediscover.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icediscover.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** icediscover.h 16 Dec 2006 17:18:28 -0000 1.23 --- icediscover.h 16 Dec 2006 20:44:18 -0000 1.24 *************** *** 2,8 **** #define ICEDISCOVER_H ! #include <signal.h> ! #include <sys/time.h> ! #include <stdlib.h> #include "icesockets/ice_rand.h" #include "icesockets/csocket.h" --- 2,6 ---- #define ICEDISCOVER_H ! #include "icesockets/ice_rand.h" #include "icesockets/csocket.h" *************** *** 43,51 **** #endif ! //we're root, so can work with raw sockets ! icestring hostname_(hostname); ! ! char *t_hostname = (char *) malloc(strlen(hostname) + 1); ! strcpy(t_hostname, hostname); if(par->verbose>0) --- 41,49 ---- #endif ! //we're root, so can work with raw sockets ! icestring hostname_(hostname); ! ! char *t_hostname = (char *) malloc(strlen(hostname) + 1); ! strcpy(t_hostname, hostname); if(par->verbose>0) *************** *** 60,66 **** r.setsockopt(SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)); ! r.nonblock(true); ! ! int at = 1; while(attempts++ < 100){ --- 58,64 ---- r.setsockopt(SOL_SOCKET, SO_RCVBUF, &size, sizeof(size)); ! r.nonblock(true); ! ! int at = 1; while(attempts++ < 100){ *************** *** 69,73 **** char buf[sizeof(struct timeval) + 1]; ! bzero(buf, sizeof(struct timeval) + 1); if(icmp_type == ECHO){ --- 67,71 ---- char buf[sizeof(struct timeval) + 1]; ! Bzero(buf, sizeof(struct timeval) + 1); if(icmp_type == ECHO){ Index: Makefile =================================================================== RCS file: /cvsroot/javanetsim/IceScan/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 30 Nov 2006 15:25:48 -0000 1.2 --- Makefile 16 Dec 2006 20:44:18 -0000 1.3 *************** *** 1,4 **** ! CXXFLAGS=-g -lpthread -lpcrecpp -lpcre ! LDFLAGS=-g -lpthread -lpcrecpp -lpcre all: icescan --- 1,4 ---- ! CXXFLAGS= ! LDFLAGS=-g -lpthread -lpcre -lpcrecpp -lpcap all: icescan Index: udpscan.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/udpscan.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** udpscan.h 16 Dec 2006 20:25:13 -0000 1.11 --- udpscan.h 16 Dec 2006 20:44:18 -0000 1.12 *************** *** 58,62 **** --- 58,64 ---- if(par->forceuid){ #endif + #define UDP_SCAN_ZSIZE 0 + #define UDP_SCAN_RECVSIZE 150 #define UDP_SCAN_REPEATS 5 *************** *** 64,68 **** --- 66,74 ---- csocket sudp(PF_INET, SOCK_DGRAM); crawsocket sicmp(AF_INET, SOCK_RAW, IPPROTO_ICMP); + #ifdef WIN32 + char *zmsg; + #else char zmsg[UDP_SCAN_ZSIZE]; + #endif char recvmsg[UDP_SCAN_RECVSIZE]; memset(zmsg, 0, UDP_SCAN_ZSIZE); Index: iceoutput.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/iceoutput.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** iceoutput.h 30 Nov 2006 12:27:35 -0000 1.3 --- iceoutput.h 16 Dec 2006 20:44:18 -0000 1.4 *************** *** 6,10 **** #include <iostream> #include <vector> - #include <pthread.h> class iceoutput{ --- 6,9 ---- *************** *** 17,25 **** static const char endl[]; ! iceoutput(){ ! text_output = true; ! xml_output = false; ! binary_output = false; } --- 16,23 ---- static const char endl[]; ! iceoutput(){ text_output = true; ! xml_output = false; ! binary_output = false; } *************** *** 42,61 **** --- 40,69 ---- iceoutput &operator<<(const int &i){ std::cout << i; + + return *this; } iceoutput &operator<<(const char *buf){ std::cout << buf; + + return *this; } iceoutput &operator<<(const icestring &str){ std::cout << str; + + return *this; } iceoutput &operator<<(const double &d){ std::cout << d; + + return *this; } }; + #ifndef WIN32 + void block_output(pthread_mutex_t *output_mutex, char *str, iceoutput *out){ pthread_mutex_lock(output_mutex); *************** *** 65,66 **** --- 73,76 ---- #endif + + #endif |