diff --git a/index.html b/index.html
new file mode 100644
index 0000000..b693e14
--- /dev/null
+++ b/index.html
@@ -0,0 +1,20 @@
+
+
+ Random Ethereum Scanner
+
+
+ Addresses Scanned: 0
+ Balances Found: 0
+
+
+
\ No newline at end of file
diff --git a/index.js b/index.js
index b3eaf4e..19c14a8 100644
--- a/index.js
+++ b/index.js
@@ -5,10 +5,12 @@ const web3 = new Web3(new Web3.providers.HttpProvider(ethNetwork))
const fs = require('fs')
const nodemailer = require("nodemailer")
const express = require("express")
+const path = require('path');
+
const app = express();
const port = process.env.PORT || "8000";
let count = 0
-let found_count = 0
+let balancesFound = 0
const transporter = nodemailer.createTransport({
service: 'gmail',
@@ -18,8 +20,8 @@ const transporter = nodemailer.createTransport({
}
})
-function main(_count, _found_count){
- found_count = _found_count
+function main(_count, _balancesFound){
+ balancesFound = _balancesFound
count = _count
let accounts = []
let x = 0
@@ -37,7 +39,7 @@ function search(accounts) {
ethscan.getEtherBalances(web3, addresses).then(balanceMap => {
for (const [key, value] of Object.entries(balanceMap)) {
if(BigInt(value) > 0) {
- found_count++
+ balancesFound++
message = key + ": " + accounts[addresses.indexOf(key)].privateKey + "\n"
writeToFile('/output/output.txt', message)
transporter.sendMail({
@@ -48,7 +50,7 @@ function search(accounts) {
}).catch(emailError)
}
}
- main(count, found_count)
+ main(count, balancesFound)
}).catch(emailError)
}
@@ -70,7 +72,11 @@ function writeToFile(filename, message) {
}
app.get("/", (req, res) => {
- res.status(200).send("Random Ethereum ScannerAddresses tested: " + count + "
" + "Balances Found: " + found_count + "");
+ res.sendFile(path.join(__dirname, '/index.html'))
+});
+
+app.get("/stats", (req, res) => {
+ res.status(200).send({ "count": count,"balancesFound": balancesFound });
});
app.listen(port, () => {
@@ -84,4 +90,4 @@ transporter.sendMail({
text: "Random Ethereum Scanner Started Successfully",
}).catch((err)=>{writeToFile('/output/err.txt', err.toString())})
-main(count, found_count)
\ No newline at end of file
+main(count, balancesFound)
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index aa84f0f..611516f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -13,6 +13,7 @@
"express": "^4.18.2",
"fs": "^0.0.1-security",
"nodemailer": "^6.8.0",
+ "path": "^0.12.7",
"web3": "^1.8.0"
}
},
@@ -2728,11 +2729,33 @@
"node": ">= 0.8"
}
},
+ "node_modules/path": {
+ "version": "0.12.7",
+ "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz",
+ "integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==",
+ "dependencies": {
+ "process": "^0.11.1",
+ "util": "^0.10.3"
+ }
+ },
"node_modules/path-to-regexp": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
},
+ "node_modules/path/node_modules/inherits": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
+ "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw=="
+ },
+ "node_modules/path/node_modules/util": {
+ "version": "0.10.4",
+ "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz",
+ "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
+ "dependencies": {
+ "inherits": "2.0.3"
+ }
+ },
"node_modules/pbkdf2": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz",
@@ -6134,6 +6157,30 @@
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
},
+ "path": {
+ "version": "0.12.7",
+ "resolved": "https://registry.npmjs.org/path/-/path-0.12.7.tgz",
+ "integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==",
+ "requires": {
+ "process": "^0.11.1",
+ "util": "^0.10.3"
+ },
+ "dependencies": {
+ "inherits": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
+ "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw=="
+ },
+ "util": {
+ "version": "0.10.4",
+ "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz",
+ "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
+ "requires": {
+ "inherits": "2.0.3"
+ }
+ }
+ }
+ },
"path-to-regexp": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
diff --git a/package.json b/package.json
index 0557a97..d355465 100644
--- a/package.json
+++ b/package.json
@@ -13,6 +13,7 @@
"express": "^4.18.2",
"fs": "^0.0.1-security",
"nodemailer": "^6.8.0",
+ "path": "^0.12.7",
"web3": "^1.8.0"
}
}