MDNS python
$10-30 USD
İlan edilme: neredeyse 4 yıl önce
$10-30 USD
Teslimde ödenir
Hello.
Need to grep MDNS message and use at python code
Example message:
00:31:50.960288 IP 10.125.1.20.5353 > 224.0.0.251.5353: 0*- [0q] 1/0/3 PTR BeyondTV-8bf2ee2538df698d648daecf10e81815._googlecast._tcp.local. (336)
0x0000: 0100 5e00 00fb d813 992c 373f 0800 4500 ..^......,7?..E.
0x0010: 016c 7890 4000 ff11 1564 0a7d 0114 e000 .lx.@....d.}....
0x0020: 00fb 14e9 14e9 0158 1ff3 0000 8400 0000 .......X........
0x0030: 0001 0000 0003 0b5f 676f 6f67 6c65 6361 ......._googleca
0x0040: 7374 045f 7463 7005 6c6f 6361 6c00 000c st._tcp.local...
0x0050: 0001 0000 0078 002c 2942 6579 6f6e 6454 .....x.,)BeyondT
0x0060: 562d 3862 6632 6565 3235 3338 6466 3639 V-8bf2ee2538df69
0x0070: 3864 3634 3864 6165 6366 3130 6538 3138 8d648daecf10e818
0x0080: 3135 c00c c02e 0010 8001 0000 1194 00a1 15..............
0x0090: 2369 643d 3862 6632 6565 3235 3338 6466 #id=8bf2ee2538df
0x00a0: 3639 3864 3634 3864 6165 6366 3130 6538 698d648daecf10e8
0x00b0: 3138 3135 2363 643d 3032 4343 3343 3632 1815#cd=02CC3C62
0x00c0: 4135 3343 3538 3244 3043 4341 3644 4233 A53C582D0CCA6DB3
0x00d0: 3431 4244 3733 3935 0372 6d3d 0576 653d 41BD7395.rm=.ve=
0x00e0: 3035 0b6d 643d 4265 796f 6e64 5456 1269 05.md=BeyondTV.i
0x00f0: 633d 2f73 6574 7570 2f69 636f 6e2e 706e c=/setup/[login to view URL]
0x0100: 6707 666e 3d31 3530 3809 6361 3d31 3938 g.fn=1508.ca=198
0x0110: 3636 3104 7374 3d30 0f62 733d 4641 3846 661.st=0.bs=FA8F
0x0120: 3041 4133 3745 3646 046e 663d 3103 7273 0AA37E6F.nf=[login to view URL]
0x0130: 3dc0 2e00 2180 0100 0000 7800 2d00 0000 =...!.....x.-...
0x0140: 001f 4924 3862 6632 6565 3235 2d33 3864 ..I$8bf2ee25-38d
0x0150: 662d 3639 3864 2d36 3438 642d 6165 6366 f-698d-648d-aecf
0x0160: 3130 6538 3138 3135 c01d c119 0001 8001 10e81815........
0x0170: 0000 0078 0004 0a7d 0114 ...x...}..
Code Python:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#python 2.7
from [login to view URL] import *
from struct import pack
from time import sleep
#import binascii
## Create a Packet Count var
packetCount = 0
def dns_spoof(pkt):
redirect_to = '[login to view URL]'
data = "00 00 00 00 00 01 00 00 00 00 00 00 0b 5f 67 6f 6f 67 6c 65 63 61 73 74 04 5f 74 63 70 05 6c 6f 63 61 6c 00 00 0c 80 01"
data_list = [login to view URL]()
data_hex = ''.join(data_list).decode('hex')
spoofed_pkt = IP(src='[login to view URL]', dst=redirect_to)/UDP(dport='mdns', sport='mdns')/Raw(load=data_hex)
while True:
send(spoofed_pkt)
print 'Sent:', [login to view URL]()
## Define our Custom Action function
def customAction(packet):
global packetCount
packetCount += 1
#print [login to view URL]()
if DNSQR in packet:
if packet[DNSQR].qname == '_googlecast._tcp.local.':
print 'chromecast is being looked for'
#flip the QU bit to true
dns_spoof(packet)
return "Packet #%s: %s ==> %s" % (packetCount, packet[0][1].src, packet[0][1].dst)
## Setup sniff, filtering for IP traffic
#sniff(filter="ip", prn=customAction)
#sniff(filter="ip and udp port mdns", prn=customAction)
def main():
dns_spoof("tst")
main()
#MDNS
###[ DNS ]###
# id = 0
# qr = 0L
# opcode = QUERY
# aa = 0L
# tc = 0L
# rd = 0L
# ra = 0L
# z = 0L
# ad = 0L
# cd = 0L
# rcode = ok
# qdcount = 1
# ancount = 0
# nscount = 0
# arcount = 0
# \qd \
# |###[ DNS Question Record ]###
# | qname = '_googlecast._tcp.local.'
# | qtype = PTR
# | qclass = IN
# an = None
# ns = None
# ar = None
Proje No: 25689306
Proje hakkında
Uzaktan proje
Son aktiviteden bu yana geçen zaman 4 yıl önce
Biraz para mı kazanmak istiyorsunuz?
Freelancer'da teklif vermenin faydaları
Bütçenizi ve zaman çerçevenizi belirleyin
Çalışmanız için ödeme alın
Teklifinizin ana hatlarını belirleyin
Kaydolmak ve işlere teklif vermek ücretsizdir