This commit is contained in:
lolcat 2023-07-22 14:51:57 -04:00
commit 52e546f286
360 changed files with 528 additions and 0 deletions

BIN
COMIC.TTF Executable file

Binary file not shown.

7
LICENSE.txt Executable file
View File

@ -0,0 +1,7 @@
Copyright © 2022 lolcatw
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

28
README.md Executable file
View File

@ -0,0 +1,28 @@
# Mumble ping API
A simple PHP module to ping mumble serbers.
## How to install
1. Run this thing: `git clone https://git.lolcat.ca/lolcat/mumble-ping/`
2. Download the latest release of geoip2.phar: https://github.com/maxmind/GeoIP2-php/releases
3. Sign up for maxmind's bullshit site and get the **country** GeoLite2 .mmdb file
4. Make sure curl is installed. `sudo apt install curl php-curl` should set everything up.
5. Drop all the shit you downloaded in the root of this repo
Now, just drop all of that crap inside a webserber that supports PHP and access the mumble.php file.
Don't forget to make mumble-scrape inaccessible!
To be able to show users the serber name and website, you need to scrape the official mumble serber list using mumble-scrape.php. This repo comes with a pre-compiled list.json, but it is probably outdated. Use `screen` and run mumble-scrape.php in the background. By default, it gets a list of all serbers every 24 hours and resolves the DNS for all domains!
## Usage
`/mumble.php?ip=lolcat.ca`
or
`/mumble.php?ip=skyn3t.in&port=64738`
or for banners: `/banner.php?ip=aaathats3as.com`
So yeah, the port is optional. IPs and port is sanitized.
## Try it out
https://lolcat.ca/mumble_ping_api/
Enjoy!!

125
banner.php Executable file
View File

@ -0,0 +1,125 @@
<?php
include "mumble-ping.php";
// load
try{
$mumble = new mumble("GeoLite2-Country.mmdb");
$res = $mumble->ping(
$_GET["ip"],
isset($_GET["port"]) ? $_GET["port"] : 64738,
);
if($res["server"]["name"] !== null){
$str = $res["server"]["name"];
}else{
$str = "Unknown serber name!!";
if(isset($_GET["name"])){
$str = $_GET["name"];
}
}
}catch(Exception $error){
$ip = isset($_GET["ip"]) ? $_GET["ip"] : "Unknown address";
$port = isset($_GET["port"]) ? $_GET["port"] : "???";
http_response_code(404);
$res = [
"server" => [
"online" => "0",
"max" => "0",
"domains" => [ $ip ],
"port" => $port,
"country" => [
"code" => "blank"
]
]
];
$str = "Host unreachable!!";
}
$im = new Imagick();
$im->newImage(468, 60, "#282828");
$im->setImageFormat("png");
// bg
$bg = new Imagick("bg.png");
$im->compositeImage($bg, imagick::COMPOSITE_OVER, 367, 1);
// text
$stroke = new ImagickDraw();
$stroke->setStrokeColor("#504945");
$stroke->setFillColor("transparent");
$stroke->rectangle(0, 0, 467, 59);
$im->drawImage($stroke);
$draw = new ImagickDraw();
$draw->setFillColor("#ebdbb2");
$draw->setFontSize(13);
$draw->setFont("COMIC.TTF");
$newstr = "";
if(strlen($str) > 84){
for($i=0; $i<84; $i++){
$newstr .= $str[$i];
}
$str = trim($newstr) . "...";
unset($newstr);
}
$str = trim($str);
$str = explode("\n", wordwrap($str, 45, "\n", true));
if(count($str) === 1){
$im->annotateImage($draw, 5, 25, 0, $str[0]);
}else{
for($i=0; $i<2; $i++){
$im->annotateImage($draw, 5, (16 * $i) + 15, 0, $str[$i]);
}
}
// flag
if(idate("m") === 11){
$path = "flag/xmas/";
}else{
$path = "flag/";
}
$merge = new Imagick($path . strtolower($res["server"]["country"]["code"]) . ".png");
$height = $merge->getImageHeight();
$im->compositeImage($merge, imagick::COMPOSITE_OVER, 5, 46 - ($height / 2));
// ip
$draw->setFillColor("#bdae93");
$im->annotateImage($draw, 30, 51, 0, $res["server"]["domains"][0]);
// users
if($res["server"]["online"] > 0){
$name = "buddy.png";
}else{
$name = "buddy_alone.png";
}
$buddy = new Imagick($name);
$im->compositeImage($buddy, imagick::COMPOSITE_OVER, 340, 40);
$im->annotateImage($draw, 360, 53, 0, $res["server"]["online"] . "/" . $res["server"]["max"]);
// done.
header("Content-Type: image/png");
echo $im->getImageBlob();
?>

BIN
bg.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

BIN
buddy.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

BIN
buddy_alone.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

BIN
flag/ae.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

BIN
flag/af.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

BIN
flag/al.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

BIN
flag/am.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

BIN
flag/ao.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

BIN
flag/aq.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

BIN
flag/ar.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

BIN
flag/at.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

BIN
flag/au.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

BIN
flag/ax.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

BIN
flag/az.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

BIN
flag/ba.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

BIN
flag/bd.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

BIN
flag/be.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

BIN
flag/bg.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

BIN
flag/bh.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

BIN
flag/bj.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

BIN
flag/blank.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

BIN
flag/bm.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

BIN
flag/bn.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

BIN
flag/bo.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

BIN
flag/br.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

BIN
flag/bs.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

BIN
flag/bt.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

BIN
flag/by.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

BIN
flag/bz.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

BIN
flag/ca.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

BIN
flag/cg.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

BIN
flag/ch.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

BIN
flag/ci.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

BIN
flag/cl.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

BIN
flag/cn.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

BIN
flag/co.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

BIN
flag/cr.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

BIN
flag/cy.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

BIN
flag/cz.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

BIN
flag/de.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

BIN
flag/dj.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

BIN
flag/dk.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

BIN
flag/dm.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

BIN
flag/do.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

BIN
flag/dz.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

BIN
flag/ec.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

BIN
flag/ee.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

BIN
flag/eg.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

BIN
flag/es.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

BIN
flag/et.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

BIN
flag/eu.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

BIN
flag/fi.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

BIN
flag/fm.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

BIN
flag/fo.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

BIN
flag/fr.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

BIN
flag/gb.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

BIN
flag/ge.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

BIN
flag/gf.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

BIN
flag/gh.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

BIN
flag/gi.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

BIN
flag/gl.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

BIN
flag/gr.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

BIN
flag/gt.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

BIN
flag/gu.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

BIN
flag/gy.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

BIN
flag/hk.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

BIN
flag/hn.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

BIN
flag/hr.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

BIN
flag/ht.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

BIN
flag/hu.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

BIN
flag/id.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

BIN
flag/ie.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

BIN
flag/il.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

BIN
flag/im.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

BIN
flag/in.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

BIN
flag/iq.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

BIN
flag/ir.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

BIN
flag/is.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

BIN
flag/it.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

BIN
flag/je.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

BIN
flag/jm.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

BIN
flag/jo.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

BIN
flag/jp.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

BIN
flag/ke.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

BIN
flag/kg.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

BIN
flag/kh.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

BIN
flag/kn.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

BIN
flag/kp.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

BIN
flag/kr.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

BIN
flag/kw.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

BIN
flag/kz.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

BIN
flag/la.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

BIN
flag/lb.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

BIN
flag/li.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

BIN
flag/lk.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

BIN
flag/lr.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Some files were not shown because too many files have changed in this diff Show More