Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

Used IP addresses

Name: Anonymous 2009-03-02 18:05

Anyone got some C code that loops over all used IP addresses?  Can you come up with any special optimizations?  (I need to handle them in the "%u.%u.%u.%u"-form; computations are independant and can be run in parallel)

Name: Anonymous 2009-03-02 18:08


for(i = 0; i < 256; i++)
  for(h = 0; h < 256; h++)
    for(j = 0; j < 256; j++)
      for(k = 0; k < 256; k++)
        printf("%d.%d.%d.%d",i,h,j,k);

Name: Anonymous 2009-03-02 18:25



/*
EXPERT C CODING
*/



#include <stdio.h>
#include <stdint.h>
#include <arpa/inet.h>
#include <limits.h>

int main(int argc, char **argv) {

  uint32_t ip = 0, ipn;
  unsigned char *p = (unsigned char*)&ipn;
  while(1) {
    ipn = htonl(ip);
    printf("%d.%d.%d.%d\n",p[0],p[1],p[2],p[3]);
    if(ip++==UINT_MAX)
      break;
  }

  return 0;
}

Name: Anonymous 2009-03-02 18:37

>>2
yo dawg, we heard u like iteration, so we put a for loop in ur for loop so u can iterate while u iterate

Name: Anonymous 2009-03-02 20:09

>>1
are you a hacker?

Name: Anonymous 2009-03-02 20:22

[foldr1 ((++).(++".")) $ map show [a,b,c,d] | a <- [0..255], b <- [0..255], c <- [0..255], d <- [0..255]]

Name: Anonymous 2009-03-02 20:23

    for(i = 0; i < 256; i++)
      for(h = 0; h < 256; h++)
        for(j = 0; b < 256; j++)
          for(k = 0; t < 256; k++)
            printf("%d.%d.%d.%d",i,h,b,t);

Name: Anonymous 2009-03-02 20:26

Have you read your poignant guide today?
256.times{|i|256.times{|j|256.times{|k|256.times{|l|puts "#{i}.#{j}.#{k}.#{l}"}}}}
THIS IS SO ELEGANT FUCK I NEED TO MASTURBATE.
I've run it for an hour, currently at 1.12.90.201

Name: Anonymous 2009-03-02 20:52

