first release

This commit is contained in:
hexahigh 2023-02-12 11:41:57 +01:00
parent aa5b8ed263
commit 2807482749
27 changed files with 71426 additions and 1 deletions

69005
db.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@ -23,7 +23,7 @@ function processInput () {
fs.close(id, function(){
console.log('Custom database is updated');
console.log('If the file is a virus, please submit the hash here:');
console.log('\x1b[32m%s\x1b[0m', "")
console.log('\x1b[32m%s\x1b[0m', "boof.eu.org/other/av-hashes")
});
});
});

0
dbcreator.txt Normal file
View File

1344
h-db.txt Normal file

File diff suppressed because it is too large Load Diff

64
main.js Normal file
View File

@ -0,0 +1,64 @@
var prompt = require("prompt-sync")({ sigint: true });
var fs = require('fs');
var crypto = require('crypto');
// Variables
var isdetected = false;
var databasetouse2 = 0;
// Set delay to ms
function delay(milliseconds) {
return new Promise(resolve => {
setTimeout(resolve, milliseconds);
});
}
//Credits
console.log('\x1b[32m%s\x1b[0m', "███╗ ███╗ █████╗ ██████╗ ███████╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗██████╗ ███████╗██╗ ██╗")
console.log('\x1b[32m%s\x1b[0m', "████╗ ████║██╔══██╗██╔══██╗██╔════╝ ██╔══██╗╚██╗ ██╔╝ ██╔══██╗██╔═══██╗██╔═══██╗██╔════╝██╔══██╗██╔════╝██║ ██║")
console.log('\x1b[32m%s\x1b[0m', "██╔████╔██║███████║██║ ██║█████╗ ██████╔╝ ╚████╔╝ ██████╔╝██║ ██║██║ ██║█████╗ ██║ ██║█████╗ ██║ ██║")
console.log('\x1b[32m%s\x1b[0m', "██║╚██╔╝██║██╔══██║██║ ██║██╔══╝ ██╔══██╗ ╚██╔╝ ██╔══██╗██║ ██║██║ ██║██╔══╝ ██║ ██║██╔══╝ ╚██╗ ██╔╝")
console.log('\x1b[32m%s\x1b[0m', "██║ ╚═╝ ██║██║ ██║██████╔╝███████╗ ██████╔╝ ██║ ██████╔╝╚██████╔╝╚██████╔╝██║ ██████╔╝███████╗ ╚████╔╝ ")
console.log('\x1b[32m%s\x1b[0m', "╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═══╝ ")
console.log('\x1b[36m%s\x1b[0m', "boofdev.eu.org" + " ©2023")
console.log()
//Ask user what database to use.
console.log("What database should be used?")
console.log("[1] Virus database")
const databasetouse = prompt("");
if (databasetouse == 1) {
databasetouse2 = "db.txt"
}
if (databasetouse == 69) {
databasetouse2 = "h-db.txt"
}
// Load database
console.log("Loading database...")
var database0 = fs.readFileSync(databasetouse2).toString().split("\n");
var database = database0.toString().toUpperCase();
console.log ("Database loaded!")
// Ask user what file they should scan
const filetoscan = prompt("Enter path of file to be scanned: ");
console.log("Obtaining hash...")
const buff = fs.readFileSync(filetoscan);
var outputdata0 = crypto.createHash("md5").update(buff).digest("hex");
var outputdata = outputdata0.toString().toUpperCase();
console.log("Hash: " + outputdata)
// Check if database contains output data
console.log("Checking if the hash matches the database...")
if (database.includes(outputdata)) {
isdetected = true;
console.log("The file IS a virus.");
} else {
isdetected = false;
console.log("The file is NOT a virus.");
}
/*async function printout() {
await delay(100);
if (isdetected == true) {
console.log("")
}
}*/

46
node_modules/.package-lock.json generated vendored Normal file
View File

@ -0,0 +1,46 @@
{
"name": "virus-scanner",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"node_modules/ansi-regex": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz",
"integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==",
"engines": {
"node": ">=6"
}
},
"node_modules/crypto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz",
"integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==",
"deprecated": "This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in."
},
"node_modules/fs": {
"version": "0.0.1-security",
"resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
"integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w=="
},
"node_modules/prompt-sync": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/prompt-sync/-/prompt-sync-4.2.0.tgz",
"integrity": "sha512-BuEzzc5zptP5LsgV5MZETjDaKSWfchl5U9Luiu8SKp7iZWD5tZalOxvNcZRwv+d2phNFr8xlbxmFNcRKfJOzJw==",
"dependencies": {
"strip-ansi": "^5.0.0"
}
},
"node_modules/strip-ansi": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dependencies": {
"ansi-regex": "^4.1.0"
},
"engines": {
"node": ">=6"
}
}
}
}

