* to run scan with.
*/
private void testFile(String fileName) throws IOException {
boolean suspiciousFileFound = false;
HttpMessage msg = getNewMsg();
try {
URI uri = msg.getRequestHeader().getURI();
String path = uri.getPath();
if (path == null || path.equals("")) {
return;
}
if (!path.endsWith("/")) {
path = path + "/";
}
path = path + fileName;
uri.setPath(path);
msg.getRequestHeader().setURI(uri);
sendAndReceive(msg);
if (msg.getResponseHeader().getStatusCode() != HttpStatusCode.OK) {
return;
}
if (matchBodyPattern(msg, patternPhpInfo, null)) {
suspiciousFileFound = true;
}
} catch (IOException e) {
}
if (suspiciousFileFound) {
bingo(Alert.RISK_MEDIUM, Alert.WARNING, msg.getRequestHeader()
.getURI().toString(), "", "", msg);
}
}