🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.hackers
Article #57463

Re: P.D .-m gutaria saber komo s averigua 1 ip en irc hispano

#57463
From: Ripe/7a69
Date: Fri, 01 Feb 2002 23:58
282 lines
9111 bytes
This is a multi-part message in MIME format.
--------------020608050905080500060904
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

algandula wrote:

> "Fernando C.R." <fer_criado@gmx.net> wrote in message news:<a3cg10$dd6$1@venusbbw.net>...
> 
>>Aunque por lo q he visto en el irc-Hispano existe un cifrado de ip, de forma
>>q solo sale un ip virtual q no se como se podra descifrar...si alguien tiene
>>alguna idea????.
>>
>>NANDO.
>>
>>Fernando C.R. <fer_criado@gmx.net> escribi� en el mensaje de noticias
>>a3bhj8$3d6$1@venusbbw.net...
>>
>>>Hola!!. P�gale un vistazo a esta p�gina, no tiene desperdicio. Por cierto,
>>>hay q ser menos vago y utilizar mas los buscadores. La encontr� en Google
>>>con solo poner  ip & irc....en b�squeda de pag en castellano.
>>>
>>>http://www.datafull.com/datahack/notas/nota.php?codigo=56
>>>
>>>Un saludo. NANDO.
>>>
>>>pepe pepon <pepe@pepon.com> escribi� en el mensaje de noticias
>>>a370fu$bc3$1@news.ya.com...
>>>
>>>>hola a todozzzz, kiero saber como se desencripta una ip en el irc
>>>>
>> hispano,
>>
>>>>es decir una ip como esta B16D3L.DUevpQ.virtual y ke pueda averiguar la
>>>>
>> ip.
>>
>>>>  grasia.
>>>>
>>>>   G�aneTe
>>>>
>>>>
>>>>
>>>
> 
> Si lo que quieres es saber la ip de algien utiliza un troyano mira esta pagina 
> http://www.geocities.com/portalsabio
> 

A ver... por partes... Si os mirais las fuentes del ircd usado por el 
irc-hispano vereis que las contrase�as se encriptan con el algoritmo 
tea, usando una key de 64 bits.

---

void tea(unsigned int v[], unsigned int k[], unsigned int x[])
{
         unsigned int y = v[0] ^ x[0], z = v[1] ^ x[1], sum = 0, delta = 
0x9E3779B9;
         unsigned int a = k[0], b = k[1], n = 32;
         unsigned int c = 0, d = 0;

         while (n-- > 0) {
                 sum += delta;
                 y += (z << 4) + a ^ z + sum ^ (z >> 5) + b;
                 z += (y << 4) + c ^ y + sum ^ (y >> 5) + d;
         }

         x[0] = y;
         x[1] = z;
}

---

Como podeis ver este algoritmo es invertible, por lo que aplicando un 
poco de logica matematica podemos sacar esto, que lo unico que hace es 
invertir el algoritmo usado por IRC-Hispano para encriptar las IPs.

---

void des_tea(unsigned int v[], unsigned int k[], unsigned int w[])
{
    register unsigned long       y=v[0],z=v[1],sum=0xC6EF3720,
                                 delta=0x9E3779B9,a=k[0],b=k[1],
                                 c=0,d=0,n=32;
    while(n-->0)
      {
       z -= (y << 4)+c ^ y+sum ^ (y >> 5)+d;
       y -= (z << 4)+a ^ z+sum ^ (z >> 5)+b;
       sum -= delta;
      }
    w[0]=y; w[1]=z;
}

---

Problema? Que para aplicar des_tea necesitamos la clave que se uso en 
tea, y esa clave es de 64 bits, lo que significa 2^64 convinaciones 
distintas, lo que al mismo tiempo significa MUCHISIMOS a�os de 
bruteforce, y si a esto le a�adimos que la Key la cambian de vez en 
cuando.... Pues poco hay que hacer (a no ser que algun ircop corrupto 
que sepa la key la diga).

PD: Os atacheo algo que programe hace tiempo, cuando disponia de la 
clave (�opers corrutos? �Quien hablo de ellos?)

--------------020608050905080500060904
Content-Type: text/plain;
 name="hispano-vip.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="hispano-vip.c"

/* Encripta/Desencripta IPs usando el algoritmo tea */
/* 27/08/01                                         */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <netinet/in.h>

static const unsigned int convert2n[] = {
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        52,53,54,55,56,57,58,59,60,61, 0, 0, 0, 0, 0, 0,
        0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,
        15,16,17,18,19,20,21,22,23,24,25,62, 0,63, 0, 0,
        0,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,
        41,42,43,44,45,46,47,48,49,50,51, 0, 0, 0, 0, 0,

        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};

static const char convert2y[] = {
        'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',
        'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f',
        'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v',
        'w','x','y','z','0','1','2','3','4','5','6','7','8','9','[',']'
};

unsigned int base64toint(const char *s) {
        unsigned int i = convert2n[(unsigned char)*s++];
        while (*s) {
                i <<= 6;
                i += convert2n[(unsigned char)*s++];
        }
        return i;
}

const char *inttobase64(char *buf, unsigned int v, unsigned int count) {
        buf[count] = '\0';
        while (count > 0) {
                buf[--count] = convert2y[(v & 63)];
                v >>= 6;
        }
        return buf;
}