14
node_modules/ansi-regex/index.js generated vendored Normal file
View File

@ -0,0 +1,14 @@
'use strict';
module.exports = options => {
options = Object.assign({
onlyFirst: false
}, options);
const pattern = [
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
].join('|');
return new RegExp(pattern, options.onlyFirst ? undefined : 'g');
};

9
node_modules/ansi-regex/license generated vendored Normal file
View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

53
node_modules/ansi-regex/package.json generated vendored Normal file
View File

@ -0,0 +1,53 @@
{
"name": "ansi-regex",
"version": "4.1.1",
"description": "Regular expression for matching ANSI escape codes",
"license": "MIT",
"repository": "chalk/ansi-regex",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=6"
},
"scripts": {
"test": "xo && ava",
"view-supported": "node fixtures/view-codes.js"
},
"files": [
"index.js"
],
"keywords": [
"ansi",
"styles",
"color",
"colour",
"colors",
"terminal",
"console",
"cli",
"string",
"tty",
"escape",
"formatting",
"rgb",
"256",
"shell",
"xterm",
"command-line",
"text",
"regex",
"regexp",
"re",
"match",
"test",
"find",
"pattern"
],
"devDependencies": {
"ava": "^0.25.0",
"xo": "^0.23.0"
}
}

87
node_modules/ansi-regex/readme.md generated vendored Normal file
View File

@ -0,0 +1,87 @@
# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex)
> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-ansi-regex?utm_source=npm-ansi-regex&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>
---
## Install
```
$ npm install ansi-regex
```
## Usage
```js
const ansiRegex = require('ansi-regex');
ansiRegex().test('\u001B[4mcake\u001B[0m');
//=> true
ansiRegex().test('cake');
//=> false
'\u001B[4mcake\u001B[0m'.match(ansiRegex());
//=> ['\u001B[4m', '\u001B[0m']
'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
//=> ['\u001B[4m']
'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
```
## API
### ansiRegex([options])
Returns a regex for matching ANSI escape codes.
#### options
##### onlyFirst
Type: `boolean`<br>
Default: `false` *(Matches any ANSI escape codes in a string)*
Match only the first ANSI escape.
## FAQ
### Why do you test for codes not in the ECMA 48 standard?
Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them.
On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.
## Security
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)
## License
MIT

7
node_modules/crypto/README.md generated vendored Normal file
View File

@ -0,0 +1,7 @@
# Deprecated Package
This package is no longer supported and has been deprecated. To avoid malicious use, npm is hanging on to the package name.
It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.
Please contact support@npmjs.com if you have questions about this package.

19
node_modules/crypto/package.json generated vendored Normal file
View File

@ -0,0 +1,19 @@
{
"name": "crypto",
"version": "1.0.1",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/npm/deprecate-holder.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/npm/deprecate-holder/issues"
},
"homepage": "https://github.com/npm/deprecate-holder#readme"
}

9
node_modules/fs/README.md generated vendored Normal file
View File

@ -0,0 +1,9 @@
# Security holding package
This package name is not currently in use, but was formerly occupied
by another package. To avoid malicious use, npm is hanging on to the
package name, but loosely, and we'll probably give it to you if you
want it.
You may adopt this package by contacting support@npmjs.com and
requesting the name.

20
node_modules/fs/package.json generated vendored Normal file
View File

@ -0,0 +1,20 @@
{
"name": "fs",
"version": "0.0.1-security",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/npm/security-holder.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/npm/security-holder/issues"
},
"homepage": "https://github.com/npm/security-holder#readme"
}

21
node_modules/prompt-sync/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014-2019 Paolo Fragomeni & David Mark Clements
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

118
node_modules/prompt-sync/README.md generated vendored Normal file
View File

