Author Topic: Forum Spammer.  (Read 2942 times)

0 Members and 1 Guest are viewing this topic.

Offline hmm

  • Serf
  • *
  • Posts: 23
  • Cookies: 0
    • View Profile
Forum Spammer.
« on: July 31, 2012, 09:34:09 am »
I would like to make a forum spammer. If any of you have some place for good info, a link would be greatly appreciated.

Offline techb

  • Soy Sauce Feeler
  • Global Moderator
  • King
  • *
  • Posts: 2350
  • Cookies: 345
  • Aliens do in fact wear hats.
    • View Profile
    • github
Re: Forum Spammer.
« Reply #1 on: July 31, 2012, 10:00:50 am »
Idk why you would need a forum spammer, very bad character.

But you would need Sockets, cookie handling, knowledge of http protocol including GET and POST.
>>>import this
-----------------------------

Offline hmm

  • Serf
  • *
  • Posts: 23
  • Cookies: 0
    • View Profile
Re: Forum Spammer.
« Reply #2 on: July 31, 2012, 10:08:28 am »
I think it would be a nice learning experience. Thanks. If anyone has any links feel free to toss them over.

Offline Kulverstukas

  • Administrator
  • Zeus
  • *
  • Posts: 6627
  • Cookies: 542
  • Fascist dictator
    • View Profile
    • My blog
Re: Forum Spammer.
« Reply #3 on: July 31, 2012, 10:31:56 am »
If we'll have any, we will. Don't be a bragger.
Techb just said what you need. Learn how the HTTP protocol works, then do your homework about all those pieces techb said.

Offline hmm

  • Serf
  • *
  • Posts: 23
  • Cookies: 0
    • View Profile
Re: Forum Spammer.
« Reply #4 on: August 01, 2012, 03:26:16 am »
Got that jazz down. Currently looking for a way to get around captcha, if anyone has any info(looking into OCRs already). Also just a general question, am I not supposed to ask questions on here or something?
« Last Edit: August 01, 2012, 03:31:36 am by hmm »

Offline Ragehottie

  • Knight
  • **
  • Posts: 313
  • Cookies: -9
  • Hack to learn, not learn to hack.
    • View Profile
Re: Forum Spammer.
« Reply #5 on: August 01, 2012, 09:00:19 am »
I have never been on a forum that used captcha if you have an account.
Blog: rexmckinnon.tumblr.com

Offline Daemon

  • VIP
  • Baron
  • *
  • Posts: 845
  • Cookies: 153
  • A wise man fears a gentle mans anger
    • View Profile
Re: Forum Spammer.
« Reply #6 on: August 01, 2012, 09:17:20 am »
Got that jazz down. Currently looking for a way to get around captcha, if anyone has any info(looking into OCRs already). Also just a general question, am I not supposed to ask questions on here or something?

Projects and discussion....so not exactly a forum for questions. More a place where you toss out your idea for a project, then allow us to help you flesh it out and in exchange you use us as tester's. Perhaps a more detailed explanation with more focused questions might have garnered a more...enthusiastic response.

Again though, forum spammer is kind of a questionable subject. Good experience perhaps, but good experience for what? You weren't really clear on any of your intentions except to make a forum spammer haha.

That said, that's quite a lot of stuff to know for it. It certainly sounds like quite the learning experience, and if you go through with it please keep us updated :)
This lifestyle is strictly DIY or GTFO - lucid

Because sexploits are for h0edays - noncetonic


Xires burns the souls of HF skids as a power supply

Offline hmm

  • Serf
  • *
  • Posts: 23
  • Cookies: 0
    • View Profile
Re: Forum Spammer.
« Reply #7 on: August 17, 2012, 07:56:28 pm »
This will auto post random lines from a file to however many blogspot blogs you have, but youll get fucked by the captcha.


Code: (python) [Select]
import random
import time
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
## open text file from which to get lines from

f = open('XXXXX.txt', 'r')
post_list=[]
for line in f:
        post_list.append(line)
