[Python] Cpanel User Validator

Katılım
11 Mar 2016
Tepki puanı
26
Rating - 0%
Kod:
#!/usr/bin/env python

import argparse
import urllib2
import sys
import os
import cookielib

# How To Use: python cpusercheck.py --url http://localhost.com/ --usr local

# As per cPanle Rule's 1st character of url are username but it's mandatory


def cls():
    if os.name == "nt":
        os.system('cls')
    else:
        os.system('clear')
cls()

logo = '''\nSimple Cpanel User validator"
\t _       _                  _                         _               
\t| |__   | |   __ _    ___  | | __   ___    ___     __| |   ___   _ __
\t| '_ \  | |  / _` |  / __| | |/ /  / __|  / _ \   / _` |  / _ \ | '__|
\t| |_) | | | | (_| | | (__  |   <  | (__  | (_) | | (_| | |  __/ | |   
\t|_.__/  |_|  \__,_|  \___| |_|\_\  \___|  \___/   \__,_|  \___| |_|   
                                                                   
                        __Author__ = Ne0-h4ck3r

'''

print logo

if __name__ == "__main__":

    if len(sys.argv) == 1:
        print """usage: cpusercheck.py [-h] [--url URL] [--usr USR]

  Optional Arguments:
  -h, --help  show this help message and exit
  --url URL   Insert Your Target URL
  --usr USR   Insert Your UserName
        """
        sys.exit(1)

    black = argparse.ArgumentParser()
    black.add_argument('--url', help="Insert Your Target URL")
    black.add_argument('--usr', help="Insert Your UserName")
    args = black.parse_args()


def Main():

    cj = cookielib.CookieJar()
    coder = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
   
    if args.url.startswith("http://"):
        pass
    elif args.url.startswith("https://"):
        pass
    else:
        print ""
        print "You Must Insert URL with out http:// or https:// "
        print ""
        sys.exit()

    try:
        if args.url:
            url = args.url + "/cgi-sys/guestbook.cgi?user="+args.usr
            code = urllib2.Request(url)
            conn = coder.open(code).read()
            if '.htmltemplates' in conn:
                print ""
                print "[+] Valid UserName: " + args.usr
                print ""

            else:
                print ""
                print "[~] invalid UserName" + args.usr
                print ""
    except:
        pass

if __name__== "__main__":
    Main()
 
131,600Konular
3,269,605Mesajlar
315,544Kullanıcılar
TokyoLT5Son Üye
Üst Alt