Giter Site home page Giter Site logo

reincubate / deviceidentifier-py Goto Github PK

View Code? Open in Web Editor NEW
13.0 8.0 6.0 37 KB

Utils to manipulate and learn from assorted device identifier formats via Reincubate's API.

Home Page: https://reincubate.com/deviceidentifier-api/

License: GNU Lesser General Public License v3.0

Makefile 0.69% Python 99.31%
imei iccid apple serial model api identifier meid udid

deviceidentifier-py's Introduction

DeviceIdentifier API Python library

Utils to manipulate and learn from assorted device identifier formats via Reincubate's DeviceIdentifier API.

Technical documentation is available on Reincubate's site.

Getting started

Try these:

$ pip install deviceidentifier

Calls to the API through this client then become easy:

from deviceidentifier import api

# Look up an Apple serial number
api.lookup( api.TYPE_APPLE_SERIAL, 'C8QH6T96DPNG' )

# Identify the type of an identifier
api.identify_identifier( 'iPhone5,3' )

# Triangulate a bunch of data from a collection of identifiers
api.enhance_metadata(
    apple_identifier='iPhone5,3',
    apple_serial='C8QH6T96DPNG',
    gsma_imei='013554006297015',
    gsma_iccid='8965880812100011146'
)

The API supports anonymous access, and provides limited, rate-limited data when doing so. Tokens can be obtained by contacting Reincubate, and either by setting an environment variable:

$ export RI_DEVID_TOKEN='api-authentication-token'

Or by passing the token value directly into the code:

from deviceidentifier import api

# Look up an Apple serial number
api.lookup( api.TYPE_APPLE_SERIAL, 'api-authenticaton-token', 'C8QH6T96DPNG' )

Using the command-line interface

Apple

Apple serial numbers: legacy (80s & 90s), old (early 2000s) and post-2010 formats

$ python -m deviceidentifier.cli.apple_serial C8QH6T96DPNG
{
    "anonymised": "C8QH6•••DPNG",
    "configurationCode": {
        "code": "DPNG",
        "image": {
            "height": 120,
            "url": "https://di-api.reincubate.com/resource-159c9e87a3d6bbf5075bb030fa2925a0/",
            "width": 120
        },
        "skuHint": "iPhone 4 CDMA (8GB)"
    },
    "coverageUrl": "https://checkcoverage.apple.com/gb/en?sn=C8QH6T96DPNG",
    "id": "C8QH6T96DPNG",
    "manufacturing": {
        "city": "",
        "company": "",
        "country": "China",
        "date": "2012-02-05",
        "flag": "🇨🇳",
        "id": "C8Q"
    },
    "serialType": "2010",
    "uniqueId": {
        "productionNo": 31524,
        "value": "T96"
    }
}

Apple model numbers

$ python -m deviceidentifier.cli.apple_model MC605FD/A
{
    "anonymised": "C605",
    "appleIdentifier": {
        "id": "iPhone3,1",
        "image": {
            "height": 330,
            "url": "https://di-api.reincubate.com/resource-26b007e1007180a28e272036775a48a0/",
            "width": 450
        },
        "product": {
            "line": "iPhone",
            "sku": "iPhone 4"
        },
        "variant": "GSM"
    },
    "id": "C605",
    "region": {
        "flags": "🇦🇹🇱🇮🇨🇭",
        "name": "Austria, Liechtenstein, Switzerland"
    },
    "specification": {
        "case_size": "",
        "colour": "Black",
        "material": "",
        "storage": "32 GB"
    },
    "type": "Retail"
}

Apple identifiers

$ python -m deviceidentifier.cli.apple_identifier iPhone5,3
{
    "id": "iPhone5,3",
    "image": {
        "height": 330,
        "url": "https://di-api.reincubate.com/resource-775ac9634280be8d7dfb0b75b4727f69/",
        "width": 450
    },
    "product": {
        "line": "iPhone",
        "sku": "iPhone 5c"
    },
    "variant": "GSM + CDMA"
}

Apple internal names

$ python -m deviceidentifier.cli.apple_internal_name N92AP
{
    "appleIdentifier": {
        "id": "iPhone3,3",
        "image": {
            "height": 330,
            "url": "https://di-api.reincubate.com/resource-1e7820cb714e3d477534f291c0f87e83/",
            "width": 450
        },
        "product": {
            "line": "iPhone",
            "sku": "iPhone 4"
        },
        "variant": "CDMA"
    }
}

