Jump to content

Featured Replies

Posted

A class for those of you who which to write programs for automating (ie spamming aha) the use of phpbb forums

 

import java.net.Socket;
import java.net.UnknownHostException;
import java.net.URLEncoder;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

public class Phpbb
{

String hostname = null;
String path = null;
String cookie = "";
String headers = "";
String newcookie = "";
Socket s = null;

DataInputStream in = null;
DataOutputStream out = null;

public Phpbb(String h, String p)
{
	hostname = h;
	path = p;    
}     

public void logon(String uname, String pword)
{
	
	cookie = "";
	
	String post = "username="+uname+"&password="+pword+"&autologin=on&login=Log+in";
	int length = post.length();
	
	        headers = "POST "+path+"login.php HTTP/1.1\r\n"
	  	             +"HOST: "+hostname+"\r\n" 
	  	             +"User-Agent: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.10) Gecko/20050717 Firefox/1.0.6\r\n"
	  	             +"Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n"
	  	             +"Accept-Language: en-gb,en;q=0.5\r\n"
	  	             +"Accept-Encoding: gzip,deflate\r\n"
	  	             +"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n"
	  	             +"Keep-Alive: 300\r\n"
	  	             +"Connection: keep-alive\r\n"
	  	             +"Referer: http://"+hostname+path+"\r\n"
	  	             +"Cookie: "+cookie+"\r\n"
	  	             +"Content-Type: application/x-www-form-urlencoded\r\n"
	  	             +"Content-Length: "+length+"\r\n\n"
	  	             +post+"\r\n";
	  	             
	       getPage();
	
}
	
public void newTopic(String subject, String message, int forum)
{
	
	
	String post = "subject="+ URLEncoder.encode(subject)+"&addbbcode18=%23444444&addbbcode20=12&helpbox=Font+size%3A+%5Bsize%3Dx-small%5Dsmall+text%5B%2Fsize%5D&message="+URLEncoder.encode(message)+"&poll_title=&add_poll_option_text=&poll_length=&mode=newtopic&f="+forum+"&post=Submit";
	int length = post.length();
	
		    headers = "POST "+path+"posting.php HTTP/1.1\r\n"
	  	             +"HOST: "+hostname+"\r\n" 
	  	             +"User-Agent: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.10) Gecko/20050717 Firefox/1.0.6\r\n"
	  	             +"Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n"
	  	             +"Accept-Language: en-gb,en;q=0.5\r\n"
	  	             +"Accept-Encoding: gzip,deflate\r\n"
	  	             +"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n"
	  	             +"Keep-Alive: 300\r\n"
	  	             +"Connection: keep-alive\r\n"
	  	             +"Referer: http://"+hostname+path+"posting.php?mode=newtopic&f="+forum+"\r\n"
	  	             +"Cookie: "+cookie+"\r\n"
	  	             +"Content-Type: application/x-www-form-urlencoded\r\n"
	  	             +"Content-Length: "+length+"\r\n\n"
	  	             +post+"\r\n";
	  	             
	      getPage();	
	
}	

public void reply(int topic, String message)
{
		
	
	String post = "subject=&addbbcode18=%23444444&addbbcode20=12&helpbox=Tip%3A+Styles+can+be+applied+quickly+to+selected+text.&message="+URLEncoder.encode(message)+"&mode=reply&t=5&post=Submit";
	int length = post.length();
	
		    headers = "POST "+path+"posting.php HTTP/1.1\r\n"
	  	             +"HOST: "+hostname+"\r\n" 
	  	             +"User-Agent: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.10) Gecko/20050717 Firefox/1.0.6\r\n"
	  	             +"Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n"
	  	             +"Accept-Language: en-gb,en;q=0.5\r\n"
	  	             +"Accept-Encoding: gzip,deflate\r\n"
	  	             +"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n"
	  	             +"Keep-Alive: 300\r\n"
	  	             +"Connection: keep-alive\r\n"
	  	             +"Referer: http://"+hostname+path+"posting.php?mode=reply&t="+topic+"\r\n"
	  	             +"Cookie: "+cookie+"\r\n"
	  	             +"Content-Type: application/x-www-form-urlencoded\r\n"
	  	             +"Content-Length: "+length+"\r\n\n"
	  	             +post+"\r\n";
	  	             
	      getPage();	
	
}
	
public void vote(int topic, int option)
{
	String post = "vote_id="+option+"&submit=Submit+Vote&topic_id="+topic+"&mode=vote";
	int length = post.length();
	
		    headers = "POST "+path+"posting.php?mode=vote&t="+topic+" HTTP/1.1\r\n"
	  	             +"HOST: "+hostname+"\r\n" 
	  	             +"User-Agent: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.10) Gecko/20050717 Firefox/1.0.6\r\n"
	  	             +"Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n"
	  	             +"Accept-Language: en-gb,en;q=0.5\r\n"
	  	             +"Accept-Encoding: gzip,deflate\r\n"
	  	             +"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n"
	  	             +"Keep-Alive: 300\r\n"
	  	             +"Connection: keep-alive\r\n"
	  	             +"Referer: http://"+hostname+path+"\r\n"
	  	             +"Cookie: "+cookie+"\r\n"
	  	             +"Content-Type: application/x-www-form-urlencoded\r\n"
	  	             +"Content-Length: "+length+"\r\n\n"
	  	             +post+"\r\n";
	  	             
	      getPage();	
	 
	
}	  

public void register(String uname, String pword, String email)
{
	String post = "username="+URLEncoder.encode(uname)+"&email="+URLEncoder.encode(email)+"&new_password="+URLEncoder.encode(pword)+"&password_confirm="+URLEncoder.encode(pword)+"&icq=&aim=N%2FA&msn=&yim=&website=&location=&occupation=&interests=&signature=&viewemail=0&hideonline=1&notifyreply=0&notifypm=1&popup_pm=1&attachsig=1&allowbbcode=1&allowhtml=0&allowsmilies=1&language=english&style=1&timezone=0&dateformat=D+M+d%2C+Y+g%3Ai+a&mode=register&agreed=true&coppa=0&submit=Submit";
	int length = post.length();
	
		    headers = "POST "+path+"profile.php HTTP/1.1\r\n"
	  	             +"HOST: "+hostname+"\r\n" 
	  	             +"User-Agent: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.10) Gecko/20050717 Firefox/1.0.6\r\n"
	  	             +"Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n"
	  	             +"Accept-Language: en-gb,en;q=0.5\r\n"
	  	             +"Accept-Encoding: gzip,deflate\r\n"
	  	             +"Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n"
	  	             +"Keep-Alive: 300\r\n"
	  	             +"Connection: keep-alive\r\n"
	  	             +"Referer: http://"+hostname+path+"\r\n"
	  	             +"Content-Type: application/x-www-form-urlencoded\r\n"
	  	             +"Content-Length: "+length+"\r\n\n"
	  	             +post+"\r\n";
	  	             
	      getPage();	
	
}		  	
	
public void getPage()
{
try
	{

	  s = new Socket(hostname, 80);
	  in = new DataInputStream(s.getInputStream());
	  out = new DataOutputStream(s.getOutputStream());
	  
      out.writeBytes(headers);
	 
         	  	             
	  String response = "";
         while ((response = in.readLine()) != null)
          {
            
            if (response.indexOf("Set-Cookie") != -1)
            {
               String[] sep = response.split("[;:\\s]");
               newcookie = newcookie + sep[2] + "; ";
            }
            
                   
            if (response.indexOf("</html>")!=-1)
            {break;} 	
            if (response.indexOf("Location")!=-1)
            {
               break;
            }
			             
	  } 
	  in.close();
	  out.close();
	  s.close();
	  cookie = newcookie;
	  newcookie = "";
	  }
	   				
       catch(UnknownHostException e) 
	{
	  System.out.println("Could not connect to host (UnknownHostException)");
	}
	catch(IOException e)
	{
	  System.out.println("IO error in connection to:" + hostname);
	}
	
		
}
}

 

 