@ -0,0 +1,118 @@
# SYNOPSIS
A sync prompt for node. very simple. no C++ bindings and no bash scripts.
Works on Linux, OS X and Windows.
# BASIC MODE
```js
var prompt = require('prompt-sync')();
//
// get input from the user.
//
var n = prompt('How many more times? ');
```
# WITH HISTORY
History is an optional extra, to use simply install the history plugin.
```sh
npm install --save prompt-sync-history
```
```js
var prompt = require('prompt-sync')({
history: require('prompt-sync-history')() //open history file
});
//get some user input
var input = prompt()
prompt.history.save() //save history back to file
```
See the [prompt-sync-history](http://npm.im/prompt-sync-history) module
for options, or fork it for customized behaviour.
# API
## `require('prompt-sync')(config) => prompt`
Returns an instance of the `prompt` function.
Takes `config` option with the following possible properties
`sigint`: Default is `false`. A ^C may be pressed during the input process to abort the text entry. If sigint it `false`, prompt returns `null`. If sigint is `true` the ^C will be handled in the traditional way: as a SIGINT signal causing process to exit with code 130.
`eot`: Default is `false`. A ^D pressed as the first character of an input line causes prompt-sync to echo `exit` and exit the process with code 0.
`autocomplete`: A completer function that will be called when user enters TAB to allow for autocomplete. It takes a string as an argument an returns an array of strings that are possible matches for completion. An empty array is returned if there are no matches.
`history`: Takes an object that supplies a "history interface", see [prompt-sync-history](http://npm.im/prompt-sync-history) for an example.
## `prompt(ask, value, opts)`
`ask` is the label of the prompt, `value` is the default value
in absence of a response.
The `opts` argument can also be in the first or second parameter position.
Opts can have the following properties
`echo`: Default is `'*'`. If set the password will be masked with the specified character. For hidden input, set echo to `''` (or use `prompt.hide`).
`autocomplete`: Overrides the instance `autocomplete` function to allow for custom
autocompletion of a particular prompt.
`value`: Same as the `value` parameter, the default value for the prompt. If `opts`
is in the third position, this property will *not* overwrite the `value` parameter.
`ask`: Sames as the `value` parameter. The prompt label. If `opts` is not in the first position, the `ask` parameter will *not* be overridden by this property.
## `prompt.hide(ask)`
Convenience method for creating a standard hidden password prompt,
this is the same as `prompt(ask, {echo: ''})`
# LINE EDITING
Line editing is enabled in the non-hidden mode. (use up/down arrows for history and backspace and left/right arrows for editing)
History is not set when using hidden mode.
# EXAMPLES
```js
//basic:
console.log(require('prompt-sync')()('tell me something about yourself: '))
var prompt = require('prompt-sync')({
history: require('prompt-sync-history')(),
autocomplete: complete(['hello1234', 'he', 'hello', 'hello12', 'hello123456']),
sigint: false
});
var value = 'frank';
var name = prompt('enter name: ', value);
console.log('enter echo * password');
var pw = prompt({echo: '*'});
var pwb = prompt('enter hidden password (or don\'t): ', {echo: '', value: '*pwb default*'})
var pwc = prompt.hide('enter another hidden password: ')
var autocompleteTest = prompt('custom autocomplete: ', {
autocomplete: complete(['bye1234', 'by', 'bye12', 'bye123456'])
});
prompt.history.save();
console.log('\nName: %s\nPassword *: %s\nHidden password: %s\nAnother Hidden password: %s', name, pw, pwb, pwc);
console.log('autocomplete2: ', autocompleteTest);
function complete(commands) {
return function (str) {
var i;
var ret = [];
for (i=0; i< commands.length; i++) {
if (commands[i].indexOf(str) == 0)
ret.push(commands[i]);
}
return ret;
};
};
```

243
node_modules/prompt-sync/index.js generated vendored Normal file
View File

@ -0,0 +1,243 @@
'use strict'
var fs = require('fs');
var stripAnsi = require('strip-ansi');
var term = 13; // carriage return
/**
* create -- sync function for reading user input from stdin
* @param {Object} config {
* sigint: {Boolean} exit on ^C
* autocomplete: {StringArray} function({String})
* history: {String} a history control object (see `prompt-sync-history`)
* }
* @returns {Function} prompt function
*/
// for ANSI escape codes reference see https://en.wikipedia.org/wiki/ANSI_escape_code
function create(config) {
config = config || {};
var sigint = config.sigint;
var eot = config.eot;
var autocomplete = config.autocomplete =
config.autocomplete || function(){return []};
var history = config.history;
prompt.history = history || {save: function(){}};
prompt.hide = function (ask) { return prompt(ask, {echo: ''}) };
return prompt;
/**
* prompt -- sync function for reading user input from stdin
* @param {String} ask opening question/statement to prompt for
* @param {String} value initial value for the prompt
* @param {Object} opts {
* echo: set to a character to be echoed, default is '*'. Use '' for no echo
* value: {String} initial value for the prompt
* ask: {String} opening question/statement to prompt for, does not override ask param
* autocomplete: {StringArray} function({String})
* }
*
* @returns {string} Returns the string input or (if sigint === false)
* null if user terminates with a ^C
*/
function prompt(ask, value, opts) {
var insert = 0, savedinsert = 0, res, i, savedstr;
opts = opts || {};
if (Object(ask) === ask) {
opts = ask;
ask = opts.ask;
} else if (Object(value) === value) {
opts = value;
value = opts.value;
}
ask = ask || '';
var echo = opts.echo;
var masked = 'echo' in opts;
autocomplete = opts.autocomplete || autocomplete;
var fd = (process.platform === 'win32') ?
process.stdin.fd :
fs.openSync('/dev/tty', 'rs');
var wasRaw = process.stdin.isRaw;
if (!wasRaw) { process.stdin.setRawMode && process.stdin.setRawMode(true); }
var buf = Buffer.alloc(3);
var str = '', character, read;
savedstr = '';
if (ask) {
process.stdout.write(ask);
}
var cycle = 0;
var prevComplete;
while (true) {
read = fs.readSync(fd, buf, 0, 3);
if (read > 1) { // received a control sequence
switch(buf.toString()) {
case '\u001b[A': //up arrow
if (masked) break;
if (!history) break;
if (history.atStart()) break;
if (history.atEnd()) {
savedstr = str;
savedinsert = insert;
}
str = history.prev();
insert = str.length;
process.stdout.write('\u001b[2K\u001b[0G' + ask + str);
break;
case '\u001b[B': //down arrow
if (masked) break;
if (!history) break;
if (history.pastEnd()) break;
if (history.atPenultimate()) {
str = savedstr;
insert = savedinsert;
history.next();
} else {
str = history.next();
insert = str.length;
}
process.stdout.write('\u001b[2K\u001b[0G'+ ask + str + '\u001b['+(insert+ask.length+1)+'G');
break;
case '\u001b[D': //left arrow
if (masked) break;
var before = insert;
insert = (--insert < 0) ? 0 : insert;
if (before - insert)
process.stdout.write('\u001b[1D');
break;
case '\u001b[C': //right arrow
if (masked) break;
insert = (++insert > str.length) ? str.length : insert;
process.stdout.write('\u001b[' + (insert+ask.length+1) + 'G');
break;
default:
if (buf.toString()) {
str = str + buf.toString();
str = str.replace(/\0/g, '');
insert = str.length;
promptPrint(masked, ask, echo, str, insert);
process.stdout.write('\u001b[' + (insert+ask.length+1) + 'G');
buf = Buffer.alloc(3);
}
}
continue; // any other 3 character sequence is ignored
}
// if it is not a control character seq, assume only one character is read
character = buf[read-1];
// catch a ^C and return null
if (character == 3){
process.stdout.write('^C\n');
fs.closeSync(fd);
if (sigint) process.exit(130);
process.stdin.setRawMode && process.stdin.setRawMode(wasRaw);
return null;
}
// catch a ^D and exit
if (character == 4) {
if (str.length == 0 && eot) {
process.stdout.write('exit\n');
process.exit(0);
}
}
// catch the terminating character
if (character == term) {
fs.closeSync(fd);
if (!history) break;
if (!masked && str.length) history.push(str);
history.reset();
break;
}
// catch a TAB and implement autocomplete
if (character == 9) { // TAB
res = autocomplete(str);
if (str == res[0]) {
res = autocomplete('');
} else {
prevComplete = res.length;
}
if (res.length == 0) {
process.stdout.write('\t');
continue;
}
var item = res[cycle++] || res[cycle = 0, cycle++];
if (item) {
process.stdout.write('\r\u001b[K' + ask + item);
str = item;
insert = item.length;
}
}
if (character == 127 || (process.platform == 'win32' && character == 8)) { //backspace
if (!insert) continue;
str = str.slice(0, insert-1) + str.slice(insert);
insert--;
process.stdout.write('\u001b[2D');
} else {
if ((character < 32 ) || (character > 126))
continue;
str = str.slice(0, insert) + String.fromCharCode(character) + str.slice(insert);
insert++;
};
promptPrint(masked, ask, echo, str, insert);
}
process.stdout.write('\n')
process.stdin.setRawMode && process.stdin.setRawMode(wasRaw);
return str || value || '';
};
function promptPrint(masked, ask, echo, str, insert) {
if (masked) {
process.stdout.write('\u001b[2K\u001b[0G' + ask + Array(str.length+1).join(echo));
} else {
process.stdout.write('\u001b[s');
if (insert == str.length) {
process.stdout.write('\u001b[2K\u001b[0G'+ ask + str);
} else {
if (ask) {
process.stdout.write('\u001b[2K\u001b[0G'+ ask + str);
} else {
process.stdout.write('\u001b[2K\u001b[0G'+ str + '\u001b[' + (str.length - insert) + 'D');
}
}
// Reposition the cursor to the right of the insertion point
var askLength = stripAnsi(ask).length;
process.stdout.write(`\u001b[${askLength+1+(echo==''? 0:insert)}G`);
}
}
};
module.exports = create;

40
node_modules/prompt-sync/package.json generated vendored Normal file
View File

@ -0,0 +1,40 @@
{
"name": "prompt-sync",
"version": "4.2.0",
"description": "a synchronous prompt for node.js",
"main": "index.js",
"scripts": {
"test": "node test"
},
"repository": {
"type": "git",
"url": "https://github.com/heapwolf/prompt-sync.git"
},
"keywords": [
"prompt",
"sync",
"blocking",
"readline",
"input",
"getline",
"repl",
"history"
],
"contributors": [
{
"name": "Paolo Fragomeni",
"email": "paolo@async.ly"
},
{
"name": "David Mark Clements",
"email": "david.clements@nearform.com"
}
],
"license": "MIT",
"devDependencies": {
"prompt-sync-history": "^1.0.1"
},
"dependencies": {
"strip-ansi": "^5.0.0"
}
}

38
node_modules/prompt-sync/test.js generated vendored Normal file
View File

@ -0,0 +1,38 @@
//basic:
console.log(require('./')()('tell me something about yourself: '))
// ANSI escape codes colored text test
require('./')()('\u001B[31mcolored text: \u001B[39m');
var prompt = require('./')({
history: require('prompt-sync-history')(),
autocomplete: complete(['hello1234', 'he', 'hello', 'hello12', 'hello123456']),
sigint: false
});
var value = 'frank';
var name = prompt('enter name: ', value);
console.log('enter echo * password');
var pw = prompt({echo: '*'});
var pwb = prompt('enter hidden password (or don\'t): ', {echo: '', value: '*pwb default*'})
var pwc = prompt.hide('enter another hidden password: ')
var autocompleteTest = prompt('custom autocomplete: ', {
autocomplete: complete(['bye1234', 'by', 'bye12', 'bye123456'])
});
prompt.history.save();
console.log('\nName: %s\nPassword *: %s\nHidden password: %s\nAnother Hidden password: %s', name, pw, pwb, pwc);
console.log('autocomplete2: ', autocompleteTest);
function complete(commands) {
return function (str) {
var i;
var ret = [];
for (i=0; i< commands.length; i++) {
if (commands[i].indexOf(str) == 0)
ret.push(commands[i]);
}
return ret;
};
};

15
node_modules/strip-ansi/index.d.ts generated vendored Normal file
View File

@ -0,0 +1,15 @@
/**
Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string.
@example
```
import stripAnsi from 'strip-ansi';
stripAnsi('\u001B[4mUnicorn\u001B[0m');
//=> 'Unicorn'
stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
//=> 'Click'
```
*/
export default function stripAnsi(string: string): string;

7
node_modules/strip-ansi/index.js generated vendored Normal file
View File

@ -0,0 +1,7 @@
'use strict';
const ansiRegex = require('ansi-regex');
const stripAnsi = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
module.exports = stripAnsi;
module.exports.default = stripAnsi;

9
node_modules/strip-ansi/license generated vendored Normal file
View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

54
node_modules/strip-ansi/package.json generated vendored Normal file
View File

@ -0,0 +1,54 @@
{
"name": "strip-ansi",
"version": "5.2.0",
"description": "Strip ANSI escape codes from a string",
"license": "MIT",
"repository": "chalk/strip-ansi",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=6"
},
"scripts": {
"test": "xo && ava && tsd-check"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"strip",
"trim",
"remove",
"ansi",
"styles",
"color",
"colour",
"colors",
"terminal",
"console",
"string",
"tty",
"escape",
"formatting",
"rgb",
"256",
"shell",
"xterm",
"log",
"logging",
"command-line",
"text"
],
"dependencies": {
"ansi-regex": "^4.1.0"
},
"devDependencies": {
"ava": "^1.3.1",
"tsd-check": "^0.5.0",
"xo": "^0.24.0"
}
}

61
node_modules/strip-ansi/readme.md generated vendored Normal file
View File

@ -0,0 +1,61 @@
# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi)
> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=readme">Get professional support for 'strip-ansi' with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>
---
## Install
```
$ npm install strip-ansi
```
## Usage
```js
const stripAnsi = require('strip-ansi');
stripAnsi('\u001B[4mUnicorn\u001B[0m');
//=> 'Unicorn'
stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
//=> 'Click'
```
## Security
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
## Related
- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module
- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)
## License
MIT