Apple IDFA / IDFV

$ python -m deviceidentifier.cli.apple_idfa 002ebf12-a125-5ddf-a739-67c3c5d20177
{
    "anonymised": "••••••••-••••-••••-••••-••••••••••••",
    "formatted": "002ebf12-a125-5ddf-a739-67c3c5d20177"
}

Apple UDIDs

$ python -m deviceidentifier.cli.apple_udid db72cb76a00cb81675f19907d4ac2b298628d83c
{
    "anonymised": "••••••••••••••••••••••••••••••••••••••••",
    "compromised": false,
    "formatted": "db72cb76a00cb81675f19907d4ac2b298628d83c"
}

Apple "A" numbers

python -m deviceidentifier.cli.apple_anumber A1784
{
    "appleIdentifier": {
        "id": "iPhone9,4",
        "image": {
            "height": 330,
            "url": "https://di-api.reincubate.com/resource-d8c14fc2a4dfcf27d5a217fb5e4c0cc4/",
            "width": 450
        },
        "product": {
            "line": "iPhone",
            "sku": "iPhone 7 Plus"
        },
        "variant": "GSM"
    }
}

CDMA

Mobile Equipment Identifier (MEIDs)

$ python -m deviceidentifier.cli.cdma_meid 354403064522046
{
    "anonymised": "35440306••••••6",
    "checksum": "6",
    "id": "354403064522046",
    "manufacturer": "440306",
    "pESN": "808D1904",
    "regionCode": {
        "code": "35",
        "group": "Comreg",
        "origin": "Ireland"
    },
    "serial": "452204"
}

GSMA

