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

Ω /prog/ FINAL CHALLENGE Ω

Name: Anonymous 2011-04-27 18:36

THE CHALLENGE:

Program a spambot that target's /prog/ in the language of your choice and post the source code here. Most effective spammer wins. Remember, this is the final challenge for a reason.

+-This challenge is designed to kill /prog/ for goood-+

THE DEADLINE: Cinco de Mayo 00:00 /prog/ time.

I watched as the Lamb opened the first of the seven seals. Then I heard one of the four living creatures say in a voice like thunder, "Come and see!" I looked, and there before me was a white horse! Its rider held a bow, and he was given a crown, and he rode out as a conqueror bent on conquest.— Revelation 6:1-2

Good luck!

Name: Anonymous 2011-04-27 20:12

>>3


import urllib2, httplib, time

def scan_first_post(threadid, phrases):
    resp = urllib2.urlopen('http://dis.4chan.org/read/prog/' + threadid + '/1')
    page = resp.read()
    page = page.lower().strip('. _-*,\'"')
    for i in range(0, len(phrases)):
        if page.find(phrases[i]) != -1:
            return 1
    return 0

def scan_until(phrases, stopat):
    ret = []
    pagenum = 1
    found = 0
    while len(ret) < stopat:
        resp = urllib2.urlopen('http://dis.4chan.org/list/prog/' + str(pagenum))
        page = resp.read()
        hrefstr = '<a href=\'read/prog/'
        while len(ret) < stopat:
            i = page.find(hrefstr)
            if i == -1:
                break
            i += len(hrefstr)
            page = page[i:]
            i = page.find(hrefstr)
            if i == -1:
                break
            i += len(hrefstr)
            page = page[i:]
            i = page.find('\'')
            threadid = page[:i]
            page = page[i+2:]
            i = page.find('</a>')
            if i == -1:
                break
            title = page[:i].strip('. _-*,\'"')
            page = page[i:]
            i = page.find('<td>')
            if i == -1:
                break
            i += len('<td>')
            page = page[i:]
            i = page.find('<')
            if i == -1:
                break
            numposts = page[:i]
            numposts = int(numposts)
            if numposts >= 1000:
                continue
            title = title.lower()
            canpush = 1
            for i in range(0, len(phrases)):
                if title.find(phrases[i]) != -1:
                    canpush = 0
                    break
            if scan_first_post(threadid, phrases) != 0:
                canpush = 0
            if canpush == 1:
                ret.append(threadid)
            else:
                found = 1
        pagenum = pagenum + 1
    return ret, found

def post_prog(threadid, comment, email):
    body = 'bbs=prog&id=' + threadid + '& lol what 2&kotehan=&meiru=' + email + '&com=' + comment + '&email=%27'
    h = httplib.HTTP('dis.4chan.org')
    h.putrequest('POST', '/post')
    h.putheader('Content-Type', 'application/x-www-form-urlencoded')
    h.putheader('Host', 'dis.4chan.org')
    h.putheader('Content-Length', len(body))
    h.endheaders()
    h.send(body)
    h.getreply()


while 1:
    try:
        bumplist, found = scan_until(['fart', 'autism', 'autist', '20lbs'], 40)
        if found == 1:
            bumplist.reverse()
            print 'Bumping list: ' + str(bumplist)
            for i in range(0, len(bumplist)):
                post_prog(bumplist[i], ' ', '')
                time.sleep(5)
        else:
            print 'Front page is clean'
            time.sleep(20)
    except urllib2.HTTPError:
        print 'HTTP Error'
    except urllib2.URLError:
        print 'URL Error'
    except httplib.HTTPException:
        print 'HTTP Error'
    except httplib.NotConnected:
        print 'Not Connected Error'
    except httplib.IncompleteRead:
        print 'Incomplete Read Error'
    except httplib.ImproperConnectionState:
        print 'Improper Connection State Error'
    except httplib.CannotSendRequest:
        print 'Cannot Send Request Error'
    except httplib.CannotSendHeader:
        print 'Cannot Send Header Error'
    except httplib.ResponseNotReady:
        print 'Response Not Ready Error'
    except httplib.BadStatusLine:
        print 'Bad Status Line Error'

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