Beispiel #1
0
def scan3000(reply, text, nick, notice):
    if getTokens(nick) < 10000:
        notice("You don't have enough tokens to do a portscan3000 (10000 needed)... Help a little more !")
        return None

    if not text:
        reply("Please specify an IP address/ dns ! !ps3000 IP")


    takeTokens(500, nick, notice)
    IP = text
    timeout = float((float(pingavg(IP)) / 100) + 0.5)
    socket.setdefaulttimeout(timeout)
    notice("i'm scanning with a timeout of " + str(timeout))
    reply("Scanning 3000 ports... It's a long task, you'll have to wait !")

    scan = Scanner()
    scan.__init__()
    scan.open = []
    scan.host = IP
    scan.ports = toScan[:]

    openPorts = scan.start()

    openPorts.sort()
    reply("Open ports found for " + text + " (" + str(len(openPorts)) + "): " + str(openPorts))
Beispiel #2
0
def alt(nick, notice):
    if getTokens(nick) < 100000:
        notice("You don't have enough tokens to get a alt (100000 needed)... Help a little more !")
        return None

    takeTokens(10000, nick, notice)
    Talt = str(urllib.request.urlopen("http://alt.site90.net/AccountGen.php").read().decode("utf-8"))
    notice(Talt)
Beispiel #3
0
def md5hash(text, reply, notice, nick):
    if text is None:
        notice("Syntax : !md5hash word")
        return None
    if getTokens(nick) < 500:
        notice("You don't have enough tokens to hash to a md5 (500 needed)... Help a little more !")
        return None

    takeTokens(5, nick, notice)
    tohash = str(text)
    output = str(hashlib.md5(tohash.encode()).hexdigest())
    reply("Hash of " + tohash + " : " + output)
Beispiel #4
0
def passgen(reply, nick, notice):
    if getTokens(nick) < 100:
        notice("You don't have enough tokens to do a password generation (100 needed)... Help a little more !")
        return None

    takeTokens(5, nick, notice)

    alphabet = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890^=+/:.;?,-_)&"'(!<>'
    pw_length = 10
    mypw = ""

    for i in range(pw_length):
        next_index = random.randrange(len(alphabet))
        mypw += alphabet[next_index]

    reply("I just generated a 10 chars random password for you ! Here you go ! " + mypw)
Beispiel #5
0
def bungeesec(reply, text, nick, notice):
    if getTokens(nick) < 15000:
        notice("You don't have enough tokens to do a bungeesecure (15000 needed)... Help a little more !")
        return None

    if not text:
        reply("Please specify an IP address/ dns ! !bungeesecure IP")

    takeTokens(2000, nick, notice)
    IP = text
    timeout = float((float(pingavg(IP)) / 100) + 0.1)
    socket.setdefaulttimeout(timeout)
    notice("I'm scanning with a timeout of " + str(timeout))
    reply("Scanning ports... Please wait a moment !")
    toreply = "List of minecraft servers found for : " + str(IP) + ":\n"


    start = 20000
    end = 40000

    scan = Scanner()
    scan.open = []
    scan.host = IP
    scan.ports = list(range(start, end))

    serversPorts = scan.start()
    others = []

    for port in serversPorts:
        mcinf = pingmc(IP, port)
        if mcinf:
            toreply += "Server found on port " + str(port) + " : " + str(mcinf) + "\n"
        else:
            others.append(port)

    if others:
        toreply += "Other(s) open ports found, but that don't seems to have a minecraft server on them :" + str(others)



    if len(serversPorts) == 0:
        toreply += "No servers found. Check the entered IP address."

    if len(serversPorts) < 5:
        return toreply
    else:
        return web.paste(strip_all(toreply).encode("latin-1",errors='replace'))