89
package-lock.json generated Normal file
View File

@ -0,0 +1,89 @@
{
"name": "virus-scanner",
"version": "1.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "virus-scanner",
"version": "1.0.0",
"license": "ISC",
"dependencies": {
"crypto": "^1.0.1",
"fs": "^0.0.1-security",
"prompt-sync": "^4.2.0"
}
},
"node_modules/ansi-regex": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz",
"integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==",
"engines": {
"node": ">=6"
}
},
"node_modules/crypto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz",
"integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig==",
"deprecated": "This package is no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in."
},
"node_modules/fs": {
"version": "0.0.1-security",
"resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
"integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w=="
},
"node_modules/prompt-sync": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/prompt-sync/-/prompt-sync-4.2.0.tgz",
"integrity": "sha512-BuEzzc5zptP5LsgV5MZETjDaKSWfchl5U9Luiu8SKp7iZWD5tZalOxvNcZRwv+d2phNFr8xlbxmFNcRKfJOzJw==",
"dependencies": {
"strip-ansi": "^5.0.0"
}
},
"node_modules/strip-ansi": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dependencies": {
"ansi-regex": "^4.1.0"
},
"engines": {
"node": ">=6"
}
}
},
"dependencies": {
"ansi-regex": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz",
"integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g=="
},
"crypto": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/crypto/-/crypto-1.0.1.tgz",
"integrity": "sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig=="
},
"fs": {
"version": "0.0.1-security",
"resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz",
"integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w=="
},
"prompt-sync": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/prompt-sync/-/prompt-sync-4.2.0.tgz",
"integrity": "sha512-BuEzzc5zptP5LsgV5MZETjDaKSWfchl5U9Luiu8SKp7iZWD5tZalOxvNcZRwv+d2phNFr8xlbxmFNcRKfJOzJw==",
"requires": {
"strip-ansi": "^5.0.0"
}
},
"strip-ansi": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"requires": {
"ansi-regex": "^4.1.0"
}
}
}
}

