60 lines
1.6 KiB
Plaintext
60 lines
1.6 KiB
Plaintext
fko python module version 1.0
|
|
==============================
|
|
|
|
This module is essentially a Python wrapper for the Firewall Knock
|
|
Operator library, "libfko". See the "libfko" documentation for
|
|
additional information on the functionality provided by "libfko"
|
|
and usage overview.
|
|
|
|
Before attempting to build this module, libfko needs to be installed on
|
|
the system.
|
|
|
|
To build and install the module:
|
|
|
|
* Build with "python setup.py build"
|
|
* Install with "python setup.py install"
|
|
|
|
|
|
Simple usage example:
|
|
|
|
#!/usr/bin/python
|
|
#
|
|
# Import the Fko class and all constants.
|
|
#
|
|
from fko import *
|
|
|
|
# Create an Fko instance with an empty context.
|
|
#
|
|
fko = Fko()
|
|
|
|
# Set the SPA message (Note: Access request is default if not specified).
|
|
#
|
|
fko.spa_message("0.0.0.0,tcp/22")
|
|
|
|
# Create the final SPA data message string.
|
|
#
|
|
fko.spa_data_final("mypassword")
|
|
|
|
# print the spa message.
|
|
#
|
|
print fko.spa_data()
|
|
|
|
(prints something like this):
|
|
81ugT7+dv6p0qKPmFKwZYz9qAtqThBib+mIeZae9FK2UYQF5CNyujAmEH2+0CBxm3DpArlyySWqdfITvmfSBd11XbFPksK3iqWAPR65lVTYXrNywOxVN65Nmm9D0Qzsczx1hkeNg+g8qxecxO1XBc/LdHEa5C0FmI
|
|
|
|
# To decode SPA data:
|
|
#
|
|
fko = Fko("81ugT7+dv6p0qKPmFKwZYz9qAtqThBib+mIeZae9FK2UYQF5CNyujAmEH2+0CBxm3DpArlyySWqdfITvmfSBd11XbFPksK3iqWAPR65lVTYXrNywOxVN65Nmm9D0Qzsczx1hkeNg+g8qxecxO1XBc/LdHEa5C0FmI", "mypassword")
|
|
|
|
# Print some of the data:
|
|
#
|
|
print "Version:", fko.version()
|
|
print "Timestamp:", fko.timestamp()
|
|
print "Username:", fko.username()
|
|
print "Digest Type (value):", fko.digest_type()
|
|
print "Digest Type (string):", fko.digest_type_str()
|
|
print "Digest:", fko.spa_digest()
|
|
print "SPA Message:", fko.spa_message()
|
|
|
|
|