Skip to content

Commit

Permalink
Fixed YARA Error check
Browse files Browse the repository at this point in the history
  • Loading branch information
imp0rtp3 committed Sep 5, 2021
1 parent f58663d commit 581435d
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 40 deletions.
Binary file removed icons/icon.png
Binary file not shown.
72 changes: 37 additions & 35 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,41 @@
{
"manifest_version": 2,
"name": "Yobi",
"version": "0.1.1",

"manifest_version": 2,
"name": "Yobi",
"version": "0.1",
"description": "Yara Based Detection Engine for web browsers",
"icons": {
"48": "icons/icon64.png",
"96": "icons/icon128.png"
},
"background": {
"page":"Yobi.html"
},

"browser_action": {
"browser_style": true,
"default_popup": "popup/popup.html",
"default_icon": {
"16": "icons/emoji-laughing.svg",
"32": "icons/emoji-laughing.svg"
}
},
"permissions": [
"webRequest",
"webRequestBlocking",
"notifications",
"storage",
"downloads",
"<all_urls>"
],
"content_security_policy": "script-src 'self' 'sha256-mlhRIuI1L2yvZjzLr1ruxKOhxybExil/apGVHVo2o8I=' 'unsafe-eval'; object-src 'self';",
"options_ui": {
"page": "options.html"
},

"description": "Yara Based Detection Engine for web browsers",

"background": {
"page":"Yobi.html"
},

"browser_action": {
"browser_style": true,
"default_popup": "popup/popup.html",
"default_icon": {
"16": "icons/emoji-laughing.svg",
"32": "icons/emoji-laughing.svg"
}
},
"permissions": [
"webRequest",
"webRequestBlocking",
"notifications",
"storage",
"downloads",
"<all_urls>"
],
"content_security_policy": "script-src 'self' 'sha256-mlhRIuI1L2yvZjzLr1ruxKOhxybExil/apGVHVo2o8I=' 'unsafe-eval'; object-src 'self';",
"options_ui": {
"page": "options.html"
},

"browser_specific_settings": {
"gecko": {
"id": "{b5cd734c-ce82-44fa-88c9-c700486eba4c}"
}
}
"browser_specific_settings": {
"gecko": {
"id": "{b5cd734c-ce82-44fa-88c9-c700486eba4c}"
}
}
}
3 changes: 2 additions & 1 deletion popup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class MatchesUpdater{

storage_listener (item) {
var matches = item['rule_matches'];
console.log(matches);
if (matches && Object.keys(matches).length){
this.matches_dict = item["rule_matches"];
this.add_rule_matches(matches);
Expand Down Expand Up @@ -79,7 +80,7 @@ class MatchesUpdater{
$link.html(`<b><h3>${host}</h3></b> - <i>${matches[sha256].file_name}</i>`);
}
var desc_html = `<b>Matches: </b>${Object.keys(matches[sha256].matches).join(', ')}<br>
<b>Sha256: </b><div id="hash_${sha256}">${sha256}</div>`;
<b>Sha256: </b><div id="hash_${sha256}">${sha256} </div>`;
desc_html += `<a href="https://www.virustotal.com/gui/file/${sha256}" role="button" class="w3-hover-text-theme w3-theme-l1 desc_button btn" >VT</a>`;
desc_html += `<button type="button" id="download_sample${sha256}" class="w3-hover-text-theme w3-theme-l1 desc_button download_button btn">Sample</button>`;
desc_html += `<button type="button" id="download_details${sha256}" style="float: right;" class="w3-hover-text-theme w3-theme-l1 desc_button download_button btn">Details</button>`;
Expand Down
6 changes: 2 additions & 4 deletions yobi.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,14 @@ class YaraScanner
// Queue filled by Yarascanner of messages that the contentReceiver needs to send
this._messages_qu = [];
// Yara parser for extracting metadata
this.get_yara_rules()

this.check_for_yara_errors();
this.get_yara_rules().then(x => {self.check_for_yara_errors();});

this.yara_worker_loop = setInterval(function(x){
self.yara_worker();
}, 1000);
}

async check_for_yara_errors(){
check_for_yara_errors(){
const yara_matches = this.yara_eng.run("test", this.raw_yara_rules);
if (yara_matches.compileErrors.size() === 0) {
return false;
Expand Down

0 comments on commit 581435d

Please sign in to comment.