This repository was archived by the owner on Jan 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathwhiletestruns.js
More file actions
118 lines (93 loc) · 3.69 KB
/
Copy pathwhiletestruns.js
File metadata and controls
118 lines (93 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
Copyright 2007 Security Compass
This file is part of SQL Inject Me.
SQL Inject Me is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SQL Inject Me is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SQL Inject Me. If not, see <http://www.gnu.org/licenses/>.
If you have any questions regarding SQL Inject Me please contact
tools@securitycompass.com
*/
/**
* NOTE: in this file all uses of the keyword *this* refer to the window.
* We're modifying this window so that other windows (e.g. the sidebar) can
* interact with it directly.
*/
/**
* whiletestruns.js
* Holding JS code for whiletestruns.xul
*/
function OK(){
var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
var rv = false;
rv = prompts.confirmEx(null,
"Are you sure you want to close this window?",
"Are you sure you want to close this window? It's useful to " +
"remind you not to use the testing window. Also closing this window will NOT stop the tests.",
prompts.STD_YES_NO_BUTTONS, "", "", "", null, new Object());
return !rv;
}
/**
* This function is called when a test is finished
*/
this.finishedTest = function() {
this.numTestsComplete++;
if (this.numTestsComplete > this.maxNumTests) {
Components.utils.reportError('Too many tests have been completed');
}
}
this.clearNumTests = function() {
this.numTestsComplete = 0;
}
this.updateUI = function() {
this.bar.value = this.numTestsComplete / this.maxNumTests * 100
this.span.innerHTML = this.numTestsComplete.toString() + '/' + this.maxNumTests.toString();
}
this.startThoroughTesting = function(numVulnerableFields) {
this.bar.value = 100;
this.span.innerHTML = this.maxNumTests.toString() + '/' + this.maxNumTests.toString();
this.bar = document.getElementById('thoroughBar');
this.span = document.getElementById('thoroughTestCount');
this.maxNumTests = 2*numVulnerableFields*this.testType.count;
this.numTestsComplete = 0;
//document.getElementById('heuristicsComplete').style.visibility = 'visible';
}
function onUnLoad() {
//alert(this.numTestsComplete + ' of ' +this.maxNumTests);
this.bar = null;
this.span = null;
}
/**
* called when the page loads
*/
function onLoad() {
this.clearNumTests();
window.centerWindowOnScreen();
this.maxNumTests = window.arguments[0];
this.testType = window.arguments[1];
this.bar = null;
this.span = null;
if (this.testType.heuristicTest) {
document.getElementById('heuristicTestingBox').style.visibility = 'visible';
//document.getElementById('heuristicsComplete').style.visibility = 'hidden';
this.bar = document.getElementById('heuristicBar');
this.span = document.getElementById('heuristicTestCount');
}
else {
this.bar = document.getElementById('thoroughBar');
this.span = document.getElementById('thoroughTestCount');
}
//update UI every 1/5 second
window.setInterval(this.updateUI, 200);
}
function generatingReport() {
document.getElementById('duringTest').style.visibility = 'collapse';
document.getElementById('generatingReport').style.visibility = 'visible';
}