9 Commits

Author SHA1 Message Date
Robert Whitney
e1379038a4 derp 2024-12-23 02:52:38 -08:00
Robert Whitney
d522d490eb Merge pull request #8 from rileyscool/master
fix package.json
2024-12-22 18:58:14 -08:00
Riley
625567ae1a Update scanner.js
fix bug where there is no output if you select show-desc
2024-12-23 14:53:29 +13:00
Riley
344b583499 fix package.json
zlib package tries to use an old thing to build and you cant install dependencies
2024-12-23 14:12:14 +13:00
Robert Whitney
2451ec794a Update README.md 2024-12-22 06:20:25 -08:00
Robert Whitney
a5dc543cf4 Update README.md 2024-12-22 00:53:23 -08:00
Robert Whitney
b13e690eda Merge pull request #6 from etianl/master 2023-01-06 04:34:50 -06:00
etianl
73afc74074 forgot a +
derp
2023-01-06 01:55:43 -08:00
etianl
f05b17ee9a Option for how many concurrent connections to use.
Can increase scan efficiency with higher numbers, or you can reduce the amount of connections for use on terrible internet connections. Default is 256
2023-01-06 01:49:31 -08:00
3 changed files with 18 additions and 11 deletions

View File

@@ -1,10 +1,13 @@
# What is this?
This scans for MineCraft servers... really really fast!
This scans for MineCraft servers... really really fast! [but this scans even faster](https://github.com/xnite/BBCrawler)
# Getting Started
* Clone this repository somewhere.
* Run `npm install` from within this directory.
## Getting Help
You can get help through our [Discord server](https://discord.gg/3RUjaRzdKv)
## Usage
Run `node ./scanner.js [options] --ip <ip range>`
@@ -12,12 +15,14 @@ Run `node ./scanner.js [options] --ip <ip range>`
`node ./scanner.js --ip 192.168.1.0/24 --port 25565-25569 --show-desc --min-players 1 --max-players 100 --out report.csv`
`node ./scanner.js --ip 192.168.1.0/24 --port 25565-25569 --show-desc --min-players 1 --max-players 100 --version '1.8.*' --out 1.8.x-servers.csv`
`node ./scanner.js --ip 192.168.1.0/24 --port 25565-25569 --show-desc --min-players 1 --max-players 100 --version '*forge*' --out forge-servers.csv`
### CLI Options
### Options
* `--ip <ip>` - IP Address or Range of IP Addresses with CIDR notation (eg- 192.168.1.0/24)
* `--port <ports>` - Ports to look for minecraft servers on. (Default: `25565-25566`)
* `--min-players <count>` - Minimum number of players.
* `--max-players <count>` - Maximum player count.
* `--version <glob expression>` - Glob expression to filter version (eg- `1.19.*`, or `1.1*.*`). (Default: `*`)
* `--conc <howmany>` - How many concurrent connections to use for scanning. (Default is 256)
#### Output Options
* `--show-desc` - Enable showing of server description in output.
@@ -47,5 +52,6 @@ Run `node ./scanner.js [options] --ip <ip range>`
In this example it took `3.183` seconds to scan `255` IP addresses, and find `85` MineCraft servers. At this speed, a full `/16` (`123.45.0.0 - 123.45.255.255`) will take about `13.5` minutes to scan.
## Limitations
* Fails to scan more than a /16 without kicking the bucket... so you should probably stick to that or smaller ranges.
* Working on a Minecraft bot client... doesn't work though... you can see how badly it doesn't work by using `--enable-client` flag... it is totally broken. **Don't use it**.
* Fails to scan more than a /10 without kicking the bucket... so you should probably stick to that or smaller ranges.
* Working on a Minecraft bot client... doesn't work though... you can see how badly it doesn't work by using `--enable-client` flag... it is totally broken. **Don't use it**.
* Above limitations are solved by running [BBCrawler](https://github.com/xnite/BBCrawler) instead but that is more complex than most people will want.

View File

@@ -13,7 +13,6 @@
"mineflayer": "^4.0.0",
"minimatch": "^3.0.4",
"node-mcpe-color-parser": "^0.1.1",
"tar-stream": "^2.2.0",
"zlib": "^1.0.5"
"tar-stream": "^2.2.0"
}
}
}

View File

@@ -13,6 +13,7 @@ var SCAN_OPTS_HOSTS = (process.params['ip']||'0.0.0.0/0').toString();
var SCAN_OPTS_PORTS = (process.params['port'] || MINECRAFT_DEFAULT_PORT).toString();
var SCAN_OPTS_OUTPUT_CSV = (process.params['out']||null);
var SCAN_OPTS_VERSION_FILTER = (process.params['version']||'*');
var SCAN_OPTS_CONCURRENCY = (process.params['conc'] || 256);
var CLIENT_TOKEN;
if(process.params['geo-ip'])
@@ -88,14 +89,14 @@ if(process.params['enable-client'] && !process.params['client-token'])
});
}
console.log("Scanning ports " + SCAN_OPTS_PORTS + " on " + SCAN_OPTS_HOSTS);
console.log("Scanning ports " + SCAN_OPTS_PORTS + " on " + SCAN_OPTS_HOSTS + " with " + SCAN_OPTS_CONCURRENCY + " connections.");
var options = {
target: SCAN_OPTS_HOSTS,
port: SCAN_OPTS_PORTS,
states: 'O',
banner: false,
concurrency: 256
concurrency: SCAN_OPTS_CONCURRENCY
}
var scan = new Scanner(options);
@@ -126,7 +127,8 @@ scan.on('result', function(data){
var theText = data.ip + ":" + data.port + "\t" + pingRes.version.name + "\t" + pingRes.players.online + " of " + pingRes.players.max + " players";
if(process.params['show-desc'])
{
theText += "\t"+mcp(pingRes.description.text).replace(/\n/g, ' ');
theText += "\t"+mcp(pingRes.description).replace(/\n/g, ' ');
// pingRes.description is a string, not an object
}
if (SCAN_OPTS_OUTPUT_CSV)
{
@@ -228,4 +230,4 @@ scan.on('error', err => {
scan.on('done', () => {
console.log("Scan finished!");
});
scan.run();
scan.run();