basic commit
This commit is contained in:
parent
f13fa2d0f4
commit
e5b9b11823
7
.gitignore
vendored
7
.gitignore
vendored
@ -1,4 +1,9 @@
|
||||
mc/
|
||||
server/test.js
|
||||
server/servers.db
|
||||
ip.txt
|
||||
ip.txt
|
||||
server/node_modules
|
||||
nimscan/bin
|
||||
.vscode
|
||||
server_backup
|
||||
old_tests
|
54
nimscan/IPgen.nim
Normal file
54
nimscan/IPgen.nim
Normal file
@ -0,0 +1,54 @@
|
||||
import std/[random, strutils, os, net, locks, httpclient, json]
|
||||
|
||||
proc status(targetIP: string): bool {.gcsafe.}=
|
||||
var client = newSocket()
|
||||
try:
|
||||
client.connect(targetIP, Port(25565), 1500)
|
||||
client.send($((char)0xFE))
|
||||
if (client.recv(256, 1000)[0] == (char)0xFF):
|
||||
return true
|
||||
except Exception:
|
||||
return false
|
||||
finally:
|
||||
client.close()
|
||||
|
||||
proc GenerateIP(): string {.gcsafe.} =
|
||||
randomize()
|
||||
var
|
||||
ip0 = rand(255)
|
||||
ip1 = rand(255)
|
||||
ip2 = rand(255)
|
||||
ip3 = rand(255)
|
||||
return (join([$ip0, $ip1, $ip2, $ip3], "."))
|
||||
|
||||
proc hit(host: string) {.gcsafe.} =
|
||||
echo "[+] Hit on ", host
|
||||
var client = newHttpClient()
|
||||
try:
|
||||
client.headers = newHttpHeaders({"Content-Type": "application/json"})
|
||||
let body = %*{
|
||||
"server": host
|
||||
}
|
||||
let res = client.request("http://localhost:9000/server", HttpPost, $body)
|
||||
discard res
|
||||
except Exception as e:
|
||||
echo e.msg
|
||||
discard
|
||||
|
||||
proc main(): void {.thread.} =
|
||||
while true:
|
||||
var ip = GenerateIP()
|
||||
var ping = status(ip)
|
||||
if ping:
|
||||
hit(ip)
|
||||
discard
|
||||
|
||||
var cmd = os.execShellCmd("clear")
|
||||
var cLock: Lock
|
||||
initLock(cLock)
|
||||
var thread: Thread[void]
|
||||
|
||||
for i in 0..300:
|
||||
createThread[void](thread, main)
|
||||
|
||||
joinThreads(thread)
|
1
nimscan/config.nims
Normal file
1
nimscan/config.nims
Normal file
@ -0,0 +1 @@
|
||||
--threads:on
|
38
server.py
38
server.py
@ -1,38 +0,0 @@
|
||||
import random,os,threading,requests
|
||||
from mcstatus import JavaServer
|
||||
def threaded(func):
|
||||
def wrapper(*_args, **kwargs):
|
||||
t = threading.Thread(target=func, args=_args)
|
||||
t.start()
|
||||
return
|
||||
return wrapper
|
||||
|
||||
def hit(host):
|
||||
with open("./ip.txt", "a") as f:
|
||||
f.write(f"{host}\n")
|
||||
print(f"[+] Hit on {host}")
|
||||
requests.post('http://localhost:9000/server', data={"server": host}, headers={"authorization": "13ADAFE6492EC9C4A04E9F9677687C4CA647931CD43E87419349CDDA69AEA9B9DBFE689EAC381DE10BFF9E9891175E6205DECAF0AB05A9698CA77F78FC7EE7A1"})
|
||||
|
||||
def generateIP():
|
||||
ip = ".".join(map(str, (random.randint(0, 255) for _ in range(4))))
|
||||
return ip
|
||||
|
||||
with open('./ip.txt', 'r') as f:
|
||||
arab = f.read()
|
||||
|
||||
@threaded
|
||||
def lookup():
|
||||
ip = generateIP()
|
||||
if ip in arab:
|
||||
pass
|
||||
try:
|
||||
server = JavaServer.lookup(ip + ":25565")
|
||||
if server.ping():
|
||||
hit(ip)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if __name__ == '__main__':
|
||||
os.system("clear")
|
||||
while True:
|
||||
lookup()
|
5
server/config.json
Normal file
5
server/config.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"main": "https://discord.com/api/webhooks/999381041041129573/5vmF56GsDdg8D3HJWnu-pRsBmxqPqnzHBTQAu1yLcZQ93xhR36V2UUUVNhRrAHZQyKzA",
|
||||
"neit": "https://discord.com/api/webhooks/1000916905600761887/yeC4nbJYeS38JlNdI42dh8cfcmeX0SZeFSvqmeCIdCZJtJewkq6DjIMXAjwmBhF65XtA",
|
||||
"fronce": "https://discord.com/api/webhooks/1000903130222952518/cRK-SXahsWl8OT_N4HLnt7I0JebGnQh0gN3p3iOvCW_QIVC7hq2oWlmt6txC7NSXtv55"
|
||||
}
|
@ -4,10 +4,18 @@ const express = require('express'),
|
||||
app = express(),
|
||||
mc = require('minecraft-server-util'),
|
||||
discord = require('discord-webhook-node'),
|
||||
geoip = require('geoip-lite')
|
||||
var webhook = new discord.Webhook("https://discord.com/api/webhooks/999381041041129573/5vmF56GsDdg8D3HJWnu-pRsBmxqPqnzHBTQAu1yLcZQ93xhR36V2UUUVNhRrAHZQyKzA")
|
||||
geoip = require('geoip-lite'),
|
||||
fs = require('fs'),
|
||||
config = require('./config.json')
|
||||
var webhook = new discord.Webhook(config.main)
|
||||
.setUsername("TaxenHeimer")
|
||||
.setAvatar("https://cdn.discordapp.com/attachments/999167321631363126/999495738943868928/nn.png")
|
||||
var webhookfronce = new discord.Webhook(config.fronce)
|
||||
.setAvatar("https://cdn.discordapp.com/attachments/999167321631363126/999495738943868928/nn.png")
|
||||
.setUsername("TaxenHeimer")
|
||||
var neithook = new discord.Webhook(config.neit)
|
||||
.setAvatar("https://cdn.discordapp.com/attachments/999167321631363126/999495738943868928/nn.png")
|
||||
.setUsername("TaxenHeimer")
|
||||
app.use(bodyParser.json())
|
||||
app.use(bodyParser.urlencoded({extended: true}))
|
||||
db = new sqlite3.Database('./servers.db')
|
||||
@ -25,9 +33,11 @@ function countrify(code) {
|
||||
return config[code]
|
||||
}
|
||||
app.post('/server', async(req, res) => {
|
||||
if (req.headers.authorization != "13ADAFE6492EC9C4A04E9F9677687C4CA647931CD43E87419349CDDA69AEA9B9DBFE689EAC381DE10BFF9E9891175E6205DECAF0AB05A9698CA77F78FC7EE7A1") return res.status(404)
|
||||
var server = req.body.server
|
||||
if (!server) return;
|
||||
if (!server) return res.send("specify a server")
|
||||
var ipfile = fs.readFileSync(`${__dirname}/ip.txt`, 'utf8')
|
||||
if (ipfile.includes(server)) return;
|
||||
res.send("allah")
|
||||
mc.status(server, 25565, {enableSRV: true}).then(res => {
|
||||
var playerlist = ""
|
||||
if (res.players.sample != null) {
|
||||
@ -49,6 +59,37 @@ app.post('/server', async(req, res) => {
|
||||
'${cleanmotd}',
|
||||
'${(new Date()).toLocaleDateString('en-US')}'
|
||||
)`)
|
||||
if (ip.country === "FR") {
|
||||
const embed = new discord.MessageBuilder()
|
||||
.setTitle("TaxenHeimer")
|
||||
.setColor("#00ff00")
|
||||
.addField("**Host**", `\`${server}:25565\``, true)
|
||||
.addField("**Country**", `\`${countrify(ip.country)}\``)
|
||||
.addField("**Version**", `\`${res.version.name} (${res.version.protocol})\``, true)
|
||||
.addField("**Players**", `\`${res.players.online}/${res.players.max}\``, true)
|
||||
.addField("**Ping**", `\`${res.roundTripLatency}ms\``, true)
|
||||
.addField("**Motd**", "```\n"+res.motd.clean+"\n```")
|
||||
.addField("**Playerlist Sample**", "```\n"+playerlist+"\n```")
|
||||
.addField("**IP Range**", "```\n" + geoip.pretty(ip.range[0]) + " - " + geoip.pretty(ip.range[1]) + "```")
|
||||
.setTimestamp()
|
||||
webhookfronce.send(embed)
|
||||
}
|
||||
if (res.version.name.includes("1.17")) {
|
||||
const embed = new discord.MessageBuilder()
|
||||
.setText("<@390491795655622657>")
|
||||
.setTitle("TaxenHeimer")
|
||||
.setColor("#00ff00")
|
||||
.addField("**Host**", `\`${server}:25565\``, true)
|
||||
.addField("**Country**", `\`${countrify(ip.country)}\``)
|
||||
.addField("**Version**", `\`${res.version.name} (${res.version.protocol})\``, true)
|
||||
.addField("**Players**", `\`${res.players.online}/${res.players.max}\``, true)
|
||||
.addField("**Ping**", `\`${res.roundTripLatency}ms\``, true)
|
||||
.addField("**Motd**", "```\n"+res.motd.clean+"\n```")
|
||||
.addField("**Playerlist Sample**", "```\n"+playerlist+"\n```")
|
||||
.addField("**IP Range**", "```\n" + geoip.pretty(ip.range[0]) + " - " + geoip.pretty(ip.range[1]) + "```")
|
||||
.setTimestamp()
|
||||
neithook.send(embed)
|
||||
}
|
||||
const embed = new discord.MessageBuilder()
|
||||
.setTitle("TaxenHeimer")
|
||||
.setColor("#00ff00")
|
||||
@ -62,7 +103,8 @@ app.post('/server', async(req, res) => {
|
||||
.addField("**IP Range**", "```\n" + geoip.pretty(ip.range[0]) + " - " + geoip.pretty(ip.range[1]) + "```")
|
||||
.setTimestamp()
|
||||
webhook.send(embed)
|
||||
})
|
||||
fs.appendFileSync(`${server}\n`)
|
||||
}).catch(e => {})
|
||||
})
|
||||
app.listen(9000, () => {
|
||||
console.clear()
|
||||
|
3456
server/package-lock.json
generated
Normal file
3456
server/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
21
server/package.json
Normal file
21
server/package.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "taxenheimer",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "nodemon index",
|
||||
"compile": "bytenode --compile index.js",
|
||||
"runc": "bytenode index.js"
|
||||
},
|
||||
"author": "TaxMachine",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"body-parser": "^1.20.0",
|
||||
"bytenode": "^1.3.6",
|
||||
"discord-webhook-node": "^1.1.8",
|
||||
"express": "^4.18.1",
|
||||
"geoip-lite": "^1.4.5",
|
||||
"sqlite3": "^5.0.10"
|
||||
}
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
var mc = require('minecraft-server-util')
|
||||
|
||||
mc.queryFull('185.236.139.101', 25565).then(res => console.log(res))
|
Loading…
Reference in New Issue
Block a user