[Javanetsim-cvs] IceScan iceparams.h, 1.9, 1.10 icescan.cc, 1.21, 1.22 ctarget.h, 1.10, 1.11 TODO,
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2006-12-15 17:46:25
|
Update of /cvsroot/javanetsim/IceScan In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv31353 Modified Files: iceparams.h icescan.cc ctarget.h TODO icediscover.h csubtarget.h Log Message: no message Index: icescan.cc =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icescan.cc,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** icescan.cc 15 Dec 2006 17:15:12 -0000 1.21 --- icescan.cc 15 Dec 2006 17:46:18 -0000 1.22 *************** *** 15,18 **** --- 15,19 ---- "\t-P0: skip host discovery\n" "\t-PA: ACK Ping host discovery\n" + "\t-PM: ARP host discovery\n" "\t-PE: ICMP Echo (aka standart ping) host discovery\n" "\t-r: no reverse-dns lookups\n" *************** *** 28,31 **** --- 29,33 ---- "\t You can use: 1-10; 1; 1-10,12-14; etc.\n" "MISC:\n" + "\t--uid0: assume that the current user is fully privileged.\n" "\t-V: print version and exit\n" "\t-?: this message\n\n", name); *************** *** 74,77 **** --- 76,85 ---- exit(1); } + }else if(!strcmp(argv[i], "--uid0")){ + par->forceuid = true; + }else{ + std::cout << "Invalid option: -" << argv[i][1] << std::endl; + print_help(argv[0]); + exit(1); } *************** *** 177,180 **** --- 185,192 ---- par->icmp_echo_ping_discovery = true; break; + + case 'M': + par->arp_discovery = true; + break; default: Index: csubtarget.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/csubtarget.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** csubtarget.h 15 Dec 2006 17:15:12 -0000 1.24 --- csubtarget.h 15 Dec 2006 17:46:18 -0000 1.25 *************** *** 169,178 **** *out << "Starting TCP " << scan_type << " scan against " << hostname.c_str() << "...\n"; ! #ifndef __CYGWIN__ ! if(getuid()){ out->line("UID isn't 0, so can't create raw socket => no RAW tcp scan..."); return; } ! #endif raw = true; --- 169,181 ---- *out << "Starting TCP " << scan_type << " scan against " << hostname.c_str() << "...\n"; ! #ifdef __CYGWIN__ ! if(par->forceuid){ ! #else ! if(getuid() || par->forceuid){ ! #endif out->line("UID isn't 0, so can't create raw socket => no RAW tcp scan..."); return; } ! raw = true; Index: icediscover.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icediscover.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** icediscover.h 15 Dec 2006 16:35:29 -0000 1.13 --- icediscover.h 15 Dec 2006 17:46:18 -0000 1.14 *************** *** 10,13 **** --- 10,14 ---- #define ACK_PING_STANDART_PORT 80 + #define ARP_PING_STANDART_PORT 138 #define ECHO_ATTEMPTS 5 *************** *** 26,31 **** if(par->verbose>0) *out << "Ack host discovery successfull!" << iceoutput::endl; return true; ! }else if(par->verbose>0) *out << "Ack host discovery failed!" << iceoutput::endl; ! return false; } --- 27,32 ---- if(par->verbose>0) *out << "Ack host discovery successfull!" << iceoutput::endl; return true; ! } ! return false; } *************** *** 35,41 **** #ifndef __CYGWIN__ ! if(!getuid()){ #else ! if(1){ #endif //we're root, so can work with raw sockets --- 36,42 ---- #ifndef __CYGWIN__ ! if(!getuid() || par->forceuid){ #else ! if(par->forceuid){ #endif //we're root, so can work with raw sockets *************** *** 90,94 **** if(icmp -> icmp_type == ICMP_ECHOREPLY && icmp->icmp_id == getpid() && icmplen > 16){ if(par->verbose>0) ! out->line("Recieved icmp ping host discovery reply (echo_reply)..."); free(t_hostname); r.shutdown(); --- 91,95 ---- if(icmp -> icmp_type == ICMP_ECHOREPLY && icmp->icmp_id == getpid() && icmplen > 16){ if(par->verbose>0) ! out->line("Recieved icmp ping host discovery reply (echo_reply)."); free(t_hostname); r.shutdown(); *************** *** 107,115 **** }else out->line("UID isn't 0, so can't create raw socket => no ICMP ping..."); ! return false; } ! bool host_discover(const char *hostname, iceparams *par, iceoutput *out){ --- 108,136 ---- }else out->line("UID isn't 0, so can't create raw socket => no ICMP ping..."); ! ! return false; } ! bool arp_discovery(const char *hostname, iceparams *par, iceoutput *out){ ! ! icestring ip(hostname); ! ! csocket c(AF_INET, SOCK_DGRAM); ! ! if(par->verbose>0) ! out->line("Sending upd packet for unprivileged arp host discovery..."); ! ! c.sendto(hostname, ARP_PING_STANDART_PORT, " ", 1, 0); ! ! icestring mac = get_arp_from_cache(ip); ! ! if(mac != ""){ ! if(par->verbose>0) ! *out << "Recieved ARP host discovery reply: " << hostname << "'s MAC is " << mac << ".\n"; ! return true; ! }else ! return false; ! } bool host_discover(const char *hostname, iceparams *par, iceoutput *out){ *************** *** 121,125 **** if(par->icmp_echo_ping_discovery) if( icmp_echo_ping(hostname, par, out) ) return true; ! return false; } --- 142,150 ---- if(par->icmp_echo_ping_discovery) if( icmp_echo_ping(hostname, par, out) ) return true; ! ! if(par->arp_discovery) if( arp_discovery(hostname, par, out) ) return true; ! ! if(par->verbose>0) *out << "Ack host discovery failed!" << iceoutput::endl; ! return false; } Index: iceparams.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/iceparams.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** iceparams.h 15 Dec 2006 17:15:12 -0000 1.9 --- iceparams.h 15 Dec 2006 17:46:18 -0000 1.10 *************** *** 24,28 **** int verbose; //-v -vv -vvv - Verbose params ! int UID; // we're root or not? // Target --- 24,28 ---- int verbose; //-v -vv -vvv - Verbose params ! bool forceuid; // Target *************** *** 44,47 **** --- 44,50 ---- std::vector <int> ps_ports; + bool arp_discovery; // -PM, ARP Ping + std::vector <int> pm_ports; + bool icmp_echo_ping_discovery; // -PE, ICMP Echo (standart) Ping bool icmp_mask_ping_discovery; // -PM, ICMP GetNetMask Ping *************** *** 88,91 **** --- 91,95 ---- icmp_timestamp_ping_discovery = false; udp_ping_discovery = false; + arp_discovery = false; scan_type = TCP_CONNECT_SCAN; *************** *** 95,98 **** --- 99,103 ---- tcpflags = 0; + forceuid = false; } *************** *** 109,113 **** void by_default_init(){ if( ! (no_host_discovery || ack_ping_discovery || syn_ping_discovery || icmp_echo_ping_discovery || ! icmp_mask_ping_discovery || icmp_timestamp_ping_discovery || udp_ping_discovery) ){ ack_ping_discovery = true; icmp_echo_ping_discovery = true; --- 114,118 ---- void by_default_init(){ if( ! (no_host_discovery || ack_ping_discovery || syn_ping_discovery || icmp_echo_ping_discovery || ! icmp_mask_ping_discovery || icmp_timestamp_ping_discovery || udp_ping_discovery || arp_discovery) ){ ack_ping_discovery = true; icmp_echo_ping_discovery = true; Index: ctarget.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/ctarget.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ctarget.h 14 Dec 2006 19:45:40 -0000 1.10 --- ctarget.h 15 Dec 2006 17:46:18 -0000 1.11 *************** *** 30,33 **** --- 30,35 ---- if(subtargets[i]->discovered) up++; } + + return up; } Index: TODO =================================================================== RCS file: /cvsroot/javanetsim/IceScan/TODO,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** TODO 15 Dec 2006 17:15:12 -0000 1.11 --- TODO 15 Dec 2006 17:46:18 -0000 1.12 *************** *** 7,11 **** + add multiple targets handling; * fix reading port range for ack/udp/syn pings; - + add uid option -- Discovering -- --- 7,10 ---- *************** *** 14,19 **** + TCP SYN Scan (-PS [portlist]) [Key] + ICMP Address Mask Ping (-PM) [QweR] ! + ARP/UDP Discovery ! + ARP Discovery -- Scanning -- --- 13,17 ---- + TCP SYN Scan (-PS [portlist]) [Key] + ICMP Address Mask Ping (-PM) [QweR] ! + ARP/RAW Discovery -- Scanning -- |