[foldr1 ((++).(++".")) $ map show [a,b,c,d] | a <- [0..255], b <- [0..255], c <- [0..255], d <- [0..255]][/code
[code]map (intercalate "." . map show) . sequence . replicate 4 $ [0..255]

I came

Name: Anonymous 2009-03-02 20:52

[/code]

Name: Anonymous 2009-03-02 20:53

>>9
map (intercalate "." . map show) . sequence . replicate 4 $ [0..255]

Name: Anonymous 2009-03-02 20:54

>>9,11
<interactive>:1:5: Not in scope: `intercalate'

Name: Anonymous 2009-03-02 21:02

(2**32).times{|ip| printf("%d.%d.%d.%d\n",(ip>>24)&0xff,(ip>>16)&0xff,(ip>>8)&0xff,ip&0xff)}

Name: Anonymous 2009-03-02 21:14


(2**32).times{|ip|a=Array.new(4){|n|(ip>>(n*8))&0xff};puts a.reverse.join(".")}

Name: Anonymous 2009-03-02 21:29

uint32_t n = 1;
while (n)
    printf("%d\n", n++);

Name: Anonymous 2009-03-03 5:15

print join '.',unpack 'C4',pack N,$_ foreach 0..4294967295

Name: Anonymous 2009-03-03 5:34

Here's the code I already had, by the way:

        for (a = 58; a < 223; ++a) {
                if (a == 100) { a = 107; continue; }
                if (a == 127) continue;
                if (a == 175) { a = 177; continue; }
                if (a == 179) { a = 183; continue; }
                if (a == 185) continue;
                for (b = 0; b < 256; ++b) {
                        for (c = 0; c < 256; ++c) {
                                for (d = 1; d < 255; ++d) {
                                        SHA1_Init(&ctx);
                                        sprintf(prefix1, "%u.%u.%u.%u", a, b, c, d);
                                        SHA1_Update(&ctx, prefix1, strlen(prefix1));
                                        SHA1_Update(&ctx, prefix2, 12);
                                        SHA1_Update(&ctx, salt, 448);
                                        SHA1_Final(md, &ctx);
                                        if (memcmp(search, md, sizeof(search)) == 0)
                                                goto done;
                                }
                        }
                }
                printf("%u/8 done.\n", a);
        }

Name: Anonymous 2009-03-03 6:27

>>17
Stop reading at goto done;

Name: Anonymous 2009-03-03 6:51

All right, I made some changes (most importantly I removed the overflow so it didn't loop forever on the inner loops, and I split the sprintf into four calls).  But I'm not really sure about what IP addresses I should check.  What are those LEGACY blocks?[1]  My research has shown that they might indeed be in use.

[1] http://www.iana.org/assignments/ipv4-address-space/

Name: Anonymous 2009-03-03 6:58

>>19
Nevermind, it appears there is a section on that... I need my eyes checked I think.

Now then, I hope my algorithm is correct.

Name: Anonymous 2009-03-03 7:06

>>18

                                }
                        }
                }
                printf("%u/8 done.\n", a);
        }

Name: Anonymous 2009-03-03 7:09

>>21
Thank you, FrozenVoid.

Name: Anonymous 2009-03-03 8:30

Turned out my algorithm was wrong after all, oh well, I changed it and got OpenMP working.

The input:
/* http://dis.4chan.org/read/sci/1172747610
 * 1  Name: FrozenVoid : 2007-03-01 08:54  ID:fPuNCwa3 */


And the output:
80.230.22.238

Oh FrozenVoid, this explains everything.

Name: Anonymous 2009-03-03 8:47

>>23
JEWS

Name: Anonymous 2009-03-03 8:55

Got 80.230.70.64 from the second day[1], I'd say this pretty much confirms it.

[1] http://dis.4chan.org/read/sci/1172747610/20

Name: Anonymous 2009-03-03 12:27

>>25
JEWS

Name: Anonymous 2009-03-03 13:05

>>8
Interesting.  I've been running it 25 minutes and its at 24.209.148.240

Name: Anonymous 2009-03-03 14:12

>>23,25
What does it mean?

Name: Anonymous 2009-03-03 14:37

>>28
80.230.22.238 = IGLD-80-230-22-238.inter.net.il.
80.230.70.64  = IGLD-80-230-70-64.inter.net.il.


il is the TLD of Israel.

Name: Anonymous 2009-03-03 15:01

>>29
so FV is an arab?
JEWS don't internet.

Name: Anonymous 2009-03-03 15:02

>>30
JEWS don't internet. 
Yes they do, and they are often VERY annoying.

Name: Anonymous 2009-03-03 15:51

>>29
I suddenly feel this burning desire to become a muslim and join Hamas.

Name: Anonymous 2009-03-03 16:08

>>32
I suddenly feel this burning desire to purchase some Zion gold.

Name: Anonymous 2009-03-03 22:22

>>33-34
I suddenly feel this burning sensation when I pee.

Name: Anonymous 2009-03-03 23:35

>>35
I suddenly feel this burning vomit in small quantity in my mouth.

Name: Anonymous 2009-03-04 0:39

failure

Name: Anonymous 2009-03-04 1:03


};

Name: Anonymous 2009-03-04 1:04

>>36
Go see you're local GP and get that checked out dude, that doesn't sound wright.

Name: Anonymous 2009-03-04 2:40

Fuck used IP addresses, where can I get new ones?

Name: Anonymous 2009-03-04 4:38

256.256.256.257

Name: Anonymous 2009-03-04 4:47

>>41
FUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU

Name: Anonymous 2009-03-04 5:13

>>40
This problem was caused by the popularity of IBM's System/360 architecture, which had standardized on 8 bits per byte. This led to IP networking standards using these as a basic component in designing the structure of protocols.

Some computers at the time had 9 bits in a byte, and 36-bit words. Just think if our IP addresses were made up of four nonets instead - we'd have 68 billion addresses available and all this talk of IPv6 migration wouldn't be happening!

Name: Anonymous 2009-03-04 6:08

>>43
But then it'd take 16 times longer to crack FrozenVoid's ID!

Name: Anonymous 2009-03-04 6:37

>>44
How do you crack ID?

Name: Anonymous 2009-03-04 6:39

>>45
With great difficulty.

Name: Anonymous 2009-03-04 6:40

>>46
Explain.

Name: Anonymous 2009-03-04 6:43

>>47
You utilize great difficulty as a part of the cracking process.

Name: Anonymous 2009-03-04 16:52

>>45-48
use great qw/difficulty/;

Name: Anonymous 2009-03-04 16:57

>>23
JEWS DID FROZENVOID

Also, can you post the sauce?

Name: Anonymous 2009-03-04 17:00

>>50
DISREGARD THAT, I SUCK COCKS AND CAN'T READ THREADS.

Name: Anonymous 2009-03-04 17:02

>>51
but post the new algorithm anyways

Name: Anonymous 2009-03-04 17:03

>>51
Oh, ok. Consider it disregarded.

Name: Anonymous 2009-03-04 17:03

>>52
Heh heh hehhh shut up beavis

Name: Anonymous 2009-03-04 17:05

>>52
You'll probably have to read the Shiichan source to understand everything.
% cc -fopenmp -O3 -Wall -s -fomit-frame-pointer -march=native idcrack.c -lssl -lroken
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <openssl/sha.h>
#include <base64.h>
#include <omp.h>

/* http://dis.4chan.org/read/sci/1172747610/1
 * 1  Name: FrozenVoid : 2007-03-01 08:54  ID:fPuNCwa3 */
/*     ?fPu   NCwa   3???
 * = 5df3ee 342c1a dd75d7 */
/* static const unsigned char search[] = { 0xf3, 0xee, 0x34, 0x2c, 0x1a }; */

/* http://dis.4chan.org/read/sci/1172747610/20
 * 20  Name: FrozenVoid : 2007-03-02 01:35  ID:+sP42Nst
 *   _+sP   42Ns   t___
 * 5feb0f e3636c b575d7 */
static const unsigned char search[] = { 0xeb, 0x0f, 0xe3, 0x63, 0x6c };

/* http://www.iana.org/assignments/ipv4-address-space/
 * Using 2009-01-28 revision. */
static const unsigned char ablocks[] = {
        80, 85, 213, 212, 62, 84, 195, 78, 217, 79, 94, 81, 82,
        3, 4, 6, 7, 8, 9, 11, 12, 13, 15, 16, 17, 18, 19, 20,
        21, 22, 24, 25, 26, 28, 29, 30, 32, 33, 34, 35, 38, 40,
        41, 43, 44, 45, 47, 48, 51, 52, 53, 54, 55, 56, 57, 58,
        59, 60, 61, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
        73, 74, 75, 76, 77, 86,
        87, 88, 89, 90, 91, 92, 93, 95, 96, 97, 98, 99, 108,
        109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
        120, 121, 122, 123, 124, 125, 126, 128, 129, 130, 131,
        132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
        143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153,
        154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
        165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 178,
        184, 186, 187, 188, 189, 190, 191, 192, 193, 194,
        196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
        207, 208, 209, 210, 211, 214, 215, 216,
        218, 219, 220, 221, 222 };

int
main(int argc, char* argv[])
{
        unsigned char salt[448];
        unsigned char search[5];
        FILE* fp;
        int a;

        fp = fopen("
salt.cgi", "rb");
        fread(salt, 448, 1, fp);
        fclose(fp);

#pragma omp parallel
        {
#pragma omp for schedule(static, 1)
                for (a = 0; a < sizeof(ablocks); ++a) {
                        SHA_CTX ctx;
                        char prefix[16] = { '\0' };
                        unsigned char md[SHA_DIGEST_LENGTH] = { '\0' };
                        unsigned int b, c, d;
                        char* bpos;
                        char* cpos;
                        char* dpos;
                        bpos = prefix + sprintf(prefix, "%u.", ablocks[a]);
                        for (b = 0; b < 256; ++b) {
                                cpos = bpos + sprintf(bpos, "%u.", b);
                                for (c = 0; c < 256; ++c) {
                                        dpos = cpos + sprintf(cpos, "%u.", c);
                                        for (d = 0; d < 256; ++d) {
                                                sprintf(dpos, "%u", d);
                                                SHA1_Init(&ctx);
                                                SHA1_Update(&ctx, prefix, strlen(prefix));
                                                SHA1_Update(&ctx, "021172747610", 12);
                                                SHA1_Update(&ctx, salt, 448);
                                                SHA1_Final(md, &ctx);
                                                if (memcmp(search, md + 1, 5) == 0) {
                                                        char* base64 = NULL;
                                                        base64_encode(md, SHA_DIGEST_LENGTH, &base64);
                                                        base64[9] = '\0';
                                                        printf("%u.%u.%u.%u: %s\n", ablocks[a], b, c, d, base64 + 1);
                                                        free(base64);
                                                        exit(0);
                                                }
                                        }
                                }
                        }
                        printf("%u/8 (%u) done. [%u]\n", ablocks[a], a, omp_get_thread_num());
                }
        }
        printf("Couldn't find it...\n");

        exit(1);
}

Name: Anonymous 2009-03-04 17:07

>>55
unsigned char search[5];
I think I left this line from something else... remove it.

Name: Anonymous 2009-03-04 19:56

>>55
Hmm, clever. And also rather worrying.

Name: Anonymous 2009-03-05 8:55

FrozenVoid is a TERRORIST!

Name: Anonymous 2009-03-05 10:47

JEWS

Don't change these.
Name: Email:
Entire Thread Thread List