Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/com/sittinglittleduck/DirBuster/BaseCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class BaseCase
//The URL for which the base applies to, eg if we are testing within /wibble/, then this will be set to /wibble/
private URL baseCaseURL;

//http responce code for the base case
//http response code for the base case
private int returnCode = 0;

//store of the actual base case if required
Expand Down
18 changes: 9 additions & 9 deletions src/com/sittinglittleduck/DirBuster/CheckForUpdates.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ public void run()
* query the site to find out is there any updates
*/
GetMethod httpget = new GetMethod(updateURL);
int responceCode = httpclient.executeMethod(httpget);
int responseCode = httpclient.executeMethod(httpget);

if(responceCode == 200)
if(responseCode == 200)
{
if(httpget.getResponseContentLength() > 0)
{
Expand All @@ -88,29 +88,29 @@ public void run()

String line;

String responce = "";
String response = "";

StringBuffer buf = new StringBuffer();
while((line = input.readLine()) != null)
{
buf.append("\r\n" + line);
}
responce = buf.toString();
response = buf.toString();
input.close();

//System.out.println("Got a responce form the update server");
//System.out.println("Got a response form the update server");
//System.out.println("-------------------------------------");
//System.out.println(responce);
//System.out.println(response);
//System.out.println("-------------------------------------");
/*
* extract the data from the responce
* extract the data from the response
*/
String versionRegex = "<version current=\\\"(.*?)\\\"/>";
String changeLogRegex = "<changelog>(.*?)</changelog>";

Pattern regexFindFile = Pattern.compile(versionRegex);

Matcher m = regexFindFile.matcher(responce);
Matcher m = regexFindFile.matcher(response);

if(m.find())
{
Expand All @@ -134,7 +134,7 @@ public void run()
*/
Pattern regexFindChangeLog = Pattern.compile(changeLogRegex, Pattern.DOTALL);

m = regexFindChangeLog.matcher(responce);
m = regexFindChangeLog.matcher(response);

if(m.find())
{
Expand Down
6 changes: 3 additions & 3 deletions src/com/sittinglittleduck/DirBuster/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public class Config
* Fixed bug in advanced options, which caused proxy setting to always get set
* Add an option to limit the number of requests/sec
* Improved the way results table works
* Fixed a bug that caused responce to be displayed incorrectly
* Fixed a bug that caused response to be displayed incorrectly
* Fixed bug that selection from the tables to now work correctly
* Fixed bug that caused blank extentions to stop working at all!
*
Expand Down Expand Up @@ -143,7 +143,7 @@ public class Config
*
*0.9.6
*+ Dirbuster can now do file scanning with no extention.
*+ View responce now shows information about errors as well
*+ View response now shows information about errors as well
*+ Removed all other imported source code, they will no be done via their own api's
*
*0.9.5
Expand All @@ -164,7 +164,7 @@ public class Config
*0.9.2
*+ Corrected content checking mode when a 200 is returned for the 404 test, so it now works
*+ minor changes to the interface
*+ now shows diff of basecase vs responce
*+ now shows diff of basecase vs response
*/
/**
* Date the version was completed
Expand Down
26 changes: 13 additions & 13 deletions src/com/sittinglittleduck/DirBuster/FilterResponce.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* FilterResponce.java
* FilterResponse.java
*
* Created on 01 December 2005, 22:10
*
Expand All @@ -26,44 +26,44 @@


/**
* Util class to normliaze http responces
* Util class to normliaze http responses
*/
public class FilterResponce
public class FilterResponse
{

/**
* Creates a new instance of FilterResponce
* Creates a new instance of FilterResponse
*/
public FilterResponce()
public FilterResponse()
{

}

/**
* Clean the responce of a work unit
* Clean the response of a work unit
* @param toclean String to clean
* @param work Unit of work the toclean string refferes to
* @return Cleaned responce
* @return Cleaned response
*/
public static String CleanResponce(String toclean, WorkUnit work)
public static String CleanResponse(String toclean, WorkUnit work)
{
return CleanResponce(toclean, work.getWork(), work.getItemToCheck());
return CleanResponse(toclean, work.getWork(), work.getItemToCheck());
}

/**
* Clean the responce of a work based on a URL
* Clean the response of a work based on a URL
* @param toclean String to clean
* @param url URL that generated the reponce that is to be cleaned
* @return String of cleaned responce
* @return String of cleaned response
*/
public static String CleanResponce(String toclean, URL url, String itemChecked)
public static String CleanResponse(String toclean, URL url, String itemChecked)
{

if(toclean != null)
{
if(!toclean.equals(""))
{
//remove the firstline from the responce
//remove the firstline from the response
//firstline = toclean.

//remove date header
Expand Down
66 changes: 33 additions & 33 deletions src/com/sittinglittleduck/DirBuster/GenBaseCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static synchronized BaseCase genBaseCase(String url, boolean isDir, Strin
BaseCase baseCase = null;
int failcode = 0;
String failString = Config.failCaseString;
String baseResponce = "";
String baseResponse = "";
URL failurl = null;
if(isDir)
{
Expand Down Expand Up @@ -144,7 +144,7 @@ public static synchronized BaseCase genBaseCase(String url, boolean isDir, Strin
}
httpget.setFollowRedirects(Config.followRedirects);

//save the http responce code for the base case
//save the http response code for the base case
failcode = manager.getHttpclient().executeMethod(httpget);
manager.workDone();

Expand All @@ -163,35 +163,35 @@ public static synchronized BaseCase genBaseCase(String url, boolean isDir, Strin
{
buf.append("\r\n" + tempLine);
}
baseResponce = buf.toString();
baseResponse = buf.toString();
input.close();

//HTMLparse.parseHTML();

//HTMLparse htmlParse = new HTMLparse(baseResponce, null);
//HTMLparse htmlParse = new HTMLparse(baseResponse, null);
//Thread parse = new Thread(htmlParse);
//parse.start();

//clean up the base case, based on the basecase URL
baseResponce = FilterResponce.CleanResponce(baseResponce, failurl, failString);
baseResponse = FilterResponse.CleanResponse(baseResponse, failurl, failString);

httpget.releaseConnection();

/*
* get the base case twice more, for consisitency checking
*/
String baseResponce1 = baseResponce;
String baseResponce2 = getBaseCaseAgain(failurl, failString);
String baseResponce3 = getBaseCaseAgain(failurl, failString);
String baseResponse1 = baseResponse;
String baseResponse2 = getBaseCaseAgain(failurl, failString);
String baseResponse3 = getBaseCaseAgain(failurl, failString);


if(baseResponce1 != null && baseResponce2 != null && baseResponce3 != null)
if(baseResponse1 != null && baseResponse2 != null && baseResponse3 != null)
{
/*
* check that all the responces are same, if they are do nothing if not enter the if statement
* check that all the responses are same, if they are do nothing if not enter the if statement
*/

if(!baseResponce1.equalsIgnoreCase(baseResponce2) || !baseResponce1.equalsIgnoreCase(baseResponce3) || !baseResponce2.equalsIgnoreCase(baseResponce3))
if(!baseResponse1.equalsIgnoreCase(baseResponse2) || !baseResponse1.equalsIgnoreCase(baseResponse3) || !baseResponse2.equalsIgnoreCase(baseResponse3))
{
/*
* if we dont have any regex saved
Expand All @@ -211,7 +211,7 @@ public static synchronized BaseCase genBaseCase(String url, boolean isDir, Strin
/*
* show diaglog with the three responses, asking the user for a reg instead
*/
JDialogInconsistentFailCodes dialog = new JDialogInconsistentFailCodes(manager.gui, true, baseResponce1, baseResponce2, baseResponce3, failurl.toString());
JDialogInconsistentFailCodes dialog = new JDialogInconsistentFailCodes(manager.gui, true, baseResponse1, baseResponse2, baseResponse3, failurl.toString());
/*
* get the returned regex
*/
Expand Down Expand Up @@ -245,9 +245,9 @@ public static synchronized BaseCase genBaseCase(String url, boolean isDir, Strin

Pattern regexFindFile = Pattern.compile(failCaseRegexes.elementAt(a));

Matcher m1 = regexFindFile.matcher(baseResponce1);
Matcher m2 = regexFindFile.matcher(baseResponce2);
Matcher m3 = regexFindFile.matcher(baseResponce3);
Matcher m1 = regexFindFile.matcher(baseResponse1);
Matcher m2 = regexFindFile.matcher(baseResponse2);
Matcher m3 = regexFindFile.matcher(baseResponse3);

boolean test1 = m1.find();
boolean test2 = m2.find();
Expand Down Expand Up @@ -279,7 +279,7 @@ public static synchronized BaseCase genBaseCase(String url, boolean isDir, Strin
* if we get here then we didn't get a match so show the dialog
*/

JDialogInconsistentFailCodes dialog = new JDialogInconsistentFailCodes(manager.gui, true, baseResponce1, baseResponce2, baseResponce3, failurl.toString());
JDialogInconsistentFailCodes dialog = new JDialogInconsistentFailCodes(manager.gui, true, baseResponse1, baseResponse2, baseResponse3, failurl.toString());
/*
* get the returned regex
*/
Expand All @@ -301,21 +301,21 @@ public static synchronized BaseCase genBaseCase(String url, boolean isDir, Strin
else
{
/*
* We have a big problem as now we have different responce codes for the same request
* We have a big problem as now we have different response codes for the same request
* //TODO think of a way to deal with is
*/
}


if(Config.debug)
{
System.out.println("DEBUG GenBaseCase: base case was set to :" + baseResponce);
System.out.println("DEBUG GenBaseCase: base case was set to :" + baseResponse);
}
}
}
httpget.releaseConnection();

baseCase = new BaseCase(new URL(url), failcode, isDir, failurl, baseResponce, fileExtention, useRegexInstead, regex);
baseCase = new BaseCase(new URL(url), failcode, isDir, failurl, baseResponse, fileExtention, useRegexInstead, regex);

//add the new base case to the manager list
manager.addBaseCase(baseCase);
Expand All @@ -333,7 +333,7 @@ public static BaseCase genURLFuzzBaseCase(String fuzzStart, String FuzzEnd) thro
BaseCase baseCase = null;
int failcode = 0;
String failString = Config.failCaseString;
String baseResponce = "";
String baseResponse = "";

/*
* markers for using regex instead
Expand Down Expand Up @@ -364,7 +364,7 @@ public static BaseCase genURLFuzzBaseCase(String fuzzStart, String FuzzEnd) thro
}
httpget.setFollowRedirects(Config.followRedirects);

//save the http responce code for the base case
//save the http response code for the base case
failcode = manager.getHttpclient().executeMethod(httpget);
manager.workDone();

Expand All @@ -382,16 +382,16 @@ public static BaseCase genURLFuzzBaseCase(String fuzzStart, String FuzzEnd) thro
{
buf.append("\r\n" + tempLine);
}
baseResponce = buf.toString();
baseResponse = buf.toString();
input.close();


//clean up the base case, based on the basecase URL
baseResponce = FilterResponce.CleanResponce(baseResponce, failurl, failString);
baseResponse = FilterResponse.CleanResponse(baseResponse, failurl, failString);

if(Config.debug)
{
System.out.println("DEBUG GenBaseCase: base case was set to :" + baseResponce);
System.out.println("DEBUG GenBaseCase: base case was set to :" + baseResponse);
}
}

Expand All @@ -400,7 +400,7 @@ public static BaseCase genURLFuzzBaseCase(String fuzzStart, String FuzzEnd) thro
/*
* create the base case object
*/
baseCase = new BaseCase(null, failcode, false, failurl, baseResponce, null, useRegexInstead, regex);
baseCase = new BaseCase(null, failcode, false, failurl, baseResponse, null, useRegexInstead, regex);

return baseCase;
}
Expand All @@ -412,7 +412,7 @@ private static String getBaseCaseAgain(URL failurl, String failString) throws IO
{
int failcode;
Manager manager = Manager.getInstance();
String baseResponce = "";
String baseResponse = "";

GetMethod httpget = new GetMethod(failurl.toString());
//set the custom HTTP headers
Expand All @@ -435,7 +435,7 @@ private static String getBaseCaseAgain(URL failurl, String failString) throws IO
}
httpget.setFollowRedirects(Config.followRedirects);

//save the http responce code for the base case
//save the http response code for the base case
failcode = manager.getHttpclient().executeMethod(httpget);
manager.workDone();

Expand All @@ -454,29 +454,29 @@ private static String getBaseCaseAgain(URL failurl, String failString) throws IO
{
buf.append("\r\n" + tempLine);
}
baseResponce = buf.toString();
baseResponse = buf.toString();
input.close();

//HTMLparse.parseHTML();

//HTMLparse htmlParse = new HTMLparse(baseResponce, null);
//HTMLparse htmlParse = new HTMLparse(baseResponse, null);
//Thread parse = new Thread(htmlParse);
//parse.start();

//clean up the base case, based on the basecase URL
baseResponce = FilterResponce.CleanResponce(baseResponce, failurl, failString);
baseResponse = FilterResponse.CleanResponse(baseResponse, failurl, failString);

httpget.releaseConnection();

/*
* return the cleaned responce
* return the cleaned response
*/
return baseResponce;
return baseResponse;
}
else
{
/*
* we have a big problem here as the server has returned an other responce code, for the same request
* we have a big problem here as the server has returned an other response code, for the same request
* TODO: think of a way to deal with this!
*/
return null;
Expand Down
Loading