jpers
Posts: 24
Joined: Mon May 23, 2016 6:06 am

Identifying Raspberry Pi version from MAC or serial number?

Thu Jan 19, 2017 1:44 pm

Hello all,

is there any consistent serial numbering scheme for different Raspberry Pi models to enable model detection solely from the Raspberry Pi serial number? Serial number is also part of the MAC address (last 6 digits, afaik?), so it would be really helpful for us with different headless devices scattered around the network.

Anything?

Janez.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2944
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Identifying Raspberry Pi version from MAC or serial numb

Thu Jan 19, 2017 1:47 pm

No there isn't - serial numbers are randomised.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Identifying Raspberry Pi version from MAC or serial numb

Thu Jan 19, 2017 2:04 pm

If you have 'headless' access to the RPi sufficient to determine the serial number you could equally well interrogate the version information.

jpers
Posts: 24
Joined: Mon May 23, 2016 6:06 am

Re: Identifying Raspberry Pi version from MAC or serial numb

Thu Jan 19, 2017 3:27 pm

B.Goode wrote:If you have 'headless' access to the RPi sufficient to determine the serial number you could equally well interrogate the version information.
Not true. Using

Code: Select all

sudo nmap -v -A network/netmask
I can get MAC addresses of the devices present on the network. Pi's serial number can be derived from the MAC address - it is the last 6 digits.

In our lab, there are always few Raspberries of various models connected to the network since people use them for their projects, so usually I can pinpoint the one I want by focusing on the model.

richrarobi
Posts: 271
Joined: Sun Feb 08, 2015 1:13 pm

Re: Identifying Raspberry Pi version from MAC or serial numb

Fri Jan 27, 2017 9:42 am

Does
cat /proc/cpuinfo
give what you want? I use this to tell if a processor is ARM or not - so I don't run pi stuff on my Linux system.

Code: Select all

def is_ARM():
    tmp = runprc("cat /proc/cpuinfo")
    for line in tmp.splitlines():
        if "model name" in line:
            x, t = line.split(": ")
            if "ARM" in t:
                return True
    return False
runprc is a wrapper for subprocess.Popen
p.s. I use rpc everywhere so I can query any processor, from anywhere (in-house) ..... This may not be so easy without that facility!!
Last edited by richrarobi on Fri Jan 27, 2017 9:53 am, edited 1 time in total.

User avatar
RaTTuS
Posts: 10559
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Identifying Raspberry Pi version from MAC or serial numb

Fri Jan 27, 2017 9:44 am

jpers wrote:
B.Goode wrote:If you have 'headless' access to the RPi sufficient to determine the serial number you could equally well interrogate the version information.
Not true. Using

Code: Select all

sudo nmap -v -A network/netmask
I can get MAC addresses of the devices present on the network. Pi's serial number can be derived from the MAC address - it is the last 6 digits.

In our lab, there are always few Raspberries of various models connected to the network since people use them for their projects, so usually I can pinpoint the one I want by focusing on the model.
you would have to keep a db of your local ones to be sure ...
the MAC is not good enough to ID it without logging into it
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

jpers
Posts: 24
Joined: Mon May 23, 2016 6:06 am

Re: Identifying Raspberry Pi version from MAC or serial numb

Fri Jan 27, 2017 10:34 am

richrarobi wrote:Does
cat /proc/cpuinfo
give what you want? I use this to tell if a processor is ARM or not - so I don't run pi stuff on my Linux system.

Unnecessary for this purpose (and accepting "pi" as valid user is usually dead giveaway :D ). I get all I need from the nmap. For those not familiar, here is an example of the info it gives about each pi found on the system - it is awesome tool for managing a lot of scattered embedded stuff on a local network. This example is from raspberry connected to the network wirelessly through WiPi dongle, so it does not report "Raspberry Pi foundation" with the MAC address, but it is pretty clear that it is the raspbbery behind the IP address.

Code: Select all

Nmap scan report for 192.168.90.133
Host is up (0.0014s latency).
Not shown: 998 closed ports
PORT     STATE SERVICE VERSION
22/tcp   open  ssh     (protocol 2.0)
|_ssh-hostkey: ERROR: Script execution failed (use -d to debug)
8080/tcp open  sip     (SIP end point; Status: 404 OK)
|_http-methods: No Allow or Public header in OPTIONS response (status code 200)
|_http-title: UV4L Streaming Server
2 services unrecognized despite returning data. If you know the service/version, please submit the following fingerprints at http://www.insecure.org/cgi-bin/servicefp-submit.cgi :
==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
SF-Port22-TCP:V=6.40%I=7%D=1/27%Time=588B1D08%P=x86_64-redhat-linux-gnu%r(
SF:NULL,22,"SSH-2\.0-OpenSSH_6\.7p1\x20Raspbian-5\r\n");
==============NEXT SERVICE FINGERPRINT (SUBMIT INDIVIDUALLY)==============
(many lines deleted here)
MAC Address: 00:0F:13:40:1D:D7 (Nisca)
No exact OS matches for host (If you know what OS is running on it, see http://nmap.org/submit/ ).
TCP/IP fingerprint:
(deleted)
So, as you can see, no, you don't need to actually log into the device to get a lot of information (and by extension, a malicious attacker can, too). Beware. Oh, if anyone can deduce the model of the Pi from the above info, that would be cool, as well, but I think that is not possible.

Return to “Advanced users”