473,326 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

local interpreter remote machines

This may not be possible, but I thought I'd ask anyway. Could I get the
below code to run on a Python server where other machines would connect
to it (say thru the Web) and get details of *their* system instead of
the system details of the machine that the interpreter is running on?
Any ideas?

Thanks!!!

import os
import socket

x = os.uname()
y = socket.gethostbyaddr(x[1])
print
print "This is the connecting machine's os:", x[0]
print "This is the connecting machine's os version:", x[2]
print "This is the connecting machine's IP address:", y[2]
print

Jul 18 '05 #1
4 1878
hokieghal99 <ho********@hotmail.com> writes:
This may not be possible, but I thought I'd ask anyway. Could I get
the below code to run on a Python server where other machines would
connect to it (say thru the Web) and get details of *their* system
instead of the system details of the machine that the interpreter is
running on? Any ideas?


In general, what you're asking for is called OS fingerprinting. It's
an active topic in security research. Figuring out a remote system's
OS is the first step towards breaking into it, so there's a slow but
growing effort among OS implementers to thwart attempts at
fingerprinting.

In simple cases, though, you can do stuff like connect to the remote
IP address's port 80 and see if you can get any HTTP server headers to
examine, and stuff like that.

OS's also leave inadvertent fingerprints, like the "randomly
generated" TCP sequence numbers which have detectable statistical
patterns on some systems. If you can detect such a pattern, that
often lets you identify the remote OS.
Jul 18 '05 #2
hokieghal99 wrote:
This may not be possible, but I thought I'd ask anyway. Could I get the
below code to run on a Python server where other machines would connect
to it (say thru the Web) and get details of *their* system instead of
the system details of the machine that the interpreter is running on?
Any ideas?


If you also have Python running on the other machine,
you can do this very easily with Pyro: http://pyro.sourceforge.net
(no network programming necessary at all).

Essentially you create an object on the remote machine that contains
a method with the code you want to execute, and you call that object
-using Pyro- as if it was located on your own computer.

But this only works if you have a supported Python version running
on the remote machine, and that you are allowed to connect to that
machine over the network.

You can even create some python code on your local machine, and
actually submit that to the other machine, let it deal with it,
and then get the results back.
But only do this if you know that no unauthorised user can do this,
because this is a security risk.

--Irmen de Jong.
Jul 18 '05 #3
Irmen de Jong wrote:
hokieghal99 wrote:
This may not be possible, but I thought I'd ask anyway. Could I get
the below code to run on a Python server where other machines would
connect to it (say thru the Web) and get details of *their* system
instead of the system details of the machine that the interpreter is
running on? Any ideas?

If you also have Python running on the other machine,
you can do this very easily with Pyro: http://pyro.sourceforge.net
(no network programming necessary at all).

Essentially you create an object on the remote machine that contains
a method with the code you want to execute, and you call that object
-using Pyro- as if it was located on your own computer.

But this only works if you have a supported Python version running
on the remote machine, and that you are allowed to connect to that
machine over the network.

You can even create some python code on your local machine, and
actually submit that to the other machine, let it deal with it,
and then get the results back.
But only do this if you know that no unauthorised user can do this,
because this is a security risk.

--Irmen de Jong.


Thank you, this is exactly what I was looking for!

Jul 18 '05 #4
hokiegal99 wrote:
Irmen de Jong wrote:
[...about Pyro...]
Thank you, this is exactly what I was looking for!


While Pyro may be of help (I'm sure it will be ;-) you
should not forget that there are many other ways to do
what you want.
For instance, you could also create a simple web server
application on the remote machine that has a page on which
those data about the remote machine are written.
You can then get the data from the web page using the
urllib module.

For really good advice you will have to tell a lot
more about what you want exactly (and how it should work)...

Good luck!

--Irmen
Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: DKode | last post by:
Ok, Maybe there is an easier way to do what it is im trying to do. Let me explain how I have the solution setup first. Basically, I am having alot of difficulty debugging on my local machine and...
5
by: guy | last post by:
In the past I've used sockets in C++ to allow apps to communicate with each other over a local network. Is there anything better/more advanced in .NET or should I continue to use sockets and the...
2
by: enrique | last post by:
Hello everyone, I'm looking for a "directory path" solution that will allows me to test my app locally and then test on remote web server without having to update my web.config file each time I...
0
by: Michael Höhne | last post by:
Hi, we're developing some web services and use the local development server of Visual Studio 2005 to create, run and debug the project. The web service methods connect to a database hosted on a...
1
by: lauralucas | last post by:
Hello I'm using ASP.NET 1.1, Visual Studio 2003, IIS 5.1 and windows XP as development machine. I can work in this machine locally and create web apps that I can access via localhost. No problem...
2
by: Chris Marsh | last post by:
Hi all I have one machine (A) which is not on a domain. There is an local user account on A (userA) that has access to a certain folder. I have another machine (B). An application on B...
5
by: Alan Silver | last post by:
Hello, Server configuration: Windows 2003 Server SP2 SQL Server 2000 SP4 ..NET v2.0.50727 just built up a new server using the same configuration as my current one. I even used the same CDs...
4
by: quincy451 | last post by:
I am running MS SQL 2000 server. The table involved is only about 10,000 records. But this is the behavior I am seeing. The local machine is querying the table looking for a particular record....
12
by: =?Utf-8?B?YXVsZGg=?= | last post by:
i current have a way to read both local and remote machines registry keys and create a textual view (.txt output). i now looking for ways to do export of local and remote mahcine registry keys...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.