[Javanetsim-cvs] IceScan iceparams.h, 1.15, 1.16 icescan.cc, 1.34, 1.35 csubtarget.h, 1.42, 1.43
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2006-12-17 15:06:40
|
Update of /cvsroot/javanetsim/IceScan In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2552 Modified Files: iceparams.h icescan.cc csubtarget.h Log Message: no message Index: icescan.cc =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icescan.cc,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** icescan.cc 17 Dec 2006 11:00:20 -0000 1.34 --- icescan.cc 17 Dec 2006 15:06:36 -0000 1.35 *************** *** 36,39 **** --- 36,40 ---- "\t--list-interfaces: list all interfaces\n" "\t-i <iface-number>: use interface <iface-number> for pcap/source interface.\n" + "\t--send-eth: use channel(2) level to send raw packets.\n" "MISC:\n" "\t--uid0: assume that the current user is fully privileged.\n" *************** *** 130,137 **** }else if(!strcmp(argv[i], "--uid0")){ par->forceuid = true; ! }else if(!strcmp(argv[i], "--list-interfaces")){ listdev_pcap(); ! std::cout << std::endl; ! exit(0); }else{ std::cout << "Invalid option: -" << argv[i][1] << std::endl; --- 131,140 ---- }else if(!strcmp(argv[i], "--uid0")){ par->forceuid = true; ! }else if(!strcmp(argv[i], "--list-interfaces")){ listdev_pcap(); ! std::cout << std::endl; ! exit(0); ! }else if(!strcmp(argv[i], "--send-eth")){ ! par->ethernet = true; }else{ std::cout << "Invalid option: -" << argv[i][1] << std::endl; Index: iceparams.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/iceparams.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** iceparams.h 17 Dec 2006 09:59:39 -0000 1.15 --- iceparams.h 17 Dec 2006 15:06:36 -0000 1.16 *************** *** 26,30 **** bool forceuid; ! int source_iface; // Target --- 26,32 ---- bool forceuid; ! int source_iface; ! ! bool ethernet; // Target *************** *** 84,87 **** --- 86,90 ---- reverse_dns = true; + ethernet = false; no_host_discovery = false; *************** *** 120,123 **** --- 123,130 ---- icmp_echo_ping_discovery = true; } + + #ifdef WIN32 + ethernet = true; + #endif init_default_ports(); Index: csubtarget.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/csubtarget.h,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** csubtarget.h 17 Dec 2006 14:23:15 -0000 1.42 --- csubtarget.h 17 Dec 2006 15:06:36 -0000 1.43 *************** *** 370,374 **** if(!par->forceuid){ #else ! if(!getuid() || !par->forceuid){ #endif out->line("UID isn't 0, so can't create raw socket/load pcap => no RAW tcp scan..."); --- 370,374 ---- if(!par->forceuid){ #else ! if(getuid() && (par->forceuid != true)){ #endif out->line("UID isn't 0, so can't create raw socket/load pcap => no RAW tcp scan..."); *************** *** 399,405 **** int one = 1; ! const BOOL val = TRUE; if (setsockopt (rawsend.get_socketid(), IPPROTO_IP, IP_HDRINCL, (char *) &val, sizeof (one)) != 0) ! perror("Setsockopt HDRINCL:"); int l = scanning_ports.size()/MAX_PACKETS; --- 399,412 ---- int one = 1; ! ! #ifdef WIN32 ! const BOOL val = TRUE; ! #else ! const int val = 1; ! #endif ! if (setsockopt (rawsend.get_socketid(), IPPROTO_IP, IP_HDRINCL, (char *) &val, sizeof (one)) != 0) ! perror("Setsockopt HDRINCL:"); ! int l = scanning_ports.size()/MAX_PACKETS; *************** *** 431,452 **** switch(par->scan_type){ case FIN_SCAN: ! rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, (*i).first, 0, 0, TH_FIN | par->tcpflags, 0, 0, 0); break; case NULL_SCAN: ! rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, (*i).first, 0, 0, par->tcpflags, 0, 0, 0); break; case XMAS_SCAN: ! rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, (*i).first, 0, 0, TH_FIN | TH_URG | TH_PUSH | par->tcpflags, 0, 0, 0); break; case WINDOW_SCAN: case ACK_SCAN: ! rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, (*i).first, 0, 0, TH_ACK, 0, 0, 0); break; case SYN_SCAN: ! rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, (*i).first, 0, 0, TH_SYN, 0, 0, 0); break; } --- 438,459 ---- switch(par->scan_type){ case FIN_SCAN: ! rawsend.send_tcp_raw(par->ethernet, source, hostname, MAGIC_PORT, (*i).first, 0, 0, TH_FIN | par->tcpflags, 0, 0, 0); break; case NULL_SCAN: ! rawsend.send_tcp_raw(par->ethernet, source, hostname, MAGIC_PORT, (*i).first, 0, 0, par->tcpflags, 0, 0, 0); break; case XMAS_SCAN: ! rawsend.send_tcp_raw(par->ethernet, source, hostname, MAGIC_PORT, (*i).first, 0, 0, TH_FIN | TH_URG | TH_PUSH | par->tcpflags, 0, 0, 0); break; case WINDOW_SCAN: case ACK_SCAN: ! rawsend.send_tcp_raw(par->ethernet, source, hostname, MAGIC_PORT, (*i).first, 0, 0, TH_ACK, 0, 0, 0); break; case SYN_SCAN: ! rawsend.send_tcp_raw(par->ethernet, source, hostname, MAGIC_PORT, (*i).first, 0, 0, TH_SYN, 0, 0, 0); break; } *************** *** 567,571 **** if(!scanning_ports[port].done){ set_port_status(port, PORT_OPEN, "tcp"); ! rawsend.send_tcp_raw(source, hostname, MAGIC_PORT, port, 0, 0, TH_RST, 0, 0, 0); scanning_ports[port].done = true; } --- 574,578 ---- if(!scanning_ports[port].done){ set_port_status(port, PORT_OPEN, "tcp"); ! rawsend.send_tcp_raw(par->ethernet, source, hostname, MAGIC_PORT, port, 0, 0, TH_RST, 0, 0, 0); scanning_ports[port].done = true; } |