Beispiel #6
0
def md5crack(notice, text, reply, nick):
    if text is None:
        notice("Syntax : !md5crack the_md5_hash")
        return None

    if getTokens(nick) < 2000:
        notice("You don't have enough tokens to crack a md5 (2000 needed)... Help a little more !")
        return None

    takeTokens(50, nick, notice)

    tocrack = str(text)
    notice('Trying to crack : ' + tocrack)

    output = str(crack_single_hash(tocrack))
    if output == "None":
        reply("Didn't found anything for : " + tocrack)
    else:
        reply("Here's what i've found for " + tocrack + " : " + output)
Beispiel #7
0
def md5crack(notice, text, reply, nick):
    if text is None:
        notice("Syntax : !md5crack the_md5_hash")
        return None

    if getTokens(nick) < 2000:
        notice(
            "You don't have enough tokens to crack a md5 (2000 needed)... Help a little more !"
        )
        return None

    takeTokens(50, nick, notice)

    tocrack = str(text)
    notice('Trying to crack : ' + tocrack)

    output = str(crack_single_hash(tocrack))
    if output == "None":
        reply("Didn't found anything for : " + tocrack)
    else:
        reply("Here's what i've found for " + tocrack + " : " + output)
Beispiel #8
0
def mcping(text, notice, nick):
    """<server[:port]> - gets info about the Minecraft server at <server[:port]>"""
    if getTokens(nick) < 100:
        notice("You don't have enough tokens to do a mcping... Help a little more !")
        return None
    else:
        takeTokens(10, nick, notice)

    try:
        server = MinecraftServer.lookup(text)
    except (IOError, ValueError) as e:
        return e

    try:
        s = server.status()
    except socket.gaierror:
        return "Invalid hostname"
    except socket.timeout:
        return "Request timed out"
    except ConnectionRefusedError:
        return "Connection refused"
    except ConnectionError:
        return "Connection error"
    except (IOError, ValueError) as e:
        return "Error pinging server: {}".format(e)

    if isinstance(s.description, dict):
        description = format_colors(" ".join(s.description["text"].split()))
    else:
        description = format_colors(" ".join(s.description.split()))

    if s.latency:
        return "{}\x0f - \x02{}\x0f - \x02{:.1f}ms\x02" \
               " - \x02{}/{}\x02 players".format(description, s.version.name_clean, s.latency,
                                                 s.players.online, s.players.max).replace("\n", "\x0f - ")
    else:
        return "{}\x0f - \x02{}\x0f" \
               " - \x02{}/{}\x02 players".format(description, s.version.name_clean,
                                                 s.players.online, s.players.max).replace("\n", "\x0f - ")
Beispiel #9
0
def scanOne(reply, text, nick, notice):
    if getTokens(nick) < 1000:
        notice("You don't have enough tokens to do a portscan (1000 needed)... Help a little more !")
        return None

    args = text.split()

    try:
        IP = str(args[0])
        PORT = int(args[1])
    except IndexError:
        notice("Syntax : !ps1 IP PORT. Use !ps3000 for the 3000 most used ports")
        return None

    takeTokens(100, nick, notice)
    socket.setdefaulttimeout(5)
    reply("Scanning port number " + str(PORT) + " for ip " + str(IP))

    result = scanport(IP, PORT)

    if result:
        reply("The port " + str(PORT) + " of the IP " + IP + " is OPEN !")
    elif not result:
        reply("The port " + str(PORT) + " of the IP " + IP + " is CLOSED ! ")
Beispiel #10
0
def virweb(text, notice, nick):
    if getTokens(nick) < 1000:
        notice(
            "You don't have enough tokens to check a address on virus total (1000 needed)... Help a little more !"
        )
        return None

    if not text:
        notice("Please specify an url in this command")
        return None

    takeTokens(100, nick, notice)

    url_to_check = str(text)
    parsedDict = VTWebCheck(url_to_check)
    if int(parsedDict["response_code"]) == 1:
        toreply = "Check started ! Access the results at : " + parsedDict[
            "permalink"] + " or use !virustotal url "
    else:
        toreply = "An error occured ! n°" + str(
            parsedDict["response_code"]) + " : " + str(
                parsedDict["verbose_msg"])

    return toreply
