コード例 #1
0
ファイル: read_ndef.py プロジェクト: wflk/LL-Fuzzer
def print_wifi_token(message):
    try:
        data = WiFiPasswordData.fromstring(message[0].data)
        print "  Wi-Fi Password Token"
        print "    version  = %d.%d" % data.version
        print "    PK Hash  = %s" % data.public_key_hash.encode("hex")
        print "    DevPwdID = %s" % data.device_password_id
        print "    Password = %s" % data.device_password.encode("hex")
        for key, val in data.other_attributes:
            print "    0x%04x   = %s" % (key, val.encode("hex"))
        return
    except ValueError:
        pass
    try:
        data = WiFiConfigData.fromstring(message[0].data)
        print "  Wi-Fi Configuration Token"
        print "    version  = %d.%d" % data.version
        print "    network  = %s" % data.ssid
        print "    password = %s" % data.network_key
        print "    macaddr  = %s" % data.mac_address
        print "    security = %s / %s" % \
            (data.authentication, data.encryption)
        return
    except ValueError:
        pass
コード例 #2
0
def write_password_token(tag):
    print
    print "Writing Wi-Fi Password Token"

    pwd = WiFiPasswordData()
    pwd.public_key_hash = 20 * "\x01"
    pwd.device_password_id = 100
    pwd.device_password = "******"
    pwd.other_attributes.append((0x1023, "VAIO X11"))  # model name

    message = Message(Record(("application/vnd.wfa.wsc", "", pwd.tostring())))

    print format_data(message.tostring())
    if tag:
        tag.ndef.message = message.tostring()
    return
コード例 #3
0
ファイル: read_ndef.py プロジェクト: Zke1ev3n/LL-Fuzzer
def print_wifi_token(message):
    try:
        data = WiFiPasswordData.fromstring(message[0].data)
        print "  Wi-Fi Password Token"
        print "    version  = %d.%d" % data.version
        print "    PK Hash  = %s" % data.public_key_hash.encode("hex")
        print "    DevPwdID = %s" % data.device_password_id
        print "    Password = %s" % data.device_password.encode("hex")
        for key, val in data.other_attributes:
            print "    0x%04x   = %s" % (key, val.encode("hex"))
        return
    except ValueError:
        pass
    try:
        data = WiFiConfigData.fromstring(message[0].data)
        print "  Wi-Fi Configuration Token"
        print "    version  = %d.%d" % data.version
        print "    network  = %s" % data.ssid
        print "    password = %s" % data.network_key
        print "    macaddr  = %s" % data.mac_address
        print "    security = %s / %s" % \
            (data.authentication, data.encryption)
        return
    except ValueError:
        pass
コード例 #4
0
ファイル: wps_password_token.py プロジェクト: wflk/LL-Fuzzer
def write_password_token(tag):
    print
    print "Writing Wi-Fi Password Token"

    pwd = WiFiPasswordData()
    pwd.public_key_hash = 20 * '\x01'
    pwd.device_password_id = 100
    pwd.device_password = "******"
    pwd.other_attributes.append((0x1023, "VAIO X11"))  # model name

    message = Message(Record(("application/vnd.wfa.wsc", "", pwd.tostring())))

    print format_data(message.tostring())
    if tag: tag.ndef.message = message.tostring()
    return