[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [cti-users] Re: [EXT] [cti-users] Client Python Code
Not sure what your environment is, but when I see this kind of "stuff", it's usually because I've lost track of what context a particular python shell is running under (python 2.x, 3.x, Anaconda, Canopy, et al). For me virtualenv Also may want to check your default encoding (e.g. add # -*- coding: utf-8 -*- to the top of your python code) Patrick Maroney Principal Engineer - Data Science & Analytics Wapack Labs LLC (609)841-5104 On Nov 7, 2017, at 2:59 PM, Jason A. Evans <jasonevans77@gmail.com> wrote: I'm kind of at a loss. Rechecked everything. Really seems like the server is returning something different/incorrect compared to yesterday. Below is my simple Python code followed by the error. ============================================= #Jason A. Evans #Joseph "Brian" Kelly #AMSAA #CPEG 697 #Resources import taxii2client #Set up client connection to server. from taxii2client import Server server = Server('https://test.freetaxii.com:8000/taxii/') #Currently the only known open TAXII 2.0 server available. #Print out server details. print ("Title: " + str(server.title)) print("Description: " + str(server.description)) print("URL: " + str(server.url)) print("Contact: " + str(server.contact)) print("Default: " + str(server.default)) print("# API Roots: " + str(len(server.api_roots))) if(len(server.api_roots) > 0): api_root = server.api_roots[0] if len(server.api_roots[0].collections) > 0: collection = api_root.collections[0] print("\nAPI Root #" + str(1) + ", Collection #" + str(1) + " URL: " + collection.objects_url) print("\n" + str(collection.get_objects())) #.get_object("indicator--9cb664cf-05dd-435a-94ee-bc6d44b6ccd1"))) server.close ============================================= Title: FreeTAXII Discovery Service Description: A listing of API-Roots that this server knows about Contact: FreeTAXII@gmail.com Default: <taxii2client.ApiRoot object at 0x0353D430> # API Roots: 2 {'collections': [{'id': 'd57c89ba-d128-4592-aca6-4ab6c1c097b3', 'title': 'ZeuS IP blocklist', 'description': 'A list of bad IPs (excluding hijacked sites and free hosting providers) from abuse.ch', 'can_read': True, 'can_write': False, 'media_types': ['application/vnd.oasis.stix+json']}, {'id': '34f8c42d-213a-480d-9046-0bd8a8f25680', 'title': 'ZeuS domain blocklist', 'description': 'A list of bad domains (excluding hijacked sites) from abuse.ch', 'can_read': True, 'can_write': False, 'media_types': ['application/vnd.oasis.stix+json']}]} API Root #1, Collection #1 URL: https://test.freetaxii.com:8000/osint/collections/d57c89ba-d128-4592-aca6-4ab6c1c097b3/objects/ Traceback (most recent call last): File "D:\Work\STIX_TAXII\taxii2_client.py", line 31, in <module> print("\n" + str(collection.get_objects())) #.get_object("indicator--9cb664cf-05dd-435a-94ee-bc6d44b6ccd1"))) File "D:\Work\STIX_TAXII\taxii2client\__init__.py", line 204, in get_objects return self._conn.get(self.objects_url, accept=MEDIA_TYPE_STIX_V20) File "D:\Work\STIX_TAXII\taxii2client\__init__.py", line 484, in get raise TAXIIServiceException(msg.format(content_type)) taxii2client.TAXIIServiceException: Unexpected Response Content-Type: text/plain; charset=utf-8 ============================================= On Tue, Nov 7, 2017 at 1:13 PM, Piazza, Rich <rpiazza@mitre.org> wrote:
|
Attachment:
signature.asc
Description: Message signed with OpenPGP
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]