Skip to content

Commit

Permalink
Merge pull request #247 from ninoseki/update-ioc-extractor
Browse files Browse the repository at this point in the history
chore: update IOC-extractor
  • Loading branch information
ninoseki committed May 26, 2019
2 parents 59f82aa + d06aa0c commit bbfa017
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
18 changes: 13 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"dependencies": {
"axios": "^0.18.0",
"crypto-js": "^3.1.9-1",
"ioc-extractor": "^1.0.0",
"ioc-extractor": "^2.0.0",
"mustache": "^3.0.1",
"qs": "^6.7.0",
"throttle-debounce": "^2.1.0",
Expand Down
26 changes: 13 additions & 13 deletions src/lib/selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,54 +21,54 @@ export class Selector {
}

public getIP(): string | null {
return this.getFirstValueFromArray(this.ioc.networks.ipv4s);
return this.getFirstValueFromArray(this.ioc.ipv4s);
}

public getDomain(): string | null {
return this.getFirstValueFromArray(this.ioc.networks.domains);
return this.getFirstValueFromArray(this.ioc.domains);
}

public getURL(): string | null {
return this.getFirstValueFromArray(this.ioc.networks.urls);
return this.getFirstValueFromArray(this.ioc.urls);
}

public getEmail(): string | null {
return this.getFirstValueFromArray(this.ioc.networks.emails);
return this.getFirstValueFromArray(this.ioc.emails);
}

public getASN(): string | null {
return this.getFirstValueFromArray(this.ioc.networks.asns);
return this.getFirstValueFromArray(this.ioc.asns);
}

public getHash(): string | null {
let hashes: string[] = [];
hashes = this.concat(hashes, this.ioc.hashes.sha256s);
hashes = this.concat(hashes, this.ioc.hashes.sha1s);
hashes = this.concat(hashes, this.ioc.hashes.md5s);
hashes = this.concat(hashes, this.ioc.sha256s);
hashes = this.concat(hashes, this.ioc.sha1s);
hashes = this.concat(hashes, this.ioc.md5s);
if (hashes.length === 0) {
return null;
}
return hashes[0];
}

public getCVE(): string | null {
return this.getFirstValueFromArray(this.ioc.utilities.cves);
return this.getFirstValueFromArray(this.ioc.cves);
}

public getBTC(): string | null {
return this.getFirstValueFromArray(this.ioc.cryptocurrencies.btcs);
return this.getFirstValueFromArray(this.ioc.btcs);
}

public getXMR(): string | null {
return this.getFirstValueFromArray(this.ioc.cryptocurrencies.xmrs);
return this.getFirstValueFromArray(this.ioc.xmrs);
}

public getGATrackID(): string | null {
return this.getFirstValueFromArray(this.ioc.trackers.gaTrackIDs);
return this.getFirstValueFromArray(this.ioc.gaTrackIDs);
}

public getGAPubID(): string | null {
return this.getFirstValueFromArray(this.ioc.trackers.gaPubIDs);
return this.getFirstValueFromArray(this.ioc.gaPubIDs);
}

public getSearchersByType(type: SearchableType): Searcher[] {
Expand Down

0 comments on commit bbfa017

Please sign in to comment.