Beispiel #11
0
def servinfo(reply, text, notice, nick):
    if getTokens(nick) < 1000:
        notice(
            "You don't have enough tokens to do a portscan (1000 needed)... Help a little more !"
        )
        return None

    takeTokens(250, nick, notice)
    host = text

    # First of all, check the ping !
    ping = float(pingavg(host))

    # Check if ssh is working (port 22 open)
    sshWorking = scanport(host, 22)

    # Check if web HTTP is working
    httpWorking = scanport(host, 80)

    # Check if web HTTP is working
    httpsWorking = scanport(host, 443)

    # Check if DNS is working
    dnsWorking = scanport(host, 53)

    # Check if SMTP is working
    smtpWorking = scanport(host, 25)

    # Lets reply that !
    toreply = ""

    if ping == -1:
        toreply += "$(dark_red)ping $(clear)"
    elif ping <= 20:
        toreply += "$(dark_green)ping $(clear)"
    elif ping <= 1000:
        toreply += "$(orange)ping (" + str(ping) + " ms)" + "$(clear)"
    else:
        toreply += "$(red)ping $(clear)"

    if sshWorking:
        toreply += "$(dark_green)ssh $(clear)"
    else:
        toreply += "$(red)ssh $(clear)"

    if httpWorking:
        toreply += "$(dark_green)http $(clear)"
    else:
        toreply += "$(red)http $(clear)"

    if httpsWorking:
        toreply += "$(dark_green)https $(clear)"
    else:
        toreply += "$(red)https $(clear)"

    if dnsWorking:
        toreply += "$(dark_green)dns $(clear)"
    else:
        toreply += "$(red)dns $(clear)"

    if smtpWorking:
        toreply += "$(dark_green)smtp  $(clear)"
    else:
        toreply += "$(red)smtp $(clear)"

    reply(host + " : " + parse(toreply))
Beispiel #12
0
def servinfo(reply, text, notice, nick):
    if getTokens(nick) < 1000:
        notice("You don't have enough tokens to do a portscan (1000 needed)... Help a little more !")
        return None

    takeTokens(250, nick, notice)
    host = text

    # First of all, check the ping !
    ping = float(pingavg(host))

    # Check if ssh is working (port 22 open)
    sshWorking = scanport(host, 22)

    # Check if web HTTP is working
    httpWorking = scanport(host, 80)

    # Check if web HTTP is working
    httpsWorking = scanport(host, 443)

    # Check if DNS is working
    dnsWorking = scanport(host, 53)

    # Check if SMTP is working
    smtpWorking = scanport(host, 25)

    # Lets reply that !
    toreply = ""

    if ping == -1:
        toreply += "$(dark_red)ping $(clear)"
    elif ping <= 20:
        toreply += "$(dark_green)ping $(clear)"
    elif ping <= 1000:
        toreply += "$(orange)ping (" + str(ping) + " ms)" + "$(clear)"
    else:
        toreply += "$(red)ping $(clear)"

    if sshWorking:
        toreply += "$(dark_green)ssh $(clear)"
    else:
        toreply += "$(red)ssh $(clear)"

    if httpWorking:
        toreply += "$(dark_green)http $(clear)"
    else:
        toreply += "$(red)http $(clear)"

    if httpsWorking:
        toreply += "$(dark_green)https $(clear)"
    else:
        toreply += "$(red)https $(clear)"

    if dnsWorking:
        toreply += "$(dark_green)dns $(clear)"
    else:
        toreply += "$(red)dns $(clear)"

    if smtpWorking:
        toreply += "$(dark_green)smtp  $(clear)"
    else:
        toreply += "$(red)smtp $(clear)"

    reply(host + " : " + parse(toreply))