NAME

XML-RPC Client GUI

Back to Top


VERSION

Release date = 2006-05-27

Back to Top


SYNOPSIS

perl gus_xml-rpc_client_tk.pl --help

Back to Top


DESCRIPTION

An XML-RPC client GUI useful in triggering external Perl scripts on any PC running the companion server.

Back to Top


FEATURES

User Options

These are things you can and should change.

Server Method Paths

The companion server for this client employs a custom XML-RPC method named execute_script where the client sends it a text string containing the path to an external Perl script. The server then opens said script as a script (aka 'runs' it). For security reasons, only a finite set of these will the server accept. This list is available to the client in the form of a line-delimited *.txt file. So that the client may find this list, you will need your own default directory path and default file name in the obvious place near the head of this XML-RPC client script.

When Sharing a Network Directory

This is to say, when a common path is attainable by both server and client. Click the Execute button on the client, then browse the shared network for a *.txt file of server-approved *.pl files. A pop-up menu of that very list will appear. Select any of the *.pl files which you wish the server to run.

When Residing on Separate Networks

This is to say, when neither the server nor client share any hard drive resources. Click the Execute button on the client, then browse the local network for an updated copy of the *.txt file listing server-approved *.pl files. A pop-up menu of that copied list will appear. Select any of the *.pl files, et cetera, which you wish the server to execute.

Local Port

The default local port for server URLs is 8080. This may be overriden by calling the client via command line and listing some port other than 8080 as the first command-line argument. Or you may prefer to edit the built-in default near the head of this script. Chances are you need not change this. But if you should find that port 8080 is already in use for some other service (or blocked by a firewall), try instead port 8888, or any other as deemed convenient.

For the add_doc_elsewhere method

This is a method where, upon clicking the Send button, you browse for a pure ASCII document. A filtered copy thereof will be transmitted to selected servers. Upon receipt, each server will choose its own path for whatever kind of file it is.

The aforementioned filtering is accomplished skipping over any such lines as match against regular expressions from the %lines_to_skip hash whose keys are likewise regular expressions matching the filenames of user-selected documents.

Example usage
The author employs the add_doc_elsewhere method as follows. Certain MTS servo-hydraulic testing machines which are left to run unattended on weekends had formerly required on-site visitation by operators working on overtime, and at their considerable inconvenience. Most frequently, however, such efforts were merely to determine that, no, the machines in question had not stopped and did not therefor require any service.

Choosing Servers

At startup, this client will only know its own URL (on the assumption that the companion XML-RPC server runs there also...for testing purposes, or whatever). To change this, read in a list of any other URLs from a text file via the pull-down menu 'Config', sub-menu 'Load Server URLs'. Said text file should contain one URL per line, such as 168.192.0.1 or foo.bar.net:8080 or foo.bar.net:8080/RPC2. On any such URL, if at front the http:// or at back either the :8080 or the /RPC2 are missing, they will be added. Or you may prefer to edit the built-in default list near the head of this script. Optionally, each listed URL may include a single TAB followed by descriptive text on the same line.

Client Relays

The firewall-penetrating ability of XML-RPC can be exploited to relay communication with various daemons other than just XML-RPC itself.

SQL Queries
An SQL client is already built into the companion XML-RPC server. Thus are SQL queries facilitated anywhere you can run the XML-RPC client. The author employs this for prototyping on his PostgreSQL server at home an equipment calibration DB for eventual use at work thus affording the freedom to tinker with it after hours and on weekends.

Back to Top


SECURITY

Encryption
A full 56-byte Blowfish cipher is employed to secure data contained within the otherwise standard XML-RPC transactions. At startup, both client and server must employ identical plain text pass phrases (refer to $cipher_key near the head of each). Or if this has been left empty, a default pass phrase (refer to $GUS::Crypt::DEFAULT_KEY near the tail of each) will serve in its stead. The client may later propagate new pass phrases to selected servers at any time.

For all methods
Method names are irreversibly obfuscated at startup (refer to subroutine $GUS::Crypt::obfuscate for details) and again each time the cipher is changed.

Transactions also require a password. At startup, both client and server must employ identical plain text passwords (refer to $plain_pw near the head of each). The client may later propagate new passwords to selected servers at any time. Obviously, when leaving the client unattended, you should delete any stars from the password entry widget.

For the execute_script method
In making a script-execution request, all that the client does is pass a name to the server. The server makes its own determination whether to run said script. Firstly, the server enforces its own directory for executable scripts (same as for $script_list ) stripping away any ascending path elements. Secondly, it checks against its own list of allowable scripts (ref $script_list). Thirdly it makes sure the script is pure ASCII. Lastly it insures against any modification since upload or server startup.

Vulnerabilities
The server enforces whatever conditions it found on startup. That is to say, it cannot know whether a script to be employed by the execute_script method is free from any malicious tampering prior to startup. This is the sole responsibility of the user.

Back to Top


DEPENDENCIES

Perl Modules

Install these into Perl via ActiveState PPM, else into NetBSD pkgsrc or CPAN as appropriate for your OS: Frontier::Client , Tk , Sys::Hostname::Long, Crypt::CBC , Crypt::Blowfish, Log::Logger, XML::Simple, Data::Dumper.

A number of my own GUS::* packages are already embeded in both the client and server scripts. These do not add much that is truly novel but exist as separate packages for the sake of authorial convenience.

For Unix

Nothing here presentes itself as a difficulty. Required external dependencies are available from the expected sources: /usr/pkgsrc for NetBSD and/or CPAN for Perl. I cannot say for Linux, since I have yet to try it. If any report a problem for Linux, I would very like to help work it out and document the solution here.

For Win32

No especial problems here either, except that some things are not where most folks expect to find them.

Cryptography for ActiveState Perl 5.8
The Crypt::* family of modules is not fully maintained by ActiveState who fears a lowering brow the US alphabet agencies. Happily, folks in more freedom-loving countries have ammended this lack. Just perform these steps in the ActiveState PPM window.

ppm> help repository

ppm> repository add ``Lincoln Stein'' http://stein.cshl.org/ppm

ppm> repository add ``Randy Kobes'' http://theoryx5.uwinnipeg.ca/ppms

Companion XML-RPC Server

Unless the companion Perl script gus_xml-rpc_server.pl running on some other network-attached PC, this client GUI will lack any server to communicate with. Refer to documentation for the server at this URL: http://starling.us/tet/gus_perl/gus_xml-rpc_pl/gus_xml-rpc_server.html.

For testing purposes, of course, client and server may both be run on a single PC.

Auxilliary Perl Scripts

For use with the execute_script method. Refer to documentation of the companion XML-RPC server for a complete list of these.

Auxilliary Text Files

At startup the client only knows its own URL. That of course assumes the companion XML-RPC server to be running on the same PC. Other than for testing purposes this is clearly rather silly. To be useful then, create your own list of URLs storing these in a text file. Refer to the pull-down help menu for an example.

Back to Top


AUTHOR

Gan Uesli Starling <gan@starling.us>

Back to Top


COPYRIGHT

Copyright (c) 2005-2006, Gan Uesli Starling. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Back to Top


SCRIPT CATEGORIES

Network

Back to Top