18
package.json Normal file
View File

@ -0,0 +1,18 @@
{
"name": "virus-scanner",
"version": "1.0.0",
"description": "simple js virus scanner",
"main": "main.js",
"scripts": {
"update": "node update.js",
"custom": "node dbcreator.js",
"run": "node main.js"
},
"author": "Boofdev",
"license": "ISC",
"dependencies": {
"crypto": "^1.0.1",
"fs": "^0.0.1-security",
"prompt-sync": "^4.2.0"
}
}

35
update.js Normal file
View File

@ -0,0 +1,35 @@
var prompt = require("prompt-sync")({ sigint: true });
var fs = require('fs');
const http = require('http');
const https = require('https');
console.log("This will update the database.")
console.log("Do you wish to proceed? Y/N")
const useragree = prompt("");
if (useragree == "Y") {
console.log("Deleting old files")
fs.unlinkSync("h-db.txt")
fs.unlinkSync("db.txt")
console.log("Downloading new files")
//download first database
const db69 = fs.createWriteStream("h-db.txt");
const request = https.get("https://hexahigh.github.io/cdn/Text/h-db.txt", function(response) {
response.pipe(db69);
// after download completed close filestream
db69.on("finish", () => {
db69.close();
});
});
const dbmain = fs.createWriteStream("db.txt");
const request2 = https.get("https://hexahigh.github.io/cdn/Text/db.txt", function(response) {
response.pipe(dbmain);
// after download completed close filestream
dbmain.on("finish", () => {
dbmain.close();
});
});
} else {
exit()
}