void tea(unsigned int v[], unsigned int k[], unsigned int x[])
{
        unsigned int y = v[0] ^ x[0], z = v[1] ^ x[1], sum = 0, delta = 0x9E3779B9;
        unsigned int a = k[0], b = k[1], n = 32;
        unsigned int c = 0, d = 0;

        while (n-- > 0) {
                sum += delta;
                y += (z << 4) + a ^ z + sum ^ (z >> 5) + b;
                z += (y << 4) + c ^ y + sum ^ (y >> 5) + d;
        }

        x[0] = y;
        x[1] = z;
}

//void des_tea(unsigned long *v,  unsigned long * k, unsigned long * w)
void des_tea(unsigned int v[], unsigned int k[], unsigned int w[])
{
   register unsigned long       y=v[0],z=v[1],sum=0xC6EF3720,
                                delta=0x9E3779B9,a=k[0],b=k[1],
                                c=0,d=0,n=32;
   while(n-->0)
     {
      z -= (y << 4)+c ^ y+sum ^ (y >> 5)+d;
      y -= (z << 4)+a ^ z+sum ^ (z >> 5)+b;
      sum -= delta;
     }
   w[0]=y; w[1]=z;
}

char *encripta(long rip, char *key) {
  char ch;
  char clave[13];
  char *ret;
  int ts;
  unsigned int v[2], k[2], x[2];
  memset(clave, 0, 13);
  strncpy(clave, key, 12);
  ch=clave[6];
  clave[6]=0;
  k[0]=base64toint(clave);
  clave[6]=ch;
  k[1]=base64toint(clave+6);
otra:
  v[0]=(k[0]&0xffff0000)+ts;
  v[1]=ntohl((unsigned long)rip);
  x[0]=x[1]=0;
  tea(v, k, x);
  ret=(char *)malloc(22);
  memset(ret, 0, 22);
  inttobase64(ret, x[0], 6);
  *(ret+6)='.';
  inttobase64(ret+7, x[1], 6);
  strncpy(ret+13, ".Virtual", 8);  
  if (strchr(ret, '[') || strchr(ret, '[')) {
    if (++ts==65536) {
      free(ret);
      return(NULL);
    }
    goto otra;
  }
  return(ret);
}

long desencripta(char *vip, char *key) {
  char ch;
  char clave[13];
  char virtual[14];
  int ts;
  unsigned int v[2], k[2], x[2];
  memset(clave, 0, 13);
  strncpy(clave, key, 12);
  memset(virtual, 0, 14);
  strncpy(virtual, vip, 13);
  ch=clave[6];
  clave[6]=0;
  k[0]=base64toint(clave);
  clave[6]=ch;
  k[1]=base64toint(clave+6);
  virtual[6]=0;
  v[0]=base64toint(virtual);
  v[1]=base64toint(virtual+7);
  des_tea(v, k, x);
  x[1]=htonl(x[1]);
  return(x[1]);
}  

int main(int argc, char **argv) {
  long rip;
  char *vip;
  if (argc<4) {
    printf("Uso: %s <E/D> <Vip/Rip> <Clave>\n", argv[0]);
    exit(0);
  }
  if (argv[1][0]=='E') {
    rip=inet_addr(argv[2]);
    vip=encripta(rip, argv[3]);
    printf("Vip= %s\n", vip);
  }
  if (argv[1][0]=='D') {
    rip=desencripta(argv[2], argv[3]);
    printf("Rip= %s\n", inet_ntoa(rip));
  }
}
 









--------------020608050905080500060904--
Technical Details
Message-ID: <3C5B2BAD.8070303@NO-SPAM-HERE7a69ezine.org>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!newsfeed.bcn.ttd.net!news.bcn.ttd.net!not-for-mail
References: <a370fu$bc3$1@news.ya.com> <a3bhj8$3d6$1@venusbbw.net> <a3cg10$dd6$1@venusbbw.net> <6eaedb4.0202011506.79a0f093@posting.google.com>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f4463,711f4f2a783f80fb
X-Google-Attributes: gidf4463,public
X-Google-ArrivalTime: 2002-02-01 15:58:53 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!newsfeed.bcn.ttd.net!news.bcn.ttd.net!not-for-mail
From: Ripe/7a69 <ripe@NO-SPAM-HERE7a69ezine.org>
Newsgroups: es.comp.hackers
Subject: Re: P.D .-m gutaria saber komo s averigua 1 ip en irc hispano
Date: Sat, 02 Feb 2002 00:58:37 +0100
Organization: Telefonica Transmision de Datos
Lines: 283
Message-ID: <3C5B2BAD.8070303@NO-SPAM-HERE7a69ezine.org>
References: <a370fu$bc3$1@news.ya.com> <a3bhj8$3d6$1@venusbbw.net> <a3cg10$dd6$1@venusbbw.net> <6eaedb4.0202011506.79a0f093@posting.google.com>
NNTP-Posting-Host: 80-24-12-216.uc.nombres.ttd.es
Mime-Version: 1.0
Content-Type: multipart/mixed;
 boundary="------------020608050905080500060904"
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.7) Gecko/20020121