Trying to discover iOS devices on my network using python script -


trying use pybonjour not sure if need. https://code.google.com/p/pybonjour/

i want able discover ios devices appear on network automatically, running script later on based on this, first want discover ios devices appear/disappears on wifi network.

so question, how do this? running on windows machine python27 , pybonjour package installed, 2 examples work pybonjour page, command run discover ios devices using scripts included on network? or discovery services running on pc run script on!

if going in wrong direction please let me know, can't seem find documentation on package!

python browse_and_resolve.py xxxxxx 

thx matt.

update...

this article , browser helpful, http://marknelson.us/2011/10/25/dns-service-discovery-on-windows/ in finding services needed search for.

example; (this discovered apple tv's, not @ home atm can't check iphone called! assume iphone!

python browse_and_resolve.py _appletv._tcp 

also if have windows utility dns-sd.exe search services available on network. used find looking for.

dns-sd -b _services._dns-sd._udp 

update...

"bonjour used in 2 ways: - publishing service - detecting (browsing for) available services".

for want do, don't think work ipad/iphone won't advertise service unless i'm running app advertise 1 (or jailbreak iphone/ipad , ssh open). more ideas?

what you're trying (a) can't done, , (b) wouldn't use if could.

the point of bonjour discover services, not devices. of course each service provided device, indirectly can discover devices it… but discovering service they're advertising.

as far know, (except apple tvs) don't advertise services, except while you're running app uses bonjour find same app on other machines. (except jailbroken devices, advertise ssh, afp, etc.)

there few ways to, indirectly, list of services being advertised on network. simplest use bonjour browser windows. (i've never used it, original mac tool , java port, both of have used, both suggest windows port windows users.) fire , you'll list of services, , can click on each 1 details.

so, can verify iphone , ipad aren't advertising services, show there no way detect them via bonjour.

meanwhile, if did find device, planning do? presumably want communicate device in way, right? whatever service you're trying communicate with… browse service—and then, if appropriate, filter down ios devices. that's got easier browsing ios devices , filtering down have service want.


as whether there's any way detect ios devices… well, there @ least 2 possibilities. don't know if either of them work, but…

first, if ios device isn't advertising you, assume it's browsing services you can advertise. how else find there's apple tv airtunes to, itunes on lan sync with, etc.?

so, use bonjour browser list of services itunes-running desktop, apple tv, etc. advertising. turn off services on desktop, use pybonjour advertise whichever services seem plausibly relevant (and, if need be, use netcat put trivial listeners on ports advertise). turn on iphone, , see if connects of them. may want leave running while, or switch wifi off , on. (i'm guessing that, despite apple's recommendations, doesn't browse continuously services, checks every once in while and/or every time network status changes. after all, apple's recommendations foreground interactive apps, not background services.)

unfortunately, if can find service ios devices connect to, may not able distinguish ios devices others getting connections there. example, i'm pretty sure mac or windows box running itunes hit fake airtunes service, , mac hit airprint, , on. so, how distinguish iphone hitting it? may need serve enough of protocol information out of them. particularly difficult apple's undocumented protocols.

but you'll lucky, , there ios devices, , nothing else, want talk to. itunes sync seems obvious possibility.

alternatively, there few things have broadcast, or wouldn't work. can't on wifi network without broadcasts. , home wifi networks use dhcp, means have broadcast dhcp discover (and request), well. there may kind of heuristic signature can detect in these messages. if nothing else, enabling ddns should cause device send hostname, , can guess based on (e.g., unless change defaults, hostname.lower().endswith('iphone')).

the easiest way set desktop main access point home network. believe it's simple turning on internet connection sharing somewhere in control panel. (setting dhcp relay agent less overhead being full router, have no idea how you'd started doing on windows.) can capture dhcp broadcasts (or, failing that, 802.11 broadcasts) come in. wireshark capture , parse messages easily, can watch , see if looks worth pursuing farther. (see rfc 2131 details on format aren't obvious wireshark's cryptic one-liner descriptions.)

you can take farther , watch internet connections every host makes once they're connected internet. device that's periodically checking app store, ios upgrade server, etc.… well, unless 1 of jailbreak devteam guys lives in house, that's iphone, right? downside of these checks may very periodic, , detecting iphone 6 hours after connects network isn't exciting.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -