Commit 09f6fbd7 authored by fxb's avatar fxb

updated the xml structure and some bugs with it. installer now actually

works.
parent 84dbb253
......@@ -6,22 +6,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
......
......@@ -4,22 +4,39 @@ public class AutoConfig {
boolean Bing;
int BingThreads;
String BingDorks;
String BingInResults;
String BingOutResults;
//String BingInResults;
//String BingOutResults;
boolean Startpage;
int StartpageThreads;
String StartpageDorks;
String StartpageInResults;
String StartpageOutResults;
//String StartpageInResults;
//String StartpageOutResults;
boolean Ixquick;
int IxquickThreads;
String IxquickDorks;
String IxquickInResults;
String IxquickOutResults;
//String IxquickInResults;
//String IxquickOutResults;
String output;
String inFile;
public String getInFile() {
return inFile;
}
public void setInFile(String inFile) {
this.inFile = inFile;
}
public String getOutFile() {
return outFile;
}
public void setOutFile(String outFile) {
this.outFile = outFile;
}
String outFile;
/**
public String getBingInResults() {
return BingInResults;
......@@ -57,6 +74,9 @@ public class AutoConfig {
public void setIxquickOutResults(String ixquickOutResults) {
IxquickOutResults = ixquickOutResults;
}
**/
public boolean isBing() {
return Bing;
}
......@@ -122,19 +142,21 @@ public class AutoConfig {
sb.append("\n[ " + "Bing" + " | " + Bing + " ]\n");
sb.append("[ " + "BingDorks" + " | " + BingDorks + " ]\n");
sb.append("[ " + "BingThreads" + " | " + BingThreads + " ]\n");
sb.append("[ " + "Bing-InResults" + " | " + BingInResults + "]\n");
sb.append("[ " + "Bing-OutResults" + " | " + BingOutResults + "]\n");
//sb.append("[ " + "Bing-InResults" + " | " + BingInResults + "]\n");
//sb.append("[ " + "Bing-OutResults" + " | " + BingOutResults + "]\n");
sb.append("\n[ " + "Ixquick" + " | " + Ixquick + " ]\n");
sb.append("[ " + "IxquickDorks" + " | " + IxquickDorks + " ]\n");
sb.append("[ " + "IxquickThreads" + " | " + IxquickThreads + " ]\n");
sb.append("[ " + "Ixquick-InResults" + " | " + IxquickInResults + "]\n");
sb.append("[ " + "Ixquick-OutResults" + " | " + IxquickOutResults + "]\n");
//sb.append("[ " + "Ixquick-InResults" + " | " + IxquickInResults + "]\n");
//sb.append("[ " + "Ixquick-OutResults" + " | " + IxquickOutResults + "]\n");
sb.append("\n[ " + "Startpage" + " | " + Startpage + " ]\n");
sb.append("[ " + "StartpageDorks" + " | " + StartpageDorks + " ]\n");
sb.append("[ " + "StartpageThreads" + " | " + StartpageThreads + " ]\n");
sb.append("[ " + "Startpage-InResults" + " | " + StartpageInResults + "]\n");
sb.append("[ " + "Startpage-OutResults" + " | " + StartpageOutResults + "]\n");
//sb.append("[ " + "Startpage-InResults" + " | " + StartpageInResults + "]\n");
//sb.append("[ " + "Startpage-OutResults" + " | " + StartpageOutResults + "]\n");
sb.append("\n[ " + "output" + " | " + output + " ]");
sb.append("\n[ " + "inFile" + " | " + inFile + " ]");
sb.append("\n[ " + "outFile" + " | " + outFile + " ]");
return sb.toString();
}
}
......@@ -10,6 +10,8 @@ import static Core.Utils.StringEngine.readIn;
import static SelectModus.Automatik.XML_Library.installAutomatic;
import static SelectModus.Automatik.XML_Library.installEmpty;
import static Core.Utils.FileOperations.checkIfFileExists;
import java.io.File;
import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
......@@ -19,9 +21,11 @@ import org.xml.sax.SAXException;
public class Install {
public static String DIR_OF_INSTALLATION = System.getProperty("user.home") + System.getProperty("file.separator") + "search_and_destroy";
public static String INSTALLATIONFILE = DIR_OF_INSTALLATION + System.getProperty("file.separator") + "search_and_destroy.xml";
public static AutoConfig runAssistant() {
new File(DIR_OF_INSTALLATION).mkdirs();
AutoConfig A = new AutoConfig();
boolean chosen = false;
String choice;
......@@ -31,23 +35,23 @@ public class Install {
System.out.print("Do you want to enable Bing? (YES/NO) ");
choice = readIn();
if(choice.equalsIgnoreCase("yes")) {
System.out.println("Bing was enabled - Now enter the Path to your dorklist.");
System.out.println("Bing was enabled - Now enter your dorklist file:");
System.out.println("Our current directory is " + System.getProperty("user.home") + System.getProperty("file.separator") + "search_and_destroy");
A.setBingDorks(readIn());
A.setBing(true);
System.out.print("Enter the count of Threads for Bing: ");
A.setBingThreads(Integer.parseInt(readIn()));
System.out.print("Enter the file containing keywords that must be in every result: ");
A.setBingInResults(readIn());
System.out.print("Enter the file containing keywords that are forbidden in every result: ");
A.setBingOutResults(readIn());
// System.out.print("Enter the file containing keywords that must be in every result: ");
// A.setBingInResults(readIn());
// System.out.print("Enter the file containing keywords that are forbidden in every result: ");
// A.setBingOutResults(readIn());
chosen = true;
} else if (choice.equalsIgnoreCase("no")) {
A.setBing(false);
A.setBingThreads(0);
A.setBingDorks(null);
A.setBingInResults(null);
A.setBingOutResults(null);
// A.setBingInResults(null);
// A.setBingOutResults(null);
chosen = true;
} else {
System.out.print("Couldn't get your choice.. ");
......@@ -58,23 +62,23 @@ public class Install {
System.out.print("Do you want to enable Ixquick? (YES/NO) ");
choice = readIn();
if(choice.equalsIgnoreCase("yes")) {
System.out.println("Ixquick was enabled - Now enter the Path to your dorklist.");
System.out.println("Ixquick was enabled - Now enter your dorklist file:");
System.out.println("Our current directory is " + System.getProperty("user.home") + System.getProperty("file.separator") + "search_and_destroy");
A.setIxquickDorks(readIn());
A.setIxquick(true);
System.out.print("Enter the count of Threads for Ixquick: ");
A.setIxquickThreads(Integer.parseInt(readIn()));
System.out.print("Enter the file containing keywords that must be in every result: ");
A.setIxquickInResults(readIn());
System.out.print("Enter the file containing keywords that are forbidden in every result: ");
A.setIxquickOutResults(readIn());
// System.out.print("Enter the file containing keywords that must be in every result: ");
// A.setIxquickInResults(readIn());
// System.out.print("Enter the file containing keywords that are forbidden in every result: ");
// A.setIxquickOutResults(readIn());
chosen = true;
} else if (choice.equalsIgnoreCase("no")) {
A.setIxquick(false);
A.setIxquickThreads(0);
A.setIxquickDorks(null);
A.setIxquickInResults(null);
A.setIxquickOutResults(null);
// A.setIxquickInResults(null);
// A.setIxquickOutResults(null);
chosen = true;
} else {
System.out.print("Couldn't get your choice.. ");
......@@ -85,23 +89,23 @@ public class Install {
System.out.print("Do you want to enable Startpage? (YES/NO) ");
choice = readIn();
if(choice.equalsIgnoreCase("yes")) {
System.out.println("Startpage was enabled - Now enter the Path to your dorklist.");
System.out.println("Startpage was enabled - Now enter your dorklist file:");
System.out.print("Our current directory is " + System.getProperty("user.home") + System.getProperty("file.separator") + "search_and_destroy: ");
A.setStartpageDorks(readIn());
A.setStartpage(true);
System.out.print("Enter the count of Threads for Startpage: ");
A.setStartpageThreads(Integer.parseInt(readIn()));
System.out.print("Enter the file containing keywords that must be in every result: ");
A.setStartpageInResults(readIn());
System.out.print("Enter the file containing keywords that are forbidden in every result: ");
A.setStartpageOutResults(readIn());
// System.out.print("Enter the file containing keywords that must be in every result: ");
// A.setStartpageInResults(readIn());
// System.out.print("Enter the file containing keywords that are forbidden in every result: ");
// A.setStartpageOutResults(readIn());
chosen = true;
} else if (choice.equalsIgnoreCase("no")) {
A.setStartpage(false);
A.setStartpageThreads(0);
A.setStartpageDorks(null);
A.setStartpageInResults(null);
A.setStartpageOutResults(null);
// A.setStartpageInResults(null);
// A.setStartpageOutResults(null);
chosen = true;
} else {
System.out.print("Couldn't get your choice.. ");
......@@ -109,6 +113,10 @@ public class Install {
}
System.out.print("Now enter the location of the output of your result file: ");
A.setOutput(readIn());
System.out.print("Now enter the inFile: ");
A.setInFile(readIn());
System.out.print("Now enter the outFile: ");
A.setOutFile(readIn());
return A;
}
......@@ -145,6 +153,8 @@ public class Install {
}
System.out.println("File was written to:");
System.out.println(INSTALLATIONFILE);
System.out.println();
System.out.println(A.toString());
}
}
}
\ No newline at end of file
......@@ -34,8 +34,8 @@ public class XML_Library {
if(eElement.getElementsByTagName("Bing").item(0).getTextContent().equalsIgnoreCase("1")) {
A.setBing(true);
A.setBingDorks(eElement.getElementsByTagName("Bing").item(0).getAttributes().item(0).getNodeValue());
A.setBingInResults(eElement.getElementsByTagName("Bing").item(0).getAttributes().item(1).getNodeValue());
A.setBingOutResults(eElement.getElementsByTagName("Bing").item(0).getAttributes().item(2).getNodeValue());
//A.setBingInResults(eElement.getElementsByTagName("Bing").item(0).getAttributes().item(1).getNodeValue());
//A.setBingOutResults(eElement.getElementsByTagName("Bing").item(0).getAttributes().item(2).getNodeValue());
A.setBingThreads(Integer.parseInt(eElement.getElementsByTagName("Bing").item(0).getAttributes().item(3).getNodeValue()));
} else {
A.setBing(false);
......@@ -44,8 +44,8 @@ public class XML_Library {
if(eElement.getElementsByTagName("Ixquick").item(0).getTextContent().equalsIgnoreCase("1")) {
A.setIxquick(true);
A.setIxquickDorks(eElement.getElementsByTagName("Ixquick").item(0).getAttributes().item(0).getNodeValue());
A.setIxquickInResults(eElement.getElementsByTagName("Ixquick").item(0).getAttributes().item(1).getNodeValue());
A.setIxquickOutResults(eElement.getElementsByTagName("Ixquick").item(0).getAttributes().item(2).getNodeValue());
//A.setIxquickInResults(eElement.getElementsByTagName("Ixquick").item(0).getAttributes().item(1).getNodeValue());
//A.setIxquickOutResults(eElement.getElementsByTagName("Ixquick").item(0).getAttributes().item(2).getNodeValue());
A.setIxquickThreads(Integer.parseInt(eElement.getElementsByTagName("Ixquick").item(0).getAttributes().item(3).getNodeValue()));
} else {
A.setIxquick(false);
......@@ -54,8 +54,8 @@ public class XML_Library {
if(eElement.getElementsByTagName("Startpage").item(0).getTextContent().equalsIgnoreCase("1")) {
A.setStartpage(true);
A.setStartpageDorks(eElement.getElementsByTagName("Startpage").item(0).getAttributes().item(0).getNodeValue());
A.setStartpageInResults(eElement.getElementsByTagName("Startpage").item(0).getAttributes().item(1).getNodeValue());
A.setStartpageOutResults(eElement.getElementsByTagName("Startpage").item(0).getAttributes().item(2).getNodeValue());
//A.setStartpageInResults(eElement.getElementsByTagName("Startpage").item(0).getAttributes().item(1).getNodeValue());
//A.setStartpageOutResults(eElement.getElementsByTagName("Startpage").item(0).getAttributes().item(2).getNodeValue());
A.setStartpageThreads(Integer.parseInt(eElement.getElementsByTagName("Startpage").item(0).getAttributes().item(3).getNodeValue()));
} else {
A.setStartpage(false);
......@@ -63,6 +63,8 @@ public class XML_Library {
}
A.setOutput(eElement.getElementsByTagName("output").item(0).getTextContent());
A.setInFile(eElement.getElementsByTagName("inFile").item(0).getTextContent());
A.setOutFile(eElement.getElementsByTagName("outFile").item(0).getTextContent());
}
}
return A;
......@@ -117,8 +119,8 @@ public class XML_Library {
if(A.isBing() == false) bing.appendChild(doc.createTextNode("0"));
bing.setAttribute("file", A.getBingDorks());
bing.setAttribute("threads", String.valueOf(A.getBingThreads()));
bing.setAttribute("resultsIn", A.getBingInResults());
bing.setAttribute("resultsOut", A.getBingOutResults());
//bing.setAttribute("resultsIn", A.getBingInResults());
//bing.setAttribute("resultsOut", A.getBingOutResults());
profile.appendChild(bing);
Element ixquick = doc.createElement("Ixquick");
......@@ -126,8 +128,8 @@ public class XML_Library {
if(A.isIxquick() == false) ixquick.appendChild(doc.createTextNode("0"));
ixquick.setAttribute("file", A.getIxquickDorks());
ixquick.setAttribute("threads", String.valueOf(A.getIxquickThreads()));
ixquick.setAttribute("resultsIn", A.getIxquickInResults());
ixquick.setAttribute("resultsOut", A.getIxquickOutResults());
//ixquick.setAttribute("resultsIn", A.getIxquickInResults());
//ixquick.setAttribute("resultsOut", A.getIxquickOutResults());
profile.appendChild(ixquick);
Element startpage = doc.createElement("Startpage");
......@@ -135,13 +137,21 @@ public class XML_Library {
if(A.isStartpage() == false) startpage.appendChild(doc.createTextNode("0"));
startpage.setAttribute("file", A.getStartpageDorks());
startpage.setAttribute("threads", String.valueOf(A.getStartpageThreads()));
startpage.setAttribute("resultsIn", A.getStartpageInResults());
startpage.setAttribute("resultsOut", A.getStartpageOutResults());
//startpage.setAttribute("resultsIn", A.getStartpageInResults());
//startpage.setAttribute("resultsOut", A.getStartpageOutResults());
profile.appendChild(startpage);
Element output = doc.createElement("output");
output.appendChild(doc.createTextNode(A.getOutput()));
profile.appendChild(output);
Element inFile = doc.createElement("inFile");
inFile.appendChild(doc.createTextNode(A.getInFile()));
profile.appendChild(inFile);
Element outFile = doc.createElement("outFile");
outFile.appendChild(doc.createTextNode(A.getOutFile()));
profile.appendChild(outFile);
/*
Element threads = doc.createElement("Threads");
threads.appendChild(doc.createTextNode(String.valueOf(A.getThreads())));
......
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