-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathsubmit_task.html
More file actions
60 lines (58 loc) · 2.46 KB
/
submit_task.html
File metadata and controls
60 lines (58 loc) · 2.46 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
<html>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script>
<script src="http://malsup.github.com/jquery.form.js"></script>
<script>
function send(){
var i = 0;
task = ""
str = $(taskarea).val()
while(i < str.length)
{
var j = str.indexOf("\n",i);
if (j==-1) j= str.length;
task += str.substr(i, j-i) + ",\n";
i = j+1;
}
task = task.substr(0, task.length-2)
var datastring = 'task=[' + task + "]" + "&username="+$(username).val()+"&password="+$(password).val();
$.ajax({
type: "POST",
url: $(url).val(),
data: datastring,
success: function(result,status,xhr) {$(results).val(result);},
error: function(xhr,status,error) {$(results).val("There was an error.\nResponse: " + xhr.responseText + "\nStatus Code: " + xhr.status + " ("+xhr.statusText+")");
if (xhr.status == 0) {
$(results).val($(results).val()+"\nThis problem can occur, if your browser does not accept the certificate of the master-gateway. Try visiting the site of the gateway and accepting the certificate manually and then retry.")
}
}
});
/*$("#myframe")[0].src = $(url).val()+"?"+encodeURI(datastring)+"&username="+encodeURI($(username).val())+"&password="+encodeURI($(password).val());
*/
}
function append_example(){
$(taskarea).val($(taskarea).val()+'{"primaryURI":"3a12f43eeb0c45d241a8f447d4661d9746d6ea35990953334f5ec675f60e36c5","secondaryURI":"","filename":"myfile","tasks":{"PEINFO":[],"YARA":[]},"tags":["test1"],"attempts":0,"source":"src1","download":true}\n');
}
</script>
<body>
<form id="myform" name="subm" action = "https://localhost:8090/task/" method="GET">
<table style="width:100%">
<tr><td>
Gateway-URI:</td><td style="width:80%"><input type="text" id="url" value="https://localhost:8090/task/" style="width:100%">
</td></tr><tr><td>
Username:</td><td><input type="text" id="username" value="test" style="width:100%">
</td></tr><tr><td>
Password:<td><input type="text" id="password" value="test" style="width:100%">
</td></tr>
</table>
<p>Tasks</p>
<textarea id="taskarea" name="task" style="width:100%;height:40%"></textarea>
<textarea id="results" style="width:100%;height:30%"></textarea>
</br>
<input type="button" onclick="send()" value="Send">
<input type="button" onclick="append_example()" value="Append Example">
</form>
<!--
<iframe src="" name="myframe" id="myframe" style="width:100%;height:40%"></src>
-->
</body>
</html>