enterprise module

Class

Description

binaryninja.enterprise.LicenseCheckout

binaryninja.enterprise.authenticate_with_credentials

Authenticate to the Enterprise Server with username/password credentials.

binaryninja.enterprise.authenticate_with_method

Authenticate to the Enterprise Server with a non-password method. Note that many of these will

binaryninja.enterprise.authentication_methods

Get a list of authentication methods accepted by the Enterprise Server.

binaryninja.enterprise.cancel_authentication

Cancel a call to authenticate_with_credentials or authenticate_with_method.

binaryninja.enterprise.connect

Connect to the Enterprise Server.

binaryninja.enterprise.deauthenticate

Deauthenticate from the Enterprise server, clearing any cached credentials.

binaryninja.enterprise.initialize

Initialize the Enterprise Client

binaryninja.enterprise.is_authenticated

Determine if you have authenticated to the Enterprise Server.

binaryninja.enterprise.is_connected

Determine if the Enterprise Server is currently connected.

binaryninja.enterprise.is_floating_license

Determine if a floating license is currently active

binaryninja.enterprise.is_initialized

Determine if the Enterprise Client has been initialized yet.

binaryninja.enterprise.is_license_still_activated

Determine if your current license checkout is still valid.

binaryninja.enterprise.last_error

Get a text representation the last error encountered by the Enterprise Client

binaryninja.enterprise.license_duration

Get the duration of the current license checkout.

binaryninja.enterprise.license_expiration_time

Get the expiry time of the current license checkout.

binaryninja.enterprise.release_license

Release the currently checked out license back to the Enterprise Server.

binaryninja.enterprise.reservation_time_limit

Get the maximum checkout duration allowed by the Enterprise Server.

binaryninja.enterprise.server_build_id

Get the build id string of the server

binaryninja.enterprise.server_id

Get the internal id of the server

binaryninja.enterprise.server_name

Get the display name of the server

binaryninja.enterprise.server_url

Get the url of the Enterprise Server.

binaryninja.enterprise.server_version

Get the version number of the server

binaryninja.enterprise.set_server_url

Set the url of the Enterprise Server.

binaryninja.enterprise.token

Get the token of the currently authenticated user to the Enterprise Server.

binaryninja.enterprise.update_license

Acquire or refresh a floating license from the Enterprise server.

binaryninja.enterprise.username

Get the username of the currently authenticated user to the Enterprise Server.

LicenseCheckout

class LicenseCheckout[source]

Bases: object

Helper class for scripts to make use of a license checkout in a scope.

Parameters:
  • duration – Duration between refreshes

  • _cache – Deprecated but left in for compatibility

  • release – If the license should be released at the end of scope. If False, you can either manually release it later or it will expire after duration.

Example:
>>> enterprise.connect()
>>> enterprise.authenticate_with_credentials("username", "password")
>>> with enterprise.LicenseCheckout():
...     # Do some operation
...     with load("/bin/ls") as bv: # e.g.
...             print(hex(bv.start))
# License is released at end of scope
__init__(duration=900, _cache=True, release=True)[source]

Get a new license checkout

Parameters:
  • duration – Duration between refreshes

  • _cache – Deprecated but left in for compatibility

  • release – If the license should be released at the end of scope. If False, you can either manually release it later or it will expire after duration.

acquire()[source]
release()[source]

authenticate_with_credentials

class authenticate_with_credentials[source]

Bases:

Authenticate to the Enterprise Server with username/password credentials.

Parameters:
  • username (str) – Username to use.

  • password (str) – Password to use.

  • remember (bool) – Remember token in keychain

authenticate_with_method

class authenticate_with_method[source]

Bases:

Authenticate to the Enterprise Server with a non-password method. Note that many of these will open a URL for a browser-based login prompt, which may not be usable on headless installations. See authentication_methods for a list of accepted methods.

Parameters:
  • method (str) – Name of method to use.

  • remember (bool) – Remember token in keychain

authentication_methods

class authentication_methods[source]

Bases:

Get a list of authentication methods accepted by the Enterprise Server.

Returns:

List of (<method name>, <method display name>) tuples

cancel_authentication

class cancel_authentication[source]

Bases:

Cancel a call to authenticate_with_credentials or authenticate_with_method. Note those functions are blocking, so this must be called on a separate thread.

connect

class connect[source]

Bases:

Connect to the Enterprise Server.

deauthenticate

class deauthenticate[source]

Bases:

Deauthenticate from the Enterprise server, clearing any cached credentials.

initialize

class initialize[source]

Bases:

Initialize the Enterprise Client

is_authenticated

class is_authenticated[source]

Bases:

Determine if you have authenticated to the Enterprise Server.

Returns:

True if you are authenticated

is_connected

class is_connected[source]

Bases:

Determine if the Enterprise Server is currently connected.

Returns:

True if connected

is_floating_license

class is_floating_license[source]

Bases:

Determine if a floating license is currently active

Returns:

True if a floating license is active

is_initialized

class is_initialized[source]

Bases:

Determine if the Enterprise Client has been initialized yet.

Returns:

True if initialize has been called

is_license_still_activated

class is_license_still_activated[source]

Bases:

Determine if your current license checkout is still valid.

Returns:

True if your current checkout is still valid.

last_error

class last_error[source]

Bases:

Get a text representation the last error encountered by the Enterprise Client

Returns:

Last error message, or empty string if there is none.

license_duration

class license_duration[source]

Bases:

Get the duration of the current license checkout.

Returns:

Duration, in seconds, of the total time of the current checkout.

license_expiration_time

class license_expiration_time[source]

Bases:

Get the expiry time of the current license checkout.

Returns:

Expiry time as a Unix epoch, or 0 if no license is checked out.

release_license

class release_license[source]

Bases:

Release the currently checked out license back to the Enterprise Server.

Note

You must authenticate with the Enterprise Server before calling this.

Note

This will deactivate the Binary Ninja Enterprise client. You must call acquire_license again to continue using Binary Ninja Enterprise in the current process.

reservation_time_limit

class reservation_time_limit[source]

Bases:

Get the maximum checkout duration allowed by the Enterprise Server.

Note

You must authenticate with the Enterprise Server before calling this.

Returns:

Duration, in seconds, of the maximum time you are allowed to checkout a license.

server_build_id

class server_build_id[source]

Bases:

Get the build id string of the server

Returns:

Build id of the server

server_id

class server_id[source]

Bases:

Get the internal id of the server

Returns:

Id of the server

server_name

class server_name[source]

Bases:

Get the display name of the server

Returns:

Display name of the server

server_url

class server_url[source]

Bases:

Get the url of the Enterprise Server.

Returns:

The current url

server_version

class server_version[source]

Bases:

Get the version number of the server

Returns:

Version of the server

set_server_url

class set_server_url[source]

Bases:

Set the url of the Enterprise Server.

Note

This will raise an Exception if the server is already initialized

Parameters:

url – New Enterprise Server url

token

class token[source]

Bases:

Get the token of the currently authenticated user to the Enterprise Server.

Returns:

Token, if authenticated. None, otherwise.

update_license

class update_license[source]

Bases:

Acquire or refresh a floating license from the Enterprise server.

Note

You must authenticate with the Enterprise server before calling this.

Parameters:
  • duration (int) – Desired length of license checkout, in seconds.

  • _cache (bool) – Deprecated but left in for compatibility

username

class username[source]

Bases:

Get the username of the currently authenticated user to the Enterprise Server.

Returns:

Username, if authenticated. None, otherwise.