Example #1
0
def parse_args(args: list = sys.argv[1:]):
    parser = argparse.ArgumentParser("dnsbl", description=__doc__)
    parser.add_argument("host",
                        type=str,
                        help="Target hostname or ip address.")
    parser.add_argument("-k",
                        "--api-key",
                        type=str,
                        help="Your HTTP:Bl Access Key.")
    args = parser.parse_args(args)

    try:
        dnsbl = API(args.api_key)
        info = dnsbl.query(args.host)
        if info["message"]:
            raise Exception(info["message"])
        print(colored("[i] DNSbl query results:"))
        pprint(info, 1, lambda x: x, "green", True)
    except Exception as e:
        print(colored(f"[!] {type(e).__name__}:", "red"))
        print(colored(f" -  {e}", "red", True))
    except KeyboardInterrupt:
        print(colored(f"[!] Keyboard Interrupted!", "red"))
def parse_args(args: list = sys.argv[1:]):
    parser = argparse.ArgumentParser("full-contact", description=__doc__)
    parser.add_argument("query", type=str, help="Search query.")
    parser.add_argument("-t", "--type", type=str, default="email", help="Query type (email, twitter, phone, domain or company; Default: email).")
    parser.add_argument("-k", "--api-key", type=str, default="978e7c52735a8420", help="FullContact API key.")
    args = parser.parse_args(args)
    
    api = API(args.api_key)
    resp = api.search(args.type, args.query)
    print(colored(f"[i] Showing Contact Info For {args.type.title()} Query {repr(args.query)}:"))
    print(colored(" -  Request ID/SC: {0[requestId]}/{0[status]}".format(resp), dark=True))
    if "likelihood" in resp:
        print(colored(f" -  Likelihood: {resp['likelihood']:0.2%}", dark=True))
        print("")
    else:
        if "message" in resp:
            print(colored(f" -  Message: {resp['message']}", "yellow", True))
            sys.exit()
    
    if "contactInfo" in resp:
        print(colored(" -  Contact Info:"))
        pprint(resp["contactInfo"], 1)
        print("")
    
    if "digitalFootprint" in resp:
        print(colored(" -  Digital Footprint:"))
        pprint(resp["digitalFootprint"], 1)
        print("")
    
    if "socialProfiles" in resp:
        print(colored(" -  Social Profiles:"))
        for profile in resp["socialProfiles"]:
            print(colored(f"    - {profile['typeName']}:"))
            for i in ["type", "typeId", "typeName"]:
                del profile[i]
            #for key, value in profile.items():
            #    print(colored(f"      - {key.title()}: {value}", dark=True))
            pprint(profile, 2)
            print("")
    
    for key in ["socialProfiles", "digitalFootprint", "contactInfo", "likelihood", "requestId", "status", "photos"]:
        if key in resp:
            del resp[key]
    pprint(resp)
Example #3
0
        private_key_sign = private_key.sign(message)
        signature = private_key_sign.hex()
        return signature

if __name__ == '__main__':
    wallet_M = Wallet()
    wallet_A = Wallet()
    wallet_B = Wallet()
    t = Transaction(
        wallet_A.private_key, wallet_A.public_key, wallet_A.blockchain_address,
        wallet_B.blockchain_address, 10.0)

    ####### Blockchain Node
    import blockchain
    block_chain = blockchain.BlockChain(
        blockchain_address=wallet_M.blockchain_address)
    is_added = block_chain.add_transaction(
        wallet_A.blockchain_address,
        wallet_B.blockchain_address,
        10.0,
        wallet_A.public_key,
        t.generate_signature()
    )
    print('Added?', is_added)
    block_chain.mining()
    utils.pprint(block_chain.chain)

    print('A', block_chain.calculate_total_amount(wallet_A.blockchain_address))
    print('B', block_chain.calculate_total_amount(wallet_B.blockchain_address))
    print('M', block_chain.calculate_total_amount(wallet_M.blockchain_address))
Example #4
0
from modules import httpbl
from modules.utils import pprint, colored
import argparse

if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("host",
                        type=str,
                        help="Target hostname or ip address.")
    parser.add_argument("-k",
                        "--api-key",
                        type=str,
                        default="vztjisbgwwij",
                        help="Your HTTP:Bl Access Key.")
    args = parser.parse_args()

    try:
        dnsbl = httpbl.DNSbl(args.api_key)
        info = dnsbl.query(args.host)
        if info["message"]:
            raise Exception(info["message"])
        print(colored("[i] DNSbl query results:"))
        pprint(info, 1, lambda x: x, "green", True)
    except Exception as e:
        print(colored(f"[!] {type(e).__name__}:", "red"))
        print(colored(f" -  {e}", "red", True))
    except KeyboardInterrupt:
        print(colored(f"[!] Keyboard Interrupted!", "red"))