Example usage:

 

import java.util.Random;

public class Interface
{

public Interface()
{
	 Random generator = new Random();

    String[] titles = {"LOL SPAM", "LOLS", "RIFKCAKE", "WELLSPAMMED"};


Phpbb forum = new Phpbb("test.briggsy.org", "/forum/");

	

for(int i = 1; i<600;i++)
{
	forum.register("test"+i,"123456","test"+i+"@hotmail.com");
//of course it will spam much faster if the users are already registered
	forum.logon("test"+i,"123456");
	forum.newTopic(titles[generator.nextInt(4)],"your favorite spam",1);
	System.out.print(".");
}

System.out.println("\nall done!");
	
System.exit(0);
}	


public static void main(String[] args)
{
	Interface durkha = new Interface();
}
}

 

My best results so far have been approx 60topic/min but i dont think i by any means pushed it to the limit. (the cookie is being parsed every time getPage() is called, but really it only needs to be parsed when logging on)

 

anyways have fun, and post your results if you get anything good :p

  StupidFgt said:
I DONT EVEN KNOW WHTF A CLASS IS U IDIOT

 

+B Troll

 

anywho, Greeneyes, my sekcsy irish motherfucker

 

VB verson kthnx?

 

<3

nice post, i was thinking of making somthing like this myself but just never got round to it, saved me the trouble
  • Author
  t3rm1ght said:
+B Troll

 

anywho, Greeneyes, my sekcsy irish motherfucker

 

VB verson kthnx?

 

<3

 

<3

 

 

Also as it happens, the register() method when used repeatedly is a relativly effective dos tool

  t3rm1ght said:

VB verson kthnx?

 

<3

Not hard to do, use the inet control. It will be a good excercise for you.

Guest
This topic is now closed to further replies.