diff --git a/README.md b/README.md index 4344fd3..3346bc2 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,8 @@ By default, several plugins are included. ### Usage ``` -usage: ifxlookup [-h] [-c CONFIG] [-f FILTER] [-j] [-cg] [-b] [-l] [-gc] [-d] [-cms] [-vm] [-r] [-w] [-s] [-fw] [-m] [-v] subjects [subjects ...] +usage: ifxlookup [-h] [-c CONFIG] [-f FILTER] [-j] [-cg] [-b] [-l] [-gc] [-d] [-cms] [-vm] [-r] [-w] [-s] [-fw] [-m] [-v] + subjects [subjects ...] positional arguments: subjects IP's, hostnames, MAC's, usernames, or other strings to look up. @@ -36,18 +37,18 @@ optional arguments: -f FILTER, --filter FILTER Apply a JSONPath filter to the results (multiple filters may be specified) -j, --json Format output as json - -cg, --vip Return VIP information about the subject (f5) - -b, --bluecat Return network information about the subject (bluecat) - -l, --ldap Return LDAP information about the subject (ldap) - -gc, --guid_channels Return working channels for GUID - -d, --dns Return DNS resolution about the subject (dns) - -cms, --channel Return CMS channel info about the subject (cms) - -vm, --vm Return VMWare information about the subject (vmware) - -r, --vpn Return VPN information about the subject (openvpn) - -w, --wifi Return wireless connection information about the subject (aruba) - -s, --shodan Return Shodan information about the subject (dns) - -fw, --rules Return Firewall addresses, groups, and rules relating to the subject - -m, --mac Return vendor OUI from a MAC address (mac) + -cg, --vip VIP information about the subject (f5) + -b, --bluecat Bluecat information about the subject (bluecat) + -l, --ldap LDAP information about the subject (ldap) + -gc, --guid_channels Working channels for GUID + -d, --dns DNS resolution about the subject (dns) + -cms, --channel CMS channel info about the subject (cms) + -vm, --vm VMWare information about the subject (vmware) + -r, --vpn VPN log information about the subject (openvpn) + -w, --wifi Wireless connection information about the subject (aruba) + -s, --shodan Shodan information about the subject (dns) + -fw, --rules Firewall addresses, groups, and rules relating to the subject + -m, --mac Vendor OUI from a MAC address (mac) -v, --debug Include debug information in the output. Add 'v's for more output. ``` @@ -110,6 +111,11 @@ To find the email addresses of all LDAP users whose username starts with 'daniel ifxlookup -l daniel -f '*.ldap.*.mail[0]' ``` +To find the callsign of a channel with channel id '24696f5c20ad4d1490111064f0b32dc1': +```sh +ifxlookup -cms 24696f5c20ad4d1490111064f0b32dc1 -f '*.cms.channels[0].yaml_configuration_version.channel_title' +``` + To find the operating systems installed on all VM's with 'ifxes' in the name: ```sh ifxlookup --vm ifxes -f "*.vmware[*].guest.full_name.default_message" @@ -291,4 +297,3 @@ each into a text file for storage. ## Known issues with this version: * Caching is not yet implemented -* VMWare plugins are not finished diff --git a/ifxlookup/plugins/aruba.py b/ifxlookup/plugins/aruba.py index 3c0fb9e..dfa5e67 100644 --- a/ifxlookup/plugins/aruba.py +++ b/ifxlookup/plugins/aruba.py @@ -17,7 +17,7 @@ class ServiceDelegate(ServiceBase) : def get_arguments(cls) : """Returns an array of information used to construct an argumentparser argument.""" - return ['-w', '--wifi', 'store_true', 'Return wireless connection information about the subject (aruba)'] + return ['-w', '--wifi', 'store_true', 'Wireless connection information about the subject (aruba)'] def startup(self) : for requirement in ['host','username','key'] : diff --git a/ifxlookup/plugins/bluecat.py b/ifxlookup/plugins/bluecat.py index b11eb64..0291a54 100644 --- a/ifxlookup/plugins/bluecat.py +++ b/ifxlookup/plugins/bluecat.py @@ -13,7 +13,7 @@ class ServiceDelegate(ServiceBase) : _max_results = 1000 def get_arguments(cls) : - return ['-b', '--bluecat', 'store_true', 'Return network information about the subject (bluecat)'] + return ['-b', '--bluecat', 'store_true', 'Bluecat information about the subject (bluecat)'] def startup(self) : for requirement in ['host','username','key','page_size','max_results'] : diff --git a/ifxlookup/plugins/cms.py b/ifxlookup/plugins/cms.py index 9bad690..dc11e69 100644 --- a/ifxlookup/plugins/cms.py +++ b/ifxlookup/plugins/cms.py @@ -7,7 +7,7 @@ class ServiceDelegate(ServiceBase) : def get_arguments(cls) : """Returns an array of information used to construct an argumentparser argument.""" - return [ '-cms','--channel', 'store_true', "Return CMS channel info about the subject (cms)" ] + return [ '-cms','--channel', 'store_true', "CMS channel info about the subject (cms)" ] def startup(self) : pass diff --git a/ifxlookup/plugins/dns.py b/ifxlookup/plugins/dns.py index fe6c173..1e7a232 100644 --- a/ifxlookup/plugins/dns.py +++ b/ifxlookup/plugins/dns.py @@ -8,7 +8,7 @@ class ServiceDelegate(ServiceBase) : def get_arguments(cls) : """Returns an array of information used to construct an argumentparser argument.""" - return [ '-d', '--dns', 'store_true', 'Return DNS resolution about the subject (dns)' ] + return [ '-d', '--dns', 'store_true', 'DNS resolution about the subject (dns)' ] def startup(self) : self.resolver = dns.resolver.Resolver() diff --git a/ifxlookup/plugins/f5.py b/ifxlookup/plugins/f5.py index 80fef1d..9573273 100644 --- a/ifxlookup/plugins/f5.py +++ b/ifxlookup/plugins/f5.py @@ -13,7 +13,7 @@ class ServiceDelegate(ServiceBase) : _partition = 'Common' def get_arguments(cls) : - return ['-cg', '--vip', 'store_true', 'Return VIP information about the subject (f5)'] + return ['-cg', '--vip', 'store_true', 'VIP information about the subject (f5)'] def startup(self) : for requirement in ['hosts','username','key'] : diff --git a/ifxlookup/plugins/guid_channels.py b/ifxlookup/plugins/guid_channels.py index 78f4dc6..2b191f7 100644 --- a/ifxlookup/plugins/guid_channels.py +++ b/ifxlookup/plugins/guid_channels.py @@ -7,7 +7,7 @@ class ServiceDelegate(ServiceBase) : def get_arguments(cls) : """Returns an array of information used to construct an argumentparser argument.""" - return [ '-gc','--guid_channels', 'store_true', 'Return working channels for GUID' ] + return [ '-gc','--guid_channels', 'store_true', 'Working channels for GUID' ] def startup(self) : diff --git a/ifxlookup/plugins/ldap.py b/ifxlookup/plugins/ldap.py index f9d8272..052142e 100644 --- a/ifxlookup/plugins/ldap.py +++ b/ifxlookup/plugins/ldap.py @@ -6,7 +6,7 @@ class ServiceDelegate(ServiceBase) : def get_arguments(cls) : """Returns an array of information used to construct an argumentparser argument.""" - return [ '-l', '--ldap', 'store_true', 'Return LDAP information about the subject (ldap)' ] + return [ '-l', '--ldap', 'store_true', 'LDAP information about the subject (ldap)' ] def startup(self) : for requirement in ['host','bind_string','bind_key','search_base','scope','filter_string'] : diff --git a/ifxlookup/plugins/mac.py b/ifxlookup/plugins/mac.py index 6f5158e..4e3cfb4 100644 --- a/ifxlookup/plugins/mac.py +++ b/ifxlookup/plugins/mac.py @@ -6,7 +6,7 @@ class ServiceDelegate(ServiceBase) : def get_arguments(cls) : """Returns an array of information used to construct an argumentparser argument.""" - return [ '-m', '--mac', 'store_true', 'Return vendor OUI from a MAC address (mac)' ] + return [ '-m', '--mac', 'store_true', 'Vendor OUI from a MAC address (mac)' ] def lookup(self,subject) : self.debug('Requesting MAC info from API...',1) diff --git a/ifxlookup/plugins/openvpn.py b/ifxlookup/plugins/openvpn.py index 1dc1930..151bcfd 100644 --- a/ifxlookup/plugins/openvpn.py +++ b/ifxlookup/plugins/openvpn.py @@ -9,7 +9,7 @@ class ServiceDelegate(ServiceBase) : def get_arguments(cls) : """Returns an array of information used to construct an argumentparser argument.""" - return ['-r', '--vpn','store_true','Return VPN information about the subject (openvpn)'] + return ['-r', '--vpn','store_true','VPN log information about the subject (openvpn)'] def startup(self) : for requirement in ['hosts','username','key'] : diff --git a/ifxlookup/plugins/paloalto.py b/ifxlookup/plugins/paloalto.py index 9a67533..4310bec 100644 --- a/ifxlookup/plugins/paloalto.py +++ b/ifxlookup/plugins/paloalto.py @@ -9,7 +9,7 @@ RULE_SEARCH_FIELDS = ['to','from','source','destination'] class ServiceDelegate(ServiceBase) : def get_arguments(cls) : """Returns an array of information used to construct an argumentparser argument.""" - return ['-fw', '--rules', 'store_true', 'Return Firewall addresses, groups, and rules relating to the subject'] + return ['-fw', '--rules', 'store_true', 'Firewall addresses, groups, and rules relating to the subject'] def startup(self) : if not self.config_valid() : diff --git a/ifxlookup/plugins/shodan.py b/ifxlookup/plugins/shodan.py index af1247e..efe64f2 100644 --- a/ifxlookup/plugins/shodan.py +++ b/ifxlookup/plugins/shodan.py @@ -11,7 +11,7 @@ class ServiceDelegate(ServiceBase) : def get_arguments(cls) : """Returns an array of information used to construct an argumentparser argument.""" - return [ '-s', '--shodan', 'store_true', 'Return Shodan information about the subject (dns)' ] + return [ '-s', '--shodan', 'store_true', 'Shodan information about the subject (dns)' ] def startup(self) : for requirement in ['keys'] : diff --git a/ifxlookup/plugins/vmware.py b/ifxlookup/plugins/vmware.py index 22d70c7..f862618 100644 --- a/ifxlookup/plugins/vmware.py +++ b/ifxlookup/plugins/vmware.py @@ -8,7 +8,7 @@ class ServiceDelegate(ServiceBase) : def get_arguments(cls) : """Returns an array of information used to construct an argumentparser argument.""" - return [ '-vm', '--vm', 'store_true', "Return VMWare information about the subject (vmware)" ] + return [ '-vm', '--vm', 'store_true', "VMWare information about the subject (vmware)" ] def startup(self) : # Verify config diff --git a/setup.py b/setup.py index d9c1167..31b8b8e 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,6 @@ setup(name='ifxlookup', package_data={"": ['plugins/*.py']}, install_requires=['dnspython','jsonpath-ng','paramiko','PyYAML','requests','shodan','ldap3','vsphere-automation-sdk @ git+https://github.com/vmware/vsphere-automation-sdk-python.git'], scripts=['bin/ifxlookup'], - long_description=open('README').read(), + long_description=open('README.md').read(), zip_safe=True )