[Javanetsim-cvs] IceScan AUTHORS, 1.1, 1.2 icescan.cc, 1.40, 1.41 TODO, 1.17, 1.18 icediscover.cc,
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2006-12-21 17:35:11
|
Update of /cvsroot/javanetsim/IceScan In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30605 Modified Files: AUTHORS icescan.cc TODO icediscover.cc csubtarget.h csubtarget.cc Log Message: no message Index: icescan.cc =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icescan.cc,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** icescan.cc 21 Dec 2006 16:36:28 -0000 1.40 --- icescan.cc 21 Dec 2006 17:35:08 -0000 1.41 *************** *** 1,5 **** /* * icescan.cc -- Contains the main() function of IceScan and functions ! * to parse command line args and print help; */ --- 1,5 ---- /* * icescan.cc -- Contains the main() function of IceScan and functions ! * to parse command line args and print help. */ *************** *** 361,366 **** wsa = start_sockets(); - init_rand(); - time(&rawtime); --- 361,364 ---- Index: csubtarget.cc =================================================================== RCS file: /cvsroot/javanetsim/IceScan/csubtarget.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** csubtarget.cc 21 Dec 2006 16:36:28 -0000 1.3 --- csubtarget.cc 21 Dec 2006 17:35:08 -0000 1.4 *************** *** 387,391 **** maxat++; ! recieve_tcp_raw(p, rawsend, source, saddress, scanning_ports, MAGIC_PORT, 10, 0); } } --- 387,391 ---- maxat++; ! recieve_tcp_raw(p, rawsend, source, saddress, scanning_ports, MAGIC_PORT, 10); } } *************** *** 393,401 **** j++; - //iceusleep(1000); ! recieve_tcp_raw(p, rawsend, source, saddress, scanning_ports, MAGIC_PORT, (maxat) * covar + 10000, maxat); - //DBGOUTPUT(covar); } } --- 393,399 ---- j++; ! recieve_tcp_raw(p, rawsend, source, saddress, scanning_ports, MAGIC_PORT, MIN((maxat) * covar + 10000, MAX_RAW_WAIT + maxat * 500)); } } *************** *** 417,421 **** } ! int csubtarget::recieve_tcp_raw(cpcapreader &p, crawsocket &rawsend, icestring &source, struct sockaddr_in &saddress, std::map <int, scanning_port> &scanning_ports, int MAGIC_PORT, int timeout, int packets){ int bytes; char *response; --- 415,419 ---- } ! void csubtarget::recieve_tcp_raw(cpcapreader &p, crawsocket &rawsend, icestring &source, struct sockaddr_in &saddress, std::map <int, scanning_port> &scanning_ports, int MAGIC_PORT, int timeout){ int bytes; char *response; *************** *** 423,427 **** struct tcphdr *tcp; unsigned int len; ! int maxtimeval = 0; struct timeval tv1, tv2, tv3; gettimeofday(&tv1, 0); --- 421,425 ---- struct tcphdr *tcp; unsigned int len; ! bool at_least_one_recieved = false; struct timeval tv1, tv2, tv3; gettimeofday(&tv1, 0); *************** *** 443,451 **** if ((tcp->th_flags & TH_RST) && (par->scan_type == FIN_SCAN || par->scan_type == NULL_SCAN || par->scan_type == XMAS_SCAN)) { port = ntohs(tcp->th_sport); ! if(scanning_ports.find(port) != scanning_ports.end()){ if(!scanning_ports[port].done){ set_port_status(port, PORT_CLOSED, "tcp"); ! scanning_ports[port].done = true; } } --- 441,449 ---- if ((tcp->th_flags & TH_RST) && (par->scan_type == FIN_SCAN || par->scan_type == NULL_SCAN || par->scan_type == XMAS_SCAN)) { port = ntohs(tcp->th_sport); ! if(scanning_ports.find(port) != scanning_ports.end()){ if(!scanning_ports[port].done){ set_port_status(port, PORT_CLOSED, "tcp"); ! scanning_ports[port].done = true; } } *************** *** 504,517 **** gettimeofday(&tv2, 0); ! if(port){ ! if(SUB_TIMEVALS(tv2,scanning_ports[port].tv) > maxtimeval) ! maxtimeval = SUB_TIMEVALS(tv2,scanning_ports[port].tv); ! } ! ! if(SUB_TIMEVALS(tv2,tv1) >= timeout || SUB_TIMEVALS(tv2,tv1) > MAX_RAW_WAIT + packets * 500) stop = true; } - - return maxtimeval; } --- 502,508 ---- gettimeofday(&tv2, 0); ! if(SUB_TIMEVALS(tv2,tv1) >= timeout) stop = true; } } Index: csubtarget.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/csubtarget.h,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** csubtarget.h 21 Dec 2006 16:29:36 -0000 1.55 --- csubtarget.h 21 Dec 2006 17:35:08 -0000 1.56 *************** *** 6,10 **** #include "nbt_wrapper.h" #include "iceprotocol.h" ! #include "icesockets/sock_pcap.h" #include "icediscover.h" #include "portdef.h" --- 6,10 ---- #include "nbt_wrapper.h" #include "iceprotocol.h" ! #include "icesockets/crawsocket.h" #include "icediscover.h" #include "portdef.h" *************** *** 105,109 **** void raw_tcp_scan(icestring scan_type); ! int recieve_tcp_raw(cpcapreader &p, crawsocket &rawsend, icestring &source, struct sockaddr_in &saddress, std::map <int, scanning_port> &scanning_ports, int MAGIC_PORT, int timeout, int packets); void shutdown_scansocket(int j); --- 105,109 ---- void raw_tcp_scan(icestring scan_type); ! void recieve_tcp_raw(cpcapreader &p, crawsocket &rawsend, icestring &source, struct sockaddr_in &saddress, std::map <int, scanning_port> &scanning_ports, int MAGIC_PORT, int timeout); void shutdown_scansocket(int j); Index: icediscover.cc =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icediscover.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** icediscover.cc 21 Dec 2006 15:37:23 -0000 1.1 --- icediscover.cc 21 Dec 2006 17:35:08 -0000 1.2 *************** *** 174,178 **** std::map <int, scanning_port> scanning_ports; ! //add privileges checking!!! if(par->pu_ports.size() > 0){ --- 174,185 ---- std::map <int, scanning_port> scanning_ports; ! #if (__CYGWIN__) ! 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..."); ! return false; ! } if(par->pu_ports.size() > 0){ *************** *** 193,199 **** else{ struct scanning_port sp; ! unsigned i; ! get_random_bytes(&i, sizeof(i)); ! i = ((unsigned)rand() % 35536) + 30000; // return "random" number [30000, 65535] sp.port_number = i; --- 200,207 ---- else{ struct scanning_port sp; ! crandom c; ! unsigned i = 0; ! ! i = ((unsigned)c.rand_uint16() % 35536) + 30000; // return "random" number [30000, 65535] sp.port_number = i; Index: AUTHORS =================================================================== RCS file: /cvsroot/javanetsim/IceScan/AUTHORS,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AUTHORS 21 Dec 2006 13:13:34 -0000 1.1 --- AUTHORS 21 Dec 2006 17:35:08 -0000 1.2 *************** *** 23,27 **** Dug Song <dugsong(at)monkey.org> for his GREAT libdnet library ! (some modified code from it used in icesockets/sock_eth.h) Andrew Tridgell and other Samba (http://samba.org) developers --- 23,29 ---- Dug Song <dugsong(at)monkey.org> for his GREAT libdnet library ! (some modified code from it used in icesockets/cethwrapper.h and ! int icesockets/crandom.h; some systems doesn't have libdnet ! so i copied some code into IceScan). Andrew Tridgell and other Samba (http://samba.org) developers Index: TODO =================================================================== RCS file: /cvsroot/javanetsim/IceScan/TODO,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** TODO 21 Dec 2006 13:59:50 -0000 1.17 --- TODO 21 Dec 2006 17:35:08 -0000 1.18 *************** *** 10,14 **** -- Discovering -- ! + TCP SYN/FIN Ping (-PS [portlist]) + ARP/RAW Discovery --- 10,14 ---- -- Discovering -- ! + TCP SYN/FIN Ping (-PS/PF [portlist]) + ARP/RAW Discovery *************** *** 18,24 **** * Fix udp scan timeouts. * Fix Raw TCP scan timeouts. - * Rewrite raw_tcp_scan to make it support ping. + IP Protocol Scan (-SI) - * do setting random window/seq(ack and seg) for raw scanning + --ttl option and ttl random generation. + --badchksum option. --- 18,22 ---- *************** *** 29,31 **** -- Misc -- ! * test auto-selecting interface (to listen) and source ip to scan \ No newline at end of file --- 27,29 ---- -- Misc -- ! * test auto-selecting interface (to listen) and source ip to scan |