Thread: [Javanetsim-cvs] IceScan icescan.cc, 1.9, 1.10 ctarget.h, 1.6, 1.7 iceservice.h, 1.3, 1.4 csubtarge
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2006-12-13 09:08:36
|
Update of /cvsroot/javanetsim/IceScan In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22688 Modified Files: icescan.cc ctarget.h iceservice.h csubtarget.h Log Message: no message Index: icescan.cc =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icescan.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** icescan.cc 13 Dec 2006 08:34:27 -0000 1.9 --- icescan.cc 13 Dec 2006 09:08:33 -0000 1.10 *************** *** 124,141 **** case 'p': ! if(i+1 < argc){ ! if(! pcrecpp::RE("(\\d|\\,|\\-)+").FullMatch(argv[i+1]) ){ std::cout << "Invalid port range definition format." << std::endl; print_help(argv[0]); exit(1); }else{ ! pcrecpp::StringPiece input(argv[i+1]); ! ! pcrecpp::RE re("(\\d+(-\\d+)*),*"); string var, var2 = ""; ! ! while (re.Consume(&input, &var, &var2)) { ! struct port_range pr; if(var2 == ""){ --- 124,150 ---- case 'p': ! if(i+1 < argc){ ! IceRegex re1("(\\d|\\,|\\-)+"); ! if(! re1.match(argv[i+1]) ){ std::cout << "Invalid port range definition format." << std::endl; print_help(argv[0]); exit(1); }else{ ! // pcrecpp::StringPiece input(argv[i+1]); ! // pcrecpp::RE re("(\\d+(-\\d+)*),*"); ! IceRegex re("(\\d+(-\\d+)*),*"); + std::vector<icestring> v; + string var, var2 = ""; ! re1.match(argv[i+1], v); ! ! DBGOUTPUT(v.size()); ! ! ! //re.Consume(&input, &var, &var2) ! for (int j=0; j<v.size(); j++) { ! DBGOUTPUT(v[j]); ! /*struct port_range pr; if(var2 == ""){ *************** *** 146,152 **** } ! par->ports.push_back(pr); } ! i++; } --- 155,161 ---- } ! par->ports.push_back(pr);*/ } ! exit(-1); i++; } *************** *** 170,176 **** }else{ //DBGOUTPUT("Target is: " << argv[i]); ! // par->target.assign(argv[i]); ! DBGOUTPUT(par->target); } --- 179,185 ---- }else{ //DBGOUTPUT("Target is: " << argv[i]); ! par->target.assign(argv[i]); ! //DBGOUTPUT(par->target); } *************** *** 233,240 **** out << "Warn: Host(s) seems down. If it is really up, but blocking ping probes, try -P0." << iceoutput::endl; } ! ! ! DBGOUTPUT("!!!!!!!!!!"); ! if(discover) ts.scan(); --- 242,246 ---- out << "Warn: Host(s) seems down. If it is really up, but blocking ping probes, try -P0." << iceoutput::endl; } ! if(discover) ts.scan(); Index: iceservice.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/iceservice.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** iceservice.h 30 Nov 2006 12:27:35 -0000 1.3 --- iceservice.h 13 Dec 2006 09:08:33 -0000 1.4 *************** *** 23,27 **** std::cout << "Can't open service names database!" << std::endl; } else { - #ifndef __CYGWIN__ //REGEXes don't work under windows? (segfault) while(!in.eof()){ char tmpbuf[256]; --- 23,26 ---- *************** *** 31,53 **** //DBGOUTPUT("!!!!"); ! pcrecpp::RE re1("^(#.*|\\s*)$"); //DBGOUTPUT("&&&&&"); ! if(! re1.FullMatch(tmpbuf) ){ ! //DBGOUTPUT("!!!!"); ! pcrecpp::RE re("^([-a-z1-9]+)\\s*\\W*([0-9]+)/(tcp|udp)"); ! ! icestring sname = "", protocol = ""; int port; ! pcrecpp::StringPiece input(tmpbuf); ! re.Consume(&input, &sname, &port, &protocol); ! ! if(sname == "") continue; ! //DBGOUTPUT("::" << sname << port << protocol); if(protocol == "tcp") tcp_services[port] = sname; --- 30,59 ---- //DBGOUTPUT("!!!!"); ! //pcrecpp::RE re1("^(#.*|\\s*)$"); ! IceRegex re1("^(#.*|\\s*)$"); //DBGOUTPUT("&&&&&"); ! if(! re1.match(tmpbuf) ){ //FullMatch ! //pcrecpp::RE re("^([-a-z1-9]+)\\s*\\W*([0-9]+)/(tcp|udp)"); ! IceRegex re("^([-a-z1-9]+)\\s*\\W*([0-9]+)/(tcp|udp)"); ! ! icestring sname = "", protocol = "", sport = ""; int port; ! //pcrecpp::StringPiece input(tmpbuf); ! //re.Consume(&input, &sname, &port, &protocol); ! ! std::vector<icestring> v; ! ! re.match(tmpbuf, v); ! if(v.size()<4) continue; + sname = v[1]; protocol = v[3]; sport = v[2]; + + port = atoi(sport.c_str()); + if(protocol == "tcp") tcp_services[port] = sname; *************** *** 56,60 **** }//else DBGOUTPUT("#comment"); } - #endif } } --- 62,65 ---- Index: csubtarget.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/csubtarget.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** csubtarget.h 13 Dec 2006 08:34:27 -0000 1.11 --- csubtarget.h 13 Dec 2006 09:08:33 -0000 1.12 *************** *** 76,88 **** csubtarget(icestring hostname, icestring reverse_hostname, iceparams *par, iceoutput *out, ice_service_name_database *isnd){ - DBGOUTPUT("!!!!"); - struct scanned_port sp; subtarget_ports.push_back(sp); ! DBGOUTPUT("!!!!"); ! ! this->hostname.assign(hostname); this->reversed_hostname.assign(reverse_hostname); this->par = par; --- 76,84 ---- csubtarget(icestring hostname, icestring reverse_hostname, iceparams *par, iceoutput *out, ice_service_name_database *isnd){ struct scanned_port sp; subtarget_ports.push_back(sp); ! this->hostname.assign(hostname); this->reversed_hostname.assign(reverse_hostname); this->par = par; *************** *** 90,97 **** this->isnd = isnd; discovered = false; ! DBGOUTPUT("!!!!"); ! init_scan_sockets(); ! ! DBGOUTPUT("!!!!"); } --- 86,90 ---- this->isnd = isnd; discovered = false; ! init_scan_sockets(); } *************** *** 499,510 **** else if(open == 0 && closed <= MAX_CLOSED) show_closed = true; ! // if(strcmp(hostname, reversed_hostname)) ! // *out << "Interesting ports on " << reversed_hostname << " (" << hostname << "):" << iceoutput::endl; ! // else ! // *out << "Interesting ports on " << hostname << ":" << iceoutput::endl; ! ! *out << "Interesting ports on " << hostname << ":" << iceoutput::endl; ! //DBGOUTPUT(filtered); bzero(output_buf, 255); if(filtered > 0){ --- 492,501 ---- else if(open == 0 && closed <= MAX_CLOSED) show_closed = true; ! if(strcmp(hostname.c_str(), reversed_hostname.c_str())) ! *out << "Interesting ports on " << reversed_hostname << " (" << hostname << "):" << iceoutput::endl; ! else ! *out << "Interesting ports on " << hostname << ":" << iceoutput::endl; + bzero(output_buf, 255); if(filtered > 0){ Index: ctarget.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/ctarget.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ctarget.h 13 Dec 2006 08:34:27 -0000 1.6 --- ctarget.h 13 Dec 2006 09:08:33 -0000 1.7 *************** *** 41,54 **** if((!is_domainname(hostname)) && par->reverse_dns){ ! get_host_byip(hostname, rev_hostname, ICEMAXHOSTNAME); }else{ rev_hostname.assign(hostname); } ! ! //DBGOUTPUT(rev_hostname); ! for(int i=0; i<st; i++){ csubtarget *cst = new csubtarget(subtargets_addresses[i].c_str(), rev_hostname.c_str(), par, out, isnd); - DBGOUTPUT(subtargets_addresses[i].c_str()); subtargets.push_back(cst); } --- 41,51 ---- if((!is_domainname(hostname)) && par->reverse_dns){ ! get_host_byip(hostname, rev_hostname); }else{ rev_hostname.assign(hostname); } ! for(int i=0; i<st; i++){ csubtarget *cst = new csubtarget(subtargets_addresses[i].c_str(), rev_hostname.c_str(), par, out, isnd); subtargets.push_back(cst); } |