IMEIs (enriched with data from Apple's GSX service for clients with access)

$ python -m deviceidentifier.cli.gsma_imei 013554006297015
{
    "anonymised": "01355400••••••5",
    "checksum": "5",
    "gsmaTac": {
        "appleModel": {
            "anonymised": "D298",
            "appleIdentifier": {
                "id": "iPhone5,2",
                "image": {
                    "height": 330,
                    "url": "https://di-api.reincubate.com/resource-c2aac9e5e3695fca1090633a4ea1b60d/",
                    "width": 450
                },
                "product": {
                    "line": "iPhone",
                    "sku": "iPhone 5"
                },
                "variant": "CDMA + LTE"
            },
            "id": "D298",
            "region": {
                "flags": null,
                "name": null
            },
            "specification": {
                "case_size": "",
                "colour": "White",
                "material": "",
                "storage": "16 GB"
            },
            "type": "Retail"
        },
        "id": "01355400",
        "manufacturer": "Apple",
        "product": {
            "line": "iPhone",
            "sku": "iPhone 5"
        }
    },
    "gsx": {
        "appleSerial": {
            "anonymised": "F2TK4•••DTWF",
            "configurationCode": {
                "code": "DTWF",
                "image": {
                    "height": 120,
                    "url": "https://di-api.reincubate.com/resource-4cb3c6fe7c62f327cd11712196c221b0/",
                    "width": 120
                },
                "skuHint": "iPhone 5 (GSM, CDMA)"
            },
            "coverageUrl": "https://checkcoverage.apple.com/gb/en?sn=F2TK4TZ7DTWF",
            "id": "F2TK4TZ7DTWF",
            "manufacturing": {
                "city": "Zhengzhou",
                "company": "Foxconn",
                "country": "China",
                "date": "2013-01-22",
                "flag": "🇨🇳",
                "id": "F2T"
            },
            "serialType": "2010",
            "uniqueId": {
                "productionNo": 32341,
                "value": "TZ7"
            }
        },
        "sale": {
            "estimatedPurchaseDate": "2013-04-10",
            "initialCarrier": "Sweden Tele2.",
            "realPurchaseDate": "2013-04-10",
            "saleRegion": "Sweden",
            "saleRegionFlag": "🇸🇪",
            "seller": "TELE2 SVERIGE AB"
        },
        "skuHint": "IPHONE 5",
        "specifications": [
            "WHITE",
            "16GB",
            "GSM"
        ],
        "status": {
            "appleId": null,
            "coverage": "Out Of Warranty (No Coverage)",
            "sim": "Locked"
        }
    },
    "id": "013554006297015",
    "reportingBodyIdentifier": {
        "code": "01",
        "group": "PTCRB",
        "origin": "United States"
    },
    "serial": "629701",
    "svn": null,
    "type": "IMEI"
}

Type allocation codes (TAC)

$ python -m deviceidentifier.cli.gsma_tac 01326300
{
    "appleModel": {
        "anonymised": "D198",
        "appleIdentifier": {
            "id": "iPhone3,1",
            "image": {
                "height": 330,
                "url": "https://di-api.reincubate.com/resource-26b007e1007180a28e272036775a48a0/",
                "width": 450
            },
            "product": {
                "line": "iPhone",
                "sku": "iPhone 4"
            },
            "variant": "GSM"
        },
        "id": "D198",
        "region": {
            "flags": "🇮🇳",
            "name": "India"
        },
        "specification": {
            "case_size": null,
            "colour": "White",
            "material": null,
            "storage": "8 GB"
        },
        "type": "Retail"
    },
    "id": "01326300",
    "manufacturer": "Apple",
    "product": {
        "line": "iPhone",
        "sku": "iPhone 4"
    }
}

ICCIDs

$ python -m deviceidentifier.cli.gsma_iccid 8965880812100011146
{
    "anonymised": "896588••••••••••••6",
    "atiiccid": null,
    "checksum": "6",
    "issuer": {
        "code": "88",
        "country": {
            "code": "65",
            "flag": "🇸🇬",
            "name": "Singapore"
        },
        "name": null
    },
    "majorIndustry": {
        "code": "89",
        "industry": "Telecommunications administrations and private operating agencies",
        "type": "Healthcare, telecommunications and other future industry assignments"
    },
    "month": "08",
    "simNumber": "001114",
    "switch": "10",
    "year": "12"
}

Identifying an identifier

$ python -m deviceidentifier.cli.identify_identifier iPhone5,3
{
    "iPhone5,3": [
        "apple_identifier"
    ]
}

Troubleshooting

See the support & service status page.

Need more functionality?

Reincubate's vision is to provide data access, extraction and recovery technology for all app platforms - be they mobile, desktop, web, appliance or in-vehicle.

The company was founded in 2008 and was first to market with both iOS and iCloud data extraction technology. With over half a decade's experience helping law enforcement and security organisations access iOS data, Reincubate has licensed software to government, child protection and corporate clients around the world.

The company can help users with:

  • iCloud access and data recovery
  • Recovery of data deleted from SQLite databases
  • Bulk iOS data recovery
  • Forensic examination of iOS data
  • Passcode, password, keybag and keychain analysis
  • Custom iOS app data extraction
  • Advanced PList, TypedStream and Mbdb manipulation

Contact Reincubate for more information.

Terms & license

See the LICENSE file for details on this implementation's license. Users must not use the API in any way that is unlawful, illegal, fraudulent or harmful; or in connection with any unlawful, illegal, fraudulent or harmful purpose or activity.

deviceidentifier-py's People

Contributors

afit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deviceidentifier-py's Issues

ImportError: cannot import name api

Hi all, when trying to import the module, I get the following error, any pointers? Running Python 2.7.15 and am following the documentation here

Traceback (most recent call last):
  File "deviceidentifier.py", line 1, in <module>
    from deviceidentifier import api
  File "/Users/benranford/x/x/x/deviceidentifier.py", line 1, in <module>
    from deviceidentifier import api
ImportError: cannot import name api

Apple device manufacturing date isn't accurate

api.lookup(api.TYPE_APPLE_SERIAL, 'C07RT086G1HV')
Token not specified, relying on anonymous access which may be limited or rate-limited
Out[173]: 
{'anonymised': 'C07RT•••G1HV',
 'configurationCode': {'code': 'G1HV',
  'image': {'height': 120,
   'url': 'https://di-api.reincubate.com/resource-13d37be619fe74f95b04d57d8c3d4e94/',
   'width': 120},
  'skuHint': 'Mac mini (Late 2014)'},
 'coverageUrl': 'https://checkcoverage.apple.com/gb/en?sn=C07RT086G1HV',
 'id': 'C07RT086G1HV',
 'manufacturing': {'city': '',
  'company': 'Tech Com, Quanta Computer Susidiary',
  'country': 'China',
  'date': '2016-06-03',
  'flag': '🇨🇳',
  'id': 'C07'},
 'serialType': '2010',
 'uniqueId': {'productionNo': 278, 'value': '086'}}

skuHint is Mac mini (Late 2014), but manufacturing date is 2016-06-03.

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.