Commit e44ec54a authored by fxb's avatar fxb

backup - changing currently search engines, "abort if no results"-bug

parent f2a189ce
......@@ -6,6 +6,9 @@ import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import static Core.Utils.ConnectHTTP.HTTPSURLContent;
import static Core.Utils.ConnectHTTP.URLContent;
import SelectModus.Automatik.AutoConfig;
public class Bing extends SearchEngine {
......@@ -17,6 +20,33 @@ public class Bing extends SearchEngine {
These vars you can find in SearchEngine.
search is a method from SearchEngine.
*/
void search(boolean https, String URL, int NR, String keystring, int var, String endstring, AutoConfig.ProxyPerEngine proxy) throws IOException {
StringBuilder HTML = new StringBuilder();
//100 current default (has to become variable, no const), so we search 0,10,20,...,80,90
for(int i=0;i<NR;i=i+10) {
if (https == true) HTML.append(HTTPSURLContent(URL + i, proxy));
if (https == false) HTML.append(URLContent(URL + i, proxy));
}
int pos = 0;
String h = HTML.toString();
HTML = null;
//System.out.println("BEGIN: String h: " + h);
//DEBUG
//Core.Utils.FileOperations.WriteStringToFile(h, "/home/fxb/search_and_destroy/debug-ausgabe.txt");
while(h.indexOf(keystring, pos)>-1) {
int start = h.indexOf(keystring, pos)+keystring.length()-var;
int ende = h.indexOf(endstring, start)-0;
System.out.println("Start: " + start + " End: " + ende);
String result = java.net.URLDecoder.decode(h.substring(start,ende), "UTF-8");
System.out.println("Result: " + result);
RESULT_VECTOR.add(result);
pos=ende;
}
//System.out.println("[DEBUG] URL: " + URL);
HTML = null;
}
public void fetchResults(int NR, String DORK, AutoConfig.ProxyPerEngine proxy) throws IOException, URISyntaxException {
search(false, "http://www.bing.com/search?q=" + DORK + "&first=", NR, "href=\"http",4, "\"", proxy);
}
......
......@@ -6,6 +6,9 @@ import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import static Core.Utils.ConnectHTTP.HTTPSURLContent;
import static Core.Utils.ConnectHTTP.URLContent;
import SelectModus.Automatik.AutoConfig;
public class Google extends SearchEngine {
......@@ -17,6 +20,33 @@ public class Google extends SearchEngine {
These vars you can find in SearchEngine.
search is a method from SearchEngine.
*/
void search(boolean https, String URL, int NR, String keystring, int var, String endstring, AutoConfig.ProxyPerEngine proxy) throws IOException {
StringBuilder HTML = new StringBuilder();
//100 current default (has to become variable, no const), so we search 0,10,20,...,80,90
for(int i=0;i<NR;i=i+10) {
if (https == true) HTML.append(HTTPSURLContent(URL + i, proxy));
if (https == false) HTML.append(URLContent(URL + i, proxy));
}
int pos = 0;
String h = HTML.toString();
HTML = null;
//System.out.println("BEGIN: String h: " + h);
//DEBUG
//Core.Utils.FileOperations.WriteStringToFile(h, "/home/fxb/search_and_destroy/debug-ausgabe.txt");
while(h.indexOf(keystring, pos)>-1) {
int start = h.indexOf(keystring, pos)+keystring.length()-var;
int ende = h.indexOf(endstring, start)-0;
System.out.println("Start: " + start + " End: " + ende);
String result = java.net.URLDecoder.decode(h.substring(start,ende), "UTF-8");
System.out.println("Result: " + result);
RESULT_VECTOR.add(result);
pos=ende;
}
//System.out.println("[DEBUG] URL: " + URL);
HTML = null;
}
public void fetchResults(int NR, String DORK) throws IOException, URISyntaxException {
search(false, "http://www.google.de/search?q=" + DORK + "&hl=us&start=", NR, "href=\"/url?q=http",4, "&amp;", proxy);
}
......
......@@ -6,6 +6,9 @@ import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import static Core.Utils.ConnectHTTP.HTTPSURLContent;
import static Core.Utils.ConnectHTTP.URLContent;
import SelectModus.Automatik.AutoConfig;
public class Ixquick extends SearchEngine {
......@@ -17,6 +20,33 @@ public class Ixquick extends SearchEngine {
These vars you can find in SearchEngine.
search is a method from SearchEngine.
*/
void search(boolean https, String URL, int NR, String keystring, int var, String endstring, AutoConfig.ProxyPerEngine proxy) throws IOException {
StringBuilder HTML = new StringBuilder();
//100 current default (has to become variable, no const), so we search 0,10,20,...,80,90
for(int i=0;i<NR;i=i+10) {
if (https == true) HTML.append(HTTPSURLContent(URL + i, proxy));
if (https == false) HTML.append(URLContent(URL + i, proxy));
}
int pos = 0;
String h = HTML.toString();
HTML = null;
//System.out.println("BEGIN: String h: " + h);
//DEBUG
//Core.Utils.FileOperations.WriteStringToFile(h, "/home/fxb/search_and_destroy/debug-ausgabe.txt");
while(h.indexOf(keystring, pos)>-1) {
int start = h.indexOf(keystring, pos)+keystring.length()-var;
int ende = h.indexOf(endstring, start)-0;
System.out.println("Start: " + start + " End: " + ende);
String result = java.net.URLDecoder.decode(h.substring(start,ende), "UTF-8");
System.out.println("Result: " + result);
RESULT_VECTOR.add(result);
pos=ende;
}
//System.out.println("[DEBUG] URL: " + URL);
HTML = null;
}
public void fetchResults(int NR, String DORK, AutoConfig.ProxyPerEngine proxy) throws IOException, URISyntaxException {
search(true, "https://ixquick.com/do/search?q=" + DORK + "&startat=", NR, "<h3><a href='", 0, "'", proxy);
}
......
......@@ -8,8 +8,6 @@ SingeDork: You only use fetchResults from every subclass and search is used in t
package SearchEngine;
import static Core.Utils.ConnectHTTP.HTTPSURLContent;
import static Core.Utils.ConnectHTTP.URLContent;
import java.io.IOException;
import java.util.Vector;
import SelectModus.Automatik.AutoConfig;
......@@ -72,23 +70,13 @@ public abstract class SearchEngine implements Runnable {
HTML = null;
}*/
void search(boolean https, String URL, int NR, String keystring, int var, String endstring, AutoConfig.ProxyPerEngine proxy) throws IOException {
StringBuilder HTML = new StringBuilder();
for(int i=0;i<NR;i=i+10) {
if (https == true) HTML.append(HTTPSURLContent(URL + i, proxy));
if (https == false) HTML.append(URLContent(URL + i, proxy));
}
int pos = 0;
String h = HTML.toString();
HTML = null;
while(h.indexOf(keystring, pos)>-1) {
int start = h.indexOf(keystring, pos)+keystring.length()-var;
int ende = h.indexOf(endstring, start)-0;
String result = java.net.URLDecoder.decode(h.substring(start,ende), "UTF-8");
RESULT_VECTOR.add(result);
pos=ende;
}
//System.out.println("[DEBUG] URL: " + URL);
HTML = null;
}
/*
*/
}
\ No newline at end of file
package SearchEngine;
import static Core.Utils.ConnectHTTP.HTTPSURLContent;
import static Core.Utils.ConnectHTTP.URLContent;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Vector;
......@@ -18,6 +20,33 @@ public class Startpage extends SearchEngine {
These vars you can find in SearchEngine.
search is a method from SearchEngine.
*/
void search(boolean https, String URL, int NR, String keystring, int var, String endstring, AutoConfig.ProxyPerEngine proxy) throws IOException {
StringBuilder HTML = new StringBuilder();
//100 current default (has to become variable, no const), so we search 0,10,20,...,80,90
for(int i=0;i<NR;i=i+10) {
if (https == true) HTML.append(HTTPSURLContent(URL + i, proxy));
if (https == false) HTML.append(URLContent(URL + i, proxy));
}
int pos = 0;
String h = HTML.toString();
HTML = null;
//System.out.println("BEGIN: String h: " + h);
//DEBUG
//Core.Utils.FileOperations.WriteStringToFile(h, "/home/fxb/search_and_destroy/debug-ausgabe.txt");
while(h.indexOf(keystring, pos)>-1) {
int start = h.indexOf(keystring, pos)+keystring.length()-var;
int ende = h.indexOf(endstring, start)-0;
System.out.println("Start: " + start + " End: " + ende);
String result = java.net.URLDecoder.decode(h.substring(start,ende), "UTF-8");
System.out.println("Result: " + result);
RESULT_VECTOR.add(result);
pos=ende;
}
//System.out.println("[DEBUG] URL: " + URL);
HTML = null;
}
String makeQID() throws IOException {
String qid = null;
String location = "<input type=\"hidden\" name=\"qid\" value=\"";
......
......@@ -21,6 +21,7 @@ public class Attack {
AutoConfig a;
private int numberOfThreads = 0;
private int resultsPerDork = 100;
//ToDo: get this from A!
private Vector<String> dorkVectorBing = new Vector<String>();
private Vector<String> dorkVectorIxquick = new Vector<String>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment