Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it into QA-Turk #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
11 changes: 11 additions & 0 deletions annotation.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

<h2>Highlight the <strong id="key-name" class="key-name">name</strong> in the description</h2>
<div id="raw">${description}</div>
<div id="spans">${spans}</div>

<div class="row" id="workContent">
<div class="col-xs-12 col-sm-8 content">
Expand All @@ -43,6 +44,16 @@ <h2>Highlight the <strong id="key-name" class="key-name">name</strong> in the de
</div>

</div>

<div class="row">
<div class="col-xs-12 col-sm-8 content">
<div class="form-group">
<label for="question-sub">Question</label>
<input type="text" name="question-sub" id="question-sub" class="form-control" value="${question}">
</div>
</div>
</div>

<div id="form" class="row"> </div>
<span title="Highlight all fields before submitting"><input id="submit" class="btn btn-default" data-key="Enter" type="submit" disabled=disabled /></span>
</section>
Expand Down
13 changes: 13 additions & 0 deletions annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var key;
// ---------------------------------------------------------

var raw = $('#raw');
var spans = $('#spans');
var well = $('#well');
var submit = $('#submit');
var choice = $('#choice');
Expand Down Expand Up @@ -51,6 +52,7 @@ var makeChoice = function(key) {
.text(fieldName[key])
.append(input)
.attr({'title': "Shortcut: " + shortcutKey[key]})
.attr('hidden')
);
return label;
}
Expand Down Expand Up @@ -329,8 +331,19 @@ trigger.click(function(){
// ---------------------------------------------------------


var spansStrToAns = function(spansStrToAns) {
var annList = _.map(spansStrToAns.split(","), function(el) {return parseInt(el)});
var i = 2, list = _.groupBy(annList, function(a, b){
return Math.floor(b/i);
});
return _.toArray(list);
}

key = keys[0];
radios[key].click();
var tokens = raw.text().split(">>");
raw.hide();
spans.hide();
annotations['answer'] = spansStrToAns(spans.text());
console.log(annotations);
show();
16 changes: 4 additions & 12 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,15 @@
// ---------------------------------------------------------

var fieldName = {
"name": "Product name",
"version": "Product version",
"protocol": "Protocol",
"answer": "Answer",
}
var shortName = {
"name": "name",
"version": "version",
"protocol": "protocol",
"answer": "answer",
}
var longDesc = {
"name": "Product name. Name of the software/device/library that is affected by this vulnerability ",
"version": 'Version or versions of the product that is affected. E.g. "1.3.0" or "through 2.7"',
"protocol": "Form in which the input is given to exploit the vulnerability",
"answer": "Answer",
}
var shortcutKey = {
"name": "a",
"version": "e",
"protocol": "r",
"answer": "a",
}

4 changes: 2 additions & 2 deletions input.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
cveid,description
2018-11013,"Stack-based>>buffer>>overflow>>in>>the>>websRedirect>>function>>in>>GoAhead>>on>>D-Link>>DIR-816>>A2>>(CN)>>routers>>with>>firmware>>version>>1.10B05>>allows>>unauthenticated>>remote>>attackers>>to>>execute>>arbitrary>>code>>via>>a>>request>>with>>a>>long>>HTTP>>Host>>header."
description,question,spans
"Stack-based>>buffer>>overflow>>in>>the>>websRedirect>>function>>in>>GoAhead>>on>>D-Link>>DIR-816>>A2>>(CN)>>routers>>with>>firmware>>version>>1.10B05>>allows>>unauthenticated>>remote>>attackers>>to>>execute>>arbitrary>>code>>via>>a>>request>>with>>a>>long>>HTTP>>Host>>header.","What is the answer?","4,8"
2 changes: 2 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
.annotation {
font-weight: normal;
background-color: #EAD379;
border-style: solid;
border-width: 2px;
}

.btn-ann {
Expand Down