GithubHelp home page GithubHelp logo

xelzmm / iosgetmacaddress Goto Github PK

View Code? Open in Web Editor NEW

This project forked from qbsuranalang/iosgetmacaddress

0.0 2.0 2.0 147 KB

iOS another way to get mac address after iOS 7.

Objective-C 100.00%

iosgetmacaddress's Introduction

iOSGetMACAddress

iOS another way to get mac address after iOS 7.

Why

Since iOS 7.0, you cannot easily using sysctl() or ioctl() to get MAC address(normal way).

Link (the most bottom)

In iOS 7 and later, if you ask for the MAC address of an iOS device, the system returns the value 02:00:00:00:00:00.
If you need to identify the device, use the identifierForVendor property of UIDevice instead.
(Apps that need an identifier for their own advertising purposes should consider using the advertisingIdentifier property of ASIdentifierManager instead.)

Way1: iOS version is less than or equal to 10.1

  1. Connect to any Wi-Fi.
  2. Get current IP address of Wi-Fi.
  3. Send ICMP echo request(ping) to the IP address.(not the IP address, 127.0.0.1)
  4. Walk whole ARP table to search the MAC address of current IP address of Wi-Fi.
  5. Get your MAC address.

Way2: iOS version is less than or equal to 10.2.1

  1. Connect to any Wi-Fi.
  2. Get current IP address of Wi-Fi.
  3. Send ICMP echo request(ping) to the IP address.(not the IP address, 127.0.0.1)
  4. Get an ARP entry by current IP address of Wi-Fi.
  5. Get your MAC address.

Way3: iOS version is greater than 10.1(or lesser version)

  1. Connect to any Wi-Fi.
  2. Get current IP address of Wi-Fi.
  3. Send MDNS query that question "_apple-mobdev2._tcp.local" with PTR record.
  4. Response data will content MAC address.
  5. Get your MAC address.

Result

Include 2 different iOS version.

iosgetmacaddress's People

Contributors

qbsuranalang avatar

Watchers

James Cloos avatar xelz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.