Is there a perl script that can read the cpu id of the computer that runs the specific perl script

This works for me - Install this script in the cgi directory in the server, and you will be able to read the cpu id using a browser (note: you must install the "cpuid" executable)

#! /usr/bin/perl use strict; print "Content-type: text/plain\n\n"; print `cpuid`;

is there a way also to spoof the cpu id

Sure. Just use this other script instead:

#! /usr/bin/perl use strict; print "Content-type: text/plain\n\n"; print <<EOT; eax in eax ebx ecx edx 00000000 00000002 756e6547 6c65746e 49656e69 00000001 00000f29 0602080b 00004400 bfebfbff 00000002 665b5001 00000000 00000000 007b7040 80000000 80000004 00000000 00000000 00000000 80000001 00000000 00000000 00000000 00000000 80000002 20202020 20202020 20202020 20202020 80000003 6e492020 286c6574 58202952 286e6f65 80000004 20294d54 20555043 36302e33 007a4847 Vendor ID: "GenuineIntel"; CPUID level 2 Intel-specific functions: Version 00000f29: Type 0 - Original OEM Family 15 - Pentium 4 Extended family 0 Model 2 - Stepping 9 Reserved 0 Brand index: 11 [not in table] Extended brand string: " Intel(R) Xeon(TM) CPU 3.06GH +z" CLFLUSH instruction cache line size: 8 Initial APIC ID: 6 Hyper threading siblings: 2 [cut] EOT

In reply to Re: Can Perl read CPU id? by fglock
in thread Can Perl read CPU id? by Nik

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.