def parse_args(args: list = sys.argv[1:]):
    parser = argparse.ArgumentParser("wserfpt", description=__doc__)
    parser.add_argument("url", type=str, help="Target URL.")
    args = parser.parse_args(args)
    
    session = requests.Session()
    try:
        head = session.head(args.url, verify=True)
    except requests.exceptions.SSLError as e:
        print(colored(f"[{type(e).__name__}] {str(e)[0].upper() + str(e)[1:]}", "yellow"))
        head = session.head(args.url, verify=False)
        print("")
    
    try:
        if Heartbleed(args.url).vulnerable:
            print(colored(f"[!] Target is affected by the Heartbleed Bug!", "red"))
            print("")
    except:
        pass
    
    print(colored(f"[i] HEAD Response Info.:"))
    pprint({"Version": f"HTTP/{'{0[0]}.{0[0]}'.format(str(head.raw.version))}", "Status": f"{head.status_code} {head.reason}",
            "Closed": head.raw.closed, "Chunked": head.raw.chunked,
            "Readable": head.raw.readable(), "Seekable": head.raw.seekable(), "Writable": head.raw.writable(),
            "Apparent Encoding": head.apparent_encoding, "Encoding": head.encoding,
            "Is Redirect": head.is_redirect, "Is Permanent Redirect": head.is_permanent_redirect,
            "Enforce Content Length": head.raw.enforce_content_length,
            "Retries": head.raw.retries.total}, title=False)
    
    headers = dict(head.headers)
    for name in ["Set-Cookie", "Link"]:
        while name in headers:
            del headers[name]
    
    if head.links:
        print("")
        print(colored(f"[i] Server Links: ({len(head.links)})"))
        pprint(head.links)
    
    if headers:
        print("")
        print(colored(f"[i] Server Headers: ({len(headers)})"))
        pprint(headers)
    
    if head.cookies:
        cookies = {}
        print("")
        print(colored(f"[i] Server Cookies: ({len(head.cookies)})"))
        for cookie in sorted(head.cookies, key=lambda x: x.name):
            name, value = cookie.name, cookie.value
            tags = tuple(sorted(set(["Secure" if cookie.secure else "Insecure"] + list(cookie._rest.keys()))))
            cookies[name] = {"tags": tags, "value": value}
            #print(colored(f" -  [{', '.join(tags)}] {name}: ") + colored(f"{value[:79] + '[...]' if len(value) > (79 - len(name)) else value}", dark=True))
        pprint(cookies)
    
    responses = []
    try:
        options = session.options(args.url).headers.get("Allow").split(",")
    except:
        options = []
        for method in ["GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "TRACE"]:
            try:
                resp = session.request(method, args.url)
                if resp.status_code != 405:
                    options.append(method)
                responses.append(resp)
            except:
                pass
    print(colored("\n[i] Supported request methods: ") + colored(f"{', '.join(sorted(options))}", dark=True))
    
    firewalls = []
    for resp in responses:
        for name, check in sorted(checks.items(), key=lambda x: x[0]):
            if name not in firewalls:
                detected = check(resp)
                if detected:
                    firewalls.append(name)
    if firewalls:
        print(colored(f"[i] Detected Web Application Firewall{'s' if len(firewalls) != 1 else ''}: {', '.join(firewalls)}"))
    
    resp_times = [resp.elapsed.total_seconds() for resp in responses]
    if resp_times:
        print("")
        print(colored("[i] Response Times Summary (in seconds):"))
        print(colored(f" -  Minimum: {min(resp_times):.02f}s   -   Average: {float(sum(resp_times)) / max(len(resp_times), 1):.02f}s   -   Maximum: {max(resp_times):.02f}s", dark=True))
def parse_args(args: list = sys.argv[1:]):
    parser = argparse.ArgumentParser("r-ident", description=__doc__)
    parser.add_argument(
        "-r",
        "--results",
        type=int,
        default=1,
        help="Number of identities to generate (Default: 1, Max: 5.000).")
    parser.add_argument(
        "-g",
        "--gender",
        type=str,
        default="",
        help=
        "You can specify whether you would like to have only male or only female identities generated by adding the gender parameter. Valid values for the gender parameter are \"male\" or \"female\". Any other value will cause the service to return both male and female identities."
    )
    parser.add_argument(
        "-n",
        "--nationality",
        type=str,
        default="",
        help=
        "You can request different nationalities for identities (Possible Values: AU, BR, CA, CH, DE, DK, ES, FI, FR, GB, IE, IR, NL, NZ, TR, US)."
    )
    parser.add_argument(
        "-s",
        "--seed",
        type=str,
        default="",
        help=
        "Seeds allow you to always generate the same set of users. For example, the seed \"foobar\" will always return results for Becky Sims (for version 1.0). Seeds can be any string or sequence of characters."
    )
    args = parser.parse_args(args)

    try:
        resp = requests.get(
            f"https://randomuser.me/api/?results={args.results}&gender={args.gender}&nat={args.nationality}&seed={args.seed}&exc=registered,id&noinfo"
        )
        if resp.ok:
            resp = resp.json()
            results = resp.get("results", [])
            print(
                colored(
                    f"[i] {len(results) or 'No'} identit{'ies' if len(results) != 1 else 'y'} generated ..."
                ))
            for ident in results:
                ident["name"] = " ".join(ident["name"].values()).title()
                del ident["login"]["salt"]
                del ident["login"]["md5"]
                del ident["login"]["sha1"]
                del ident["login"]["sha256"]
                for key, value in ident.copy()["location"].items():
                    ident["location"][key] = str(value).title()
                pprint(ident)
                if len(results) > results.index(ident) + 1:
                    print("")
        else:
            raise Exception(resp.text)
    except (KeyboardInterrupt, Exception) as e:
        print(colored(f"[!] {type(e).__name__}:", "red"))
        if str(e):
            print(colored(f" -  {e}", "red", True))