public class Engine { private URL _theurl;
public URLConnection _theconnection;
private String _rootURL; public BufferedReader _in; public Engine(String root) {
_rootURL = root;} public String showRoot() { return _rootURL;}
public void setUrl(String urlstring) throws MalformedURLException, IOException {
_theurl = new URL("http", [pattern host], 80, urlstring);
_theconnection = _theurl.openConnection();
_in = new BufferedReader(new InputStreamReader(_theconnection.getInputStream()));}
public static void main(String args[]) throws MalformedURLException, IOException {
String trialinput = new String();
String trialoutput = new String();
ArrayList[parameterization] goodones = new ArrayList[parameterization]();
FileWriter fw = new FileWriter(new File("ohfives.txt"));
BufferedWriter bw = new BufferedWriter(fw);
NumberFormat nf = NumberFormat.getInstance();
nf.setMinimumIntegerDigits(5);
nf.setGroupingUsed(false);
Engine sweep = new Engine([website pattern string]);
long starttime = System.currentTimeMillis();
for (int i=0; i<100000; i++) {
trialinput = sweep.showRoot().replaceAll("pattern", nf.format(i));
sweep.setUrl(trialinput);
trialoutput = sweep._theconnection.getContentType();
if (trialoutput.equalsIgnoreCase("video/mpeg")) {
goodones.add(i); } }
long endtime = System.currentTimeMillis();
Iterator[parameterization] it = goodones.iterator();
int curs = 0; while (it.hasNext()) {
String temp = nf.format(it.next());
bw.write(temp); System.out.print(temp + "\t");
if (++curs % 25 == 0) {
System.out.println(); } bw.newLine(); } bw.flush();
System.out.println("\nScan complete ("+goodones.size()+") in " + ((endtime - starttime)/1000) + " seconds."); }}
Monday, December 31, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment