mirror of
https://github.com/xnite/MCSeeker.git
synced 2026-05-02 12:54:50 -07:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1379038a4 | ||
|
|
d522d490eb | ||
|
|
625567ae1a | ||
|
|
344b583499 | ||
|
|
2451ec794a | ||
|
|
a5dc543cf4 | ||
|
|
b13e690eda | ||
|
|
73afc74074 | ||
|
|
f05b17ee9a |
14
README.md
14
README.md
@@ -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.
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
10
scanner.js
10
scanner.js
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user