## Below goes to blogger
b = webdriver.Firefox()
b.get('http://www.blogger.com')
email = b.find_element_by_id('Email')
email.send_keys('XXXXXX')
password = b.find_element_by_id('Passwd')
password.send_keys('XXXXX')
b.find_element_by_id('signIn').click()
##posting: For the first range specify how many blogs you have lower bound is always one upper bound is # of blogs - 1 (I tested on 5). The second for is how many posts you want to make on one of your blogs, I again was testing five.
while(True):
    for i in range(1,6):
        p1 = ".//*[@id='XXXX'][3][2][2][2][3][2]["
        p2 = str(i)
        p3 = "][4]/a[1]"
        path = p1 + p2 + p3
        b.find_element_by_xpath(path).click()
        for n in range(0,5):
            time.sleep(3)
            b.find_element_by_xpath(".//*[@id='XXXX'][3][3]/form[1][2]/span[1]/span/button[2]").click()
            b.find_element_by_id('XXXX').send_keys(random.choice(post_list))
            b.find_element_by_xpath(".//*[@id='XXX'][3][3]/form[1][1]/span/button[1]").click()
            time.sleep(5)
            if n == 4:
                b.find_element_by_css_selector("XXXXX").click()
                time.sleep(5)
            else:
                b.find_element_by_xpath(".//*[@id='XXXXX'][3][2][1]/a[2]").click()
Note: the sleeps are to wait for load times, although I have been considering using seleniums wait for load time john



The below is a twitter bot which will again tweet randomly from a TXT file. I'm trying currently to support multiple threads, but selenium is being a fuck for that. If anyone has any idea how to do this, PLEASE PLEASE PLEASEEEEE hook it up.
Code: (python) [Select]


from urllib import urlopen
import re
import string
from twitter import *
import random
import time
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
import threading






tweets=[]


f = open('ap.txt', 'r')
for line in f:
    if len(line)>120:
        line = line[:120]
    line = line.decode('utf-8')
    tweets.append(line)
def wait_for_element(e, browser):
    if browser.is_element_present(e):
        return e
    else:
        time.sleep(.1)


class twit(threading.Thread):
    def __init__(self, usr, pw):
        threading.Thread.__init__(self)
        self.usr = usr
        self.pw = pw
        self.browser = webdriver.Firefox()
    def run(self):
        self.browser.get("http://www.twitter.com/")
        elem = self.browser.find_element_by_css_selector(".text-input.email-input")
        elem.send_keys(self.usr)
        elem = self.browser.find_element_by_css_selector(".text-input.flex-table-input")
        elem.send_keys(self.pw)
        self.browser.find_element_by_css_selector(".submit.btn.primary-btn.flex-table-btn.js-submit").click()
        time.sleep(2)
        i=0
        while(True):
            while(True):
                try:
                    self.browser.find_element_by_class_name("twitter-anywhere-tweet-box-editor").send_keys(random.choice(tweets))
                    break
                except:
                    time.sleep(.1)
            while(True):
                try:
                    self.browser.find_element_by_css_selector(".tweet-button.btn.primary-btn").click()
                    break
                except:
                    time.sleep(.1)
            time.sleep(3)

username = raw_input('Enter your usename: ')
password = raw_input('Enter your password: ')
t1 = twit(username, password)


t1.start()


Staff Edit
Please use the edit button, do NOT double post
« Last Edit: September 09, 2012, 08:00:02 pm by skidiot.h »

Offline D4rkC10ud

  • /dev/null
  • *
  • Posts: 12
  • Cookies: -6
    • View Profile
Re: Forum Spammer.
« Reply #8 on: August 30, 2012, 05:02:55 am »
Socket is good but it`s too hardly. I think for these works CURL is better because it`s multyplatform and multythread library.
In Soviet Russia TV watch You!

Offline techb

  • Soy Sauce Feeler
  • Global Moderator
  • King
  • *
  • Posts: 2350
  • Cookies: 345
  • Aliens do in fact wear hats.
    • View Profile
    • github
Re: Forum Spammer.
« Reply #9 on: August 30, 2012, 05:23:47 am »
Socket is good but it`s too hardly. I think for these works CURL is better because it`s multyplatform and multythread library.

You can not get more multi platform or multi language than using sockets. Sockets will teach WAY more than anything Curl has to offer.
>>>import this
-----------------------------

Offline D4rkC10ud

  • /dev/null
  • *
  • Posts: 12
  • Cookies: -6
    • View Profile
Re: Forum Spammer.
« Reply #10 on: August 30, 2012, 05:37:20 am »
I don`t like coding GUI in asm and write network at sokets. It`s possible, but it takes many time. And sokets in win32 has many difference from sokets in *nix.
In Soviet Russia TV watch You!

Offline techb

  • Soy Sauce Feeler
  • Global Moderator
  • King
  • *
  • Posts: 2350
  • Cookies: 345
  • Aliens do in fact wear hats.
    • View Profile
    • github
Re: Forum Spammer.
« Reply #11 on: August 30, 2012, 05:50:00 am »
I don`t like coding GUI in asm and write network at sokets. It`s possible, but it takes many time. And sokets in win32 has many difference from sokets in *nix.

Using sockets can and will not be compared to ASM. Yes there are libs to hide the details, but will that make you know more about what is going on? All those libs use sockets. But hacking is not about someone doing something for you. Hacking is about knowing how and why shit works. Use sockets to UNDERSTAND what the fuck is going on. Stuff like Curl is great and all, but using it will only let you DO shit, NOT UNDERSTAND it. Skids use Curl for hacking, real mother fuckers use sockets.
>>>import this
-----------------------------

Offline hmm

  • Serf
  • *
  • Posts: 23
  • Cookies: 0
    • View Profile
Re: Forum Spammer.
« Reply #12 on: August 30, 2012, 06:35:17 am »
I take it by your comments I should read some serious literature on sockets?

Offline D4rkC10ud

  • /dev/null
  • *
  • Posts: 12
  • Cookies: -6
    • View Profile
Re: Forum Spammer.
« Reply #13 on: August 30, 2012, 06:51:30 am »
In Soviet Russia TV watch You!

Offline hmm

  • Serf
  • *
  • Posts: 23
  • Cookies: 0
    • View Profile
Re: Forum Spammer.
« Reply #14 on: September 06, 2012, 10:24:00 am »
So i'm a bit confused about how to use a socket. I got how to make one/send data and all that, but how can I execute commands, such as send_keys in selenium? Could it be my lack of web programming knowledge thats inhibiting me? Any help would be greatly appreciated. Note: I think I might try and switch my project into C as well, but I can probably rework a python snippet too. Thanks.



Below are updated versions of my project (note to those who run this forum: If this is not appropriate to do, feel free to remove and shoot me a PM with some guidelines, but I thought a little on-going project updates would be nice). This has also turned into more of a twitter spammer, but, alas, I feel the principles could still be applicable. Also, I would like help on my question above as it would give my project MUCH MUCH more heft.


So, first and acct. creator:
Code: (python) [Select]
from urllib import urlopen
import re
import string
import random
import time
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
lnum=['0', '1', '2', '3','4', '5', '6', '7', '8', '9']
llet=['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']
names=[]
pw= ##pick a password you want to use.
for n in range(0,XXXXXX):  ##pick how many accounts you want to create at in one ... spawn???
    a=random.choice(llet)
    b=random.choice(llet)
    c=random.choice(lnum)
    d=random.choice(lnum)
    e=random.choice(lnum)
    f=random.choice(llet)
    g=random.choice(lnum)
    h=random.choice(llet)
    i=random.choice(llet)
    j=random.choice(llet)
    user = a+b+c+d+e+f+g+h+i+j+'@XXXX.com'
 ##generates random username with  a low probability of being allready taken, also pick whatever mail service you want to hose it on.
    names.append(user)
    print user
    browser= webdriver.Firefox()
    browser.get('http://www.twitter.com')
    elem = browser.find_element_by_name("user[name]")
    elem.send_keys(a+b)
    elem = browser.find_element_by_name("user[email]")
    elem.send_keys(user)
    elem= browser.find_element_by_name("user[user_password]")
    elem.send_keys(pw)
    browser.find_element_by_css_selector(".btn.signup-btn").click()
    time.sleep(2)
    browser.find_element_by_name("user[remember_me_on_signup]").click()
    browser.find_element_by_css_selector(".submit.button.promotional").click()
##the above will launch X firefox window, and, sadly, you have to manually enter the captchas
f=open('tusers.txt', 'a')
for item in names:
    f.write(item + '\n')


##finally writes them to a file for late use



Next is the actual spammer, you need to have a .txt file created with your possible tweets.

Code: (python) [Select]
from urllib import urlopen
import re
import string
import random
import time
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from multiprocessing import Process, Array, Pool


users1=[]
amazon=[]
fly=[]
desc=[]
users2=[]
slogan=['WTF', 'THIS!', 'OMG', 'HAHA', 'YES', 'ITS MY BDAY', 'DRUNKK']
pw=XXXXX ##your password for the acts.
##below is the username file, followed by however many .txt files you need to make it work, i'm using three for my current project.
f = open('tusers.txt', 'r')
for line in f:
    back = line.find('\n')
    line = line[:back]
    users1.append(line)
f.close()
f = open('alinks.txt', 'r')
for item in f:
    if item !='\n':
        amazon.append(item)
f.close()
f = open('flylinks.txt', 'r')
for item in f:
    if item !='\n':
        fly.append(item)
f.close()
f = open('descs.txt', 'r')
for item in f:
    if item !='\n':
        desc.append(item)
##checks xpath is vis.
def check_xpath(xpath,browser):
    try:
        browser.find_element_by_xpath(xpath)
    except NoSuchElementException:
        return False
    return True
def twitter(user):
    browser = webdriver.Firefox()
    browser.get('http://www.twitter.com')
    elem = browser.find_element_by_css_selector(".text-input.email-input")
    elem.send_keys(str(user))
    elem= browser.find_element_by_css_selector(".text-input.flex-table-input")
    elem.send_keys(str(pw))
    browser.find_element_by_css_selector(".submit.btn.primary-btn.flex-table-btn.js-submit").click()
    print user + ' LOGGED IN'
    time.sleep(2)
##below checks suspension
    if check_xpath(".//*[@id='account-suspended']/span[1]", browser) == True:
        print user + ' ' + 'SUSPENDED'
        browser.close()
##if not suspended, find a hashtag, which will be tweeted
    else:
        p1=".//*[@id='page-node-home'][1][5][2]/ul/li["
        p2=str(random.choice(range(2,6)))
        p3="]/a"
        path = p1+p2+p3
        print 'path found'
        if check_xpath(path, browser) == False:
            browser.close()
            return
        elem = browser.find_element_by_xpath(path)
        hashtag=elem.text
## If hashtag non-ascii it will not be used.
        for char in hashtag:
            if ord(char)>128:
                hashtag=''
        while(True):
            try:
                elem = browser.find_element_by_class_name("twitter-anywhere-tweet-box-editor")
                elem.click()
##below tweets hashtag + random crap, use what you will.
                elem.send_keys(str(hashtag) +' ' + random.choice(slogan)+ ' ' + random.choice(fly))
                break
            except NoSuchElementException:
                time.sleep(.1)
        browser.find_element_by_css_selector(".tweet-button.btn.primary-btn").click()
##below searches twitter RSS for a target user you want to reply to.
        term = whatever the fuck you want.
        st = term
        webpage = urlopen('http://search.twitter.com/search.rss?q=' + st).read()
        front = webpage.find('<author>')
        back = webpage.find('@',front)
        person=webpage[front+8:back]
##throws out bad searches
        if 'ersion' in person:
            twit=' '
        else:
            twit = '@'+person
            if len(twit) > 100:
                twit = ''
        elem = browser.find_element_by_class_name("twitter-anywhere-tweet-box-editor")
##below checks shiz in text file, and cuts tweet, feel free to make the cut whereever you need.
        detwee = desc[q][:87].decode('utf-8')
        detwee = detwee.encode('utf-8')
##checks ascii, I could clean this whole section up.
        for char in detwee:
            if ord(char)>128:
                detwee = 'WHOOPS'
##tweets you whiz
        elem.send_keys(str(twit) +' ' + detwee+ ' ' + fly[q])
        browser.find_element_by_css_selector(".tweet-button.btn.primary-btn").click()
        browser.close()


##does it for all accounts in tusers, and keeps on a doin.
counter = 0
while(True):
    for item in users1:
        twitter(item)
        counter +=1
        print 'SENT TWEETS: ', counter
   
Still tweaking stuff, and there is some dumb shit I should clean up. My major problem is lack of threading or multi-processing as it will not work with selenium, so I'd like to recode it using C sockets (if possible) for multiprocessing/threading reasons. Also my C is really rusty, so it'd be nice practice. Also I cut out a large section which involved targeting my @ reply shit which I rather liked, but none of you all would probably want to see.


STAFF EDIT
Twice in the same thread. No double posting, you know how to use the edit button, be sure to use it next time instead of double posting
« Last Edit: September 09, 2012, 08:01:54 pm by skidiot.h »