first commit
This commit is contained in:
commit
c61b6bf40c
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
mc/
|
38
server.py
Normal file
38
server.py
Normal file
@ -0,0 +1,38 @@
|
||||
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()
|
252
server/countrycode.json
Normal file
252
server/countrycode.json
Normal file
@ -0,0 +1,252 @@
|
||||
{
|
||||
"BD": "Bangladesh",
|
||||
"BE": "Belgium",
|
||||
"BF": "Burkina Faso",
|
||||
"BG": "Bulgaria",
|
||||
"BA": "Bosnia and Herzegovina",
|
||||
"BB": "Barbados",
|
||||
"WF": "Wallis and Futuna",
|
||||
"BL": "Saint Barthelemy",
|
||||
"BM": "Bermuda",
|
||||
"BN": "Brunei",
|
||||
"BO": "Bolivia",
|
||||
"BH": "Bahrain",
|
||||
"BI": "Burundi",
|
||||
"BJ": "Benin",
|
||||
"BT": "Bhutan",
|
||||
"JM": "Jamaica",
|
||||
"BV": "Bouvet Island",
|
||||
"BW": "Botswana",
|
||||
"WS": "Samoa",
|
||||
"BQ": "Bonaire, Saint Eustatius and Saba ",
|
||||
"BR": "Brazil",
|
||||
"BS": "Bahamas",
|
||||
"JE": "Jersey",
|
||||
"BY": "Belarus",
|
||||
"BZ": "Belize",
|
||||
"RU": "Russia",
|
||||
"RW": "Rwanda",
|
||||
"RS": "Serbia",
|
||||
"TL": "East Timor",
|
||||
"RE": "Reunion",
|
||||
"TM": "Turkmenistan",
|
||||
"TJ": "Tajikistan",
|
||||
"RO": "Romania",
|
||||
"TK": "Tokelau",
|
||||
"GW": "Guinea-Bissau",
|
||||
"GU": "Guam",
|
||||
"GT": "Guatemala",
|
||||
"GS": "South Georgia and the South Sandwich Islands",
|
||||
"GR": "Greece",
|
||||
"GQ": "Equatorial Guinea",
|
||||
"GP": "Guadeloupe",
|
||||
"JP": "Japan",
|
||||
"GY": "Guyana",
|
||||
"GG": "Guernsey",
|
||||
"GF": "French Guiana",
|
||||
"GE": "Georgia",
|
||||
"GD": "Grenada",
|
||||
"GB": "United Kingdom",
|
||||
"GA": "Gabon",
|
||||
"SV": "El Salvador",
|
||||
"GN": "Guinea",
|
||||
"GM": "Gambia",
|
||||
"GL": "Greenland",
|
||||
"GI": "Gibraltar",
|
||||
"GH": "Ghana",
|
||||
"OM": "Oman",
|
||||
"TN": "Tunisia",
|
||||
"JO": "Jordan",
|
||||
"HR": "Croatia",
|
||||
"HT": "Haiti",
|
||||
"HU": "Hungary",
|
||||
"HK": "Hong Kong",
|
||||
"HN": "Honduras",
|
||||
"HM": "Heard Island and McDonald Islands",
|
||||
"VE": "Venezuela",
|
||||
"PR": "Puerto Rico",
|
||||
"PS": "Palestinian Territory",
|
||||
"PW": "Palau",
|
||||
"PT": "Portugal",
|
||||
"SJ": "Svalbard and Jan Mayen",
|
||||
"PY": "Paraguay",
|
||||
"IQ": "Iraq",
|
||||
"PA": "Panama",
|
||||
"PF": "French Polynesia",
|
||||
"PG": "Papua New Guinea",
|
||||
"PE": "Peru",
|
||||
"PK": "Pakistan",
|
||||
"PH": "Philippines",
|
||||
"PN": "Pitcairn",
|
||||
"PL": "Poland",
|
||||
"PM": "Saint Pierre and Miquelon",
|
||||
"ZM": "Zambia",
|
||||
"EH": "Western Sahara",
|
||||
"EE": "Estonia",
|
||||
"EG": "Egypt",
|
||||
"ZA": "South Africa",
|
||||
"EC": "Ecuador",
|
||||
"IT": "Italy",
|
||||
"VN": "Vietnam",
|
||||
"SB": "Solomon Islands",
|
||||
"ET": "Ethiopia",
|
||||
"SO": "Somalia",
|
||||
"ZW": "Zimbabwe",
|
||||
"SA": "Saudi Arabia",
|
||||
"ES": "Spain",
|
||||
"ER": "Eritrea",
|
||||
"ME": "Montenegro",
|
||||
"MD": "Moldova",
|
||||
"MG": "Madagascar",
|
||||
"MF": "Saint Martin",
|
||||
"MA": "Morocco",
|
||||
"MC": "Monaco",
|
||||
"UZ": "Uzbekistan",
|
||||
"MM": "Myanmar",
|
||||
"ML": "Mali",
|
||||
"MO": "Macao",
|
||||
"MN": "Mongolia",
|
||||
"MH": "Marshall Islands",
|
||||
"MK": "Macedonia",
|
||||
"MU": "Mauritius",
|
||||
"MT": "Malta",
|
||||
"MW": "Malawi",
|
||||
"MV": "Maldives",
|
||||
"MQ": "Martinique",
|
||||
"MP": "Northern Mariana Islands",
|
||||
"MS": "Montserrat",
|
||||
"MR": "Mauritania",
|
||||
"IM": "Isle of Man",
|
||||
"UG": "Uganda",
|
||||
"TZ": "Tanzania",
|
||||
"MY": "Malaysia",
|
||||
"MX": "Mexico",
|
||||
"IL": "Israel",
|
||||
"FR": "France",
|
||||
"IO": "British Indian Ocean Territory",
|
||||
"SH": "Saint Helena",
|
||||
"FI": "Finland",
|
||||
"FJ": "Fiji",
|
||||
"FK": "Falkland Islands",
|
||||
"FM": "Micronesia",
|
||||
"FO": "Faroe Islands",
|
||||
"NI": "Nicaragua",
|
||||
"NL": "Netherlands",
|
||||
"NO": "Norway",
|
||||
"NA": "Namibia",
|
||||
"VU": "Vanuatu",
|
||||
"NC": "New Caledonia",
|
||||
"NE": "Niger",
|
||||
"NF": "Norfolk Island",
|
||||
"NG": "Nigeria",
|
||||
"NZ": "New Zealand",
|
||||
"NP": "Nepal",
|
||||
"NR": "Nauru",
|
||||
"NU": "Niue",
|
||||
"CK": "Cook Islands",
|
||||
"XK": "Kosovo",
|
||||
"CI": "Ivory Coast",
|
||||
"CH": "Switzerland",
|
||||
"CO": "Colombia",
|
||||
"CN": "China",
|
||||
"CM": "Cameroon",
|
||||
"CL": "Chile",
|
||||
"CC": "Cocos Islands",
|
||||
"CA": "Canada",
|
||||
"CG": "Republic of the Congo",
|
||||
"CF": "Central African Republic",
|
||||
"CD": "Democratic Republic of the Congo",
|
||||
"CZ": "Czech Republic",
|
||||
"CY": "Cyprus",
|
||||
"CX": "Christmas Island",
|
||||
"CR": "Costa Rica",
|
||||
"CW": "Curacao",
|
||||
"CV": "Cape Verde",
|
||||
"CU": "Cuba",
|
||||
"SZ": "Swaziland",
|
||||
"SY": "Syria",
|
||||
"SX": "Sint Maarten",
|
||||
"KG": "Kyrgyzstan",
|
||||
"KE": "Kenya",
|
||||
"SS": "South Sudan",
|
||||
"SR": "Suriname",
|
||||
"KI": "Kiribati",
|
||||
"KH": "Cambodia",
|
||||
"KN": "Saint Kitts and Nevis",
|
||||
"KM": "Comoros",
|
||||
"ST": "Sao Tome and Principe",
|
||||
"SK": "Slovakia",
|
||||
"KR": "South Korea",
|
||||
"SI": "Slovenia",
|
||||
"KP": "North Korea",
|
||||
"KW": "Kuwait",
|
||||
"SN": "Senegal",
|
||||
"SM": "San Marino",
|
||||
"SL": "Sierra Leone",
|
||||
"SC": "Seychelles",
|
||||
"KZ": "Kazakhstan",
|
||||
"KY": "Cayman Islands",
|
||||
"SG": "Singapore",
|
||||
"SE": "Sweden",
|
||||
"SD": "Sudan",
|
||||
"DO": "Dominican Republic",
|
||||
"DM": "Dominica",
|
||||
"DJ": "Djibouti",
|
||||
"DK": "Denmark",
|
||||
"VG": "British Virgin Islands",
|
||||
"DE": "Germany",
|
||||
"YE": "Yemen",
|
||||
"DZ": "Algeria",
|
||||
"US": "United States",
|
||||
"UY": "Uruguay",
|
||||
"YT": "Mayotte",
|
||||
"UM": "United States Minor Outlying Islands",
|
||||
"LB": "Lebanon",
|
||||
"LC": "Saint Lucia",
|
||||
"LA": "Laos",
|
||||
"TV": "Tuvalu",
|
||||
"TW": "Taiwan",
|
||||
"TT": "Trinidad and Tobago",
|
||||
"TR": "Turkey",
|
||||
"LK": "Sri Lanka",
|
||||
"LI": "Liechtenstein",
|
||||
"LV": "Latvia",
|
||||
"TO": "Tonga",
|
||||
"LT": "Lithuania",
|
||||
"LU": "Luxembourg",
|
||||
"LR": "Liberia",
|
||||
"LS": "Lesotho",
|
||||
"TH": "Thailand",
|
||||
"TF": "French Southern Territories",
|
||||
"TG": "Togo",
|
||||
"TD": "Chad",
|
||||
"TC": "Turks and Caicos Islands",
|
||||
"LY": "Libya",
|
||||
"VA": "Vatican",
|
||||
"VC": "Saint Vincent and the Grenadines",
|
||||
"AE": "United Arab Emirates",
|
||||
"AD": "Andorra",
|
||||
"AG": "Antigua and Barbuda",
|
||||
"AF": "Afghanistan",
|
||||
"AI": "Anguilla",
|
||||
"VI": "U.S. Virgin Islands",
|
||||
"IS": "Iceland",
|
||||
"IR": "Iran",
|
||||
"AM": "Armenia",
|
||||
"AL": "Albania",
|
||||
"AO": "Angola",
|
||||
"AQ": "Antarctica",
|
||||
"AS": "American Samoa",
|
||||
"AR": "Argentina",
|
||||
"AU": "Australia",
|
||||
"AT": "Austria",
|
||||
"AW": "Aruba",
|
||||
"IN": "India",
|
||||
"AX": "Aland Islands",
|
||||
"AZ": "Azerbaijan",
|
||||
"IE": "Ireland",
|
||||
"ID": "Indonesia",
|
||||
"UA": "Ukraine",
|
||||
"QA": "Qatar",
|
||||
"MZ": "Mozambique"
|
||||
}
|
72
server/index.js
Normal file
72
server/index.js
Normal file
@ -0,0 +1,72 @@
|
||||
const express = require('express'),
|
||||
sqlite3 = require('sqlite3'),
|
||||
bodyParser = require('body-parser'),
|
||||
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")
|
||||
.setUsername("TaxenHeimer")
|
||||
.setAvatar("https://cdn.discordapp.com/attachments/999167321631363126/999495738943868928/nn.png")
|
||||
app.use(bodyParser.json())
|
||||
app.use(bodyParser.urlencoded({extended: true}))
|
||||
db = new sqlite3.Database('./servers.db')
|
||||
db.exec(`CREATE TABLE IF NOT EXISTS servers (
|
||||
host text not null,
|
||||
version text not null,
|
||||
players text not null,
|
||||
playerlist text not null,
|
||||
ping text not null,
|
||||
motd text not null,
|
||||
timestamp text not null
|
||||
)`)
|
||||
function countrify(code) {
|
||||
var config = require('./countrycode.json')
|
||||
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;
|
||||
mc.status(server, 25565, {enableSRV: true}).then(res => {
|
||||
var playerlist = ""
|
||||
if (res.players.sample != null) {
|
||||
res.players.sample.forEach(e => playerlist += `${e.name}::${e.id}\n`)
|
||||
} else {
|
||||
playerlist += "No players"
|
||||
}
|
||||
var ip = geoip.lookup(server)
|
||||
if (res.motd.clean.includes("'")) var cleanmotd = res.motd.clean.replace(/'/g, "\\'")
|
||||
else cleanmotd = res.motd.clean
|
||||
if (res.motd.clean.includes('-')) var cleanmotd = res.motd.clean.replace(/-/g, '\\-')
|
||||
else cleanmotd = res.motd.clean
|
||||
db.exec(`INSERT INTO servers VALUES (
|
||||
'${server}:25565',
|
||||
'${res.version.name}',
|
||||
'${res.players.online}/${res.players.max}',
|
||||
'${playerlist}',
|
||||
'${res.roundTripLatency}ms',
|
||||
'${cleanmotd}',
|
||||
'${(new Date()).toLocaleDateString('en-US')}'
|
||||
)`)
|
||||
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()
|
||||
webhook.send(embed)
|
||||
})
|
||||
})
|
||||
app.listen(9000, () => {
|
||||
console.clear()
|
||||
console.log("server ready")
|
||||
})
|
||||
process.on("unhandledRejection", callback => {})
|
||||
process.on("uncaughtException", callback => {})
|
BIN
server/nn.png
Normal file
BIN
server/nn.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
BIN
server/servers.db
Normal file
BIN
server/servers.db
Normal file
Binary file not shown.
3
server/test.js
Normal file
3
server/test.js
Normal file
@ -0,0 +1,3 @@
|
||||
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