![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Is there any way to find out what OS someone's using (Windows, Linux, FreeBSD, Mac OS etc.), and which version?
|
|
|
|
|
|
#2 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
You'd probably have to look up OS fingerprinting, but I have no idea how it works, so I can't help you there. Sorry.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#3 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
I meant the local OS - the OS the app is being run from. As far as I know, fingerprinting is finding out what OS is running on a remote computer by determining characteristics.
|
|
|
|
|
|
#4 |
|
Expert Programmer
|
OS fingerprinting attempts to find a user's OS remotely (or even over a local network, or computer) by probing open TCP ports and determining characteristics on the ports available and not available as well as the data the available ports return pertaining to specific operating systems.
What your looking for you would think to be easier, however the problem stands that every operating system really has their own way of recording that information. Where do you plan on attempting to epxtrapolate this information? Trying to detmine an OS from a browser with Javascript is much more different than doing so from a command line.
__________________
Clifford Matthew Roche <geek@cliffordroche.com> Web Hosting: http://www.crd-hosting.com Consulting: http://www.crdev-consulting.com |
|
|
|
|
|
#5 |
|
Programming Guru
![]() ![]() ![]() |
This is a one-liner in PHP. Any reason you are using C++?:
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#6 |
|
Programming Guru
![]() |
it could be a desktoip application? make sure whoever is running the program is using the correct operating system to run it with? as i make it so you dont run a win xp appication on a win 98 system as the libraries are different?
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity." - Albert Einstein |
|
|
|
|
|
#7 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Bingo. I also want to use function pointers or virtual functions (not sure which) to sort out which function should be used for each OS, effectively making it cross-compatible. Isn't there a #define I can test? I think there's one called _WIN32, but I have no idea about Linux. I know I can call system("ver > file") and then read the file - can I do that on Unix too?
|
|
|
|
|
|
#8 |
|
Programming Guru
![]() |
As far as linux/windows goes you pretty much know where it is being ran from (unless wine is involed, or something of the sort) by what you compiled it with. As for windows i would say check the registry under HKEY_CURRENT_VER (i am NOT a windows programmer, so please forgive me if i am talking out of my ass) or something like that and look up registry values with the functions defined in #include <windows.h>, as for linux... hmm... good question.
__________________
|
|
|
|
|
|
#9 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
I'll probably use ver on Windows - much simpler. I just want to know how to detect whether I'm using Linux so I can sort out which #includes to... include, I suppose.
|
|
|
|
|
|
#10 |
|
Programming Guru
![]() |
#includes are done at compile! And compilation isnt cross-platform. That means that you cant decide just which includes you want to execute, because they are simply code thats added to your program when it is "made".
__________________
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|