[Javanetsim-cvs] IceScan icedbs.h, NONE, 1.1 icescan.cc, 1.18, 1.19 ctarget.h, 1.8, 1.9 csubtarget.
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2006-12-14 19:23:35
|
Update of /cvsroot/javanetsim/IceScan In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1118 Modified Files: icescan.cc ctarget.h csubtarget.h Added Files: icedbs.h Removed Files: iceservice.h Log Message: no message --- NEW FILE: icedbs.h --- #ifndef ICEDBS_H #define ICEDBS_H #include <iostream> #include <fstream> #include <map> #include <string> #include "icedebug.h" class ice_service_name_database{ std::map <int, icestring> tcp_services; std::map <int, icestring> udp_services; public: ice_service_name_database(char *db_fname){ std::ifstream in; in.open(db_fname); if(!in){ std::cout << "Can't open service names database!" << std::endl; } else { while(!in.eof()){ char tmpbuf[256]; in.getline(tmpbuf,256); //DBGOUTPUT("!!!!"); IceRegex re1("^(#.*|\\s*)$"); //DBGOUTPUT("&&&&&"); if(! re1.match(tmpbuf) ){ //FullMatch IceRegex re("^([-a-z1-9]+)\\s*\\W*([0-9]+)/(tcp|udp)"); icestring sname = "", protocol = "", sport = ""; int port; 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; else udp_services[port] = sname; }//else DBGOUTPUT("#comment"); } } } icestring get_tcp_service(int port){ if(tcp_services.find(port) != tcp_services.end()) return udp_services[port]; else return "unknown"; } icestring get_udp_service(int port){ } }; #endif Index: icescan.cc =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icescan.cc,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** icescan.cc 14 Dec 2006 16:40:25 -0000 1.18 --- icescan.cc 14 Dec 2006 19:23:32 -0000 1.19 *************** *** 4,8 **** #include "iceversion.h" #include "iceoutput.h" ! #include "iceservice.h" #include "ctarget.h" --- 4,8 ---- #include "iceversion.h" #include "iceoutput.h" ! #include "icedbs.h" #include "ctarget.h" *************** *** 26,29 **** --- 26,30 ---- "\t-SA: ACK scan\n" "\t-SS: SYN scan\n" + "\t-S0: skip scan\n" "PORTS SPECIFICATION:\n" "\t-p <port range>: specify port range to scan (default 1-1024).\n" *************** *** 101,104 **** --- 102,109 ---- break; + case '0': + par->scan_type = NO_SCAN; + break; + case 'X': par->scan_type = XMAS_SCAN; --- iceservice.h DELETED --- Index: csubtarget.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/csubtarget.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** csubtarget.h 14 Dec 2006 14:15:08 -0000 1.19 --- csubtarget.h 14 Dec 2006 19:23:32 -0000 1.20 *************** *** 114,117 **** --- 114,127 ---- } + void mac_discover(){ + #ifndef __CYGWIN__ + icestring mac = get_arp_from_cache(hostname); + + if(mac != ""){ + *out << "MAC Address: " << mac << "\n"; + } + #endif + } + int prot_scan(){ Index: ctarget.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/ctarget.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ctarget.h 14 Dec 2006 13:42:07 -0000 1.8 --- ctarget.h 14 Dec 2006 19:23:32 -0000 1.9 *************** *** 73,76 **** --- 73,77 ---- if(subtargets[i]->discovered){ subtargets[i]->scan(); + subtargets[i]->mac_discover(); } } |