Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximKing1 committed Jun 28, 2021
1 parent 9b8dd91 commit 6d84491
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ client.scanDomain("DOMAIN.COM/URL").then(res => {
});
```

## Scan IP
```js
const { vtClient } = require('vtotal_v3');

const client = new vtClient("NUNYA", false); // ("apiKey", extraDebuggingMode <true | false>)

client.scanDomain("IP_ADDRESS").then(res => {
console.log(res)
// Your Code Here!
});
```

## Scan Domain
```js
const { vtClient } = require('vtotal_v3');
Expand Down
16 changes: 15 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ const { createReadStream } = require('fs');
const uploadFile = "https://www.virustotal.com/api/v3/files",
fileScanInfo = "https://www.virustotal.com/api/v3/files",
scanURL = "https://www.virustotal.com/api/v3/urls",
scanDomain = "https://www.virustotal.com/api/v3/domains";
scanDomain = "https://www.virustotal.com/api/v3/domains",
scanIP = "https://www.virustotal.com/api/v3/ip_addresses";

class vtClient {
constructor(apiKey, debuggingMode) {
Expand Down Expand Up @@ -74,6 +75,19 @@ class vtClient {
return json
})
}

async scanIP(IP) {
return await fetch(`${scanIP}/${IP}`, {
method: 'GET',
headers: { 'Content-Type': 'application/json', 'x-apikey': this.key },
}).then(res => res.json()).then(json => {
if (this.debugger == true) console.log(json);

if (json.error.code == "WrongCredentialsError") console.error("Wrong Credentials Error! Please Make Sure You Entered a Valid API Token...");

return json
})
}
}

module.exports.vtClient = vtClient;

0 comments on commit 6d84491

Please sign in to comment.