WHOIS Results

WHOIS is availble in two different ways with the PassiveTotal client. Users can get WHOIS details, or run searches against specific fields.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from passivetotal.libs.whois import WhoisRequest
from passivetotal.libs.whois import WhoisResponse

client = WhoisRequest.from_config()
raw_results = client.get_whois_details(
    query="www.passivetotal.org"
)

loaded = WhoisResponse(raw_results)
print loaded.text

WhoisRequest

class passivetotal.libs.whois.WhoisRequest(*args, **kwargs)

Bases: passivetotal.api.Client

Client to interface with the WHOIS calls from the PassiveTotal API.

get_whois_details(**kwargs)

Get WHOIS details based on query value.

Reference:

Parameters:
  • query (str) – Query value to use when making the request for data
  • compact_record (str) – Return the record in a compact format
Returns:

WHOIS details for the query

search_whois_by_field(**kwargs)

Search WHOIS details based on query value and field.

Reference:

Parameters:
  • query (str) – Query value to use when making the request for data
  • compact_record (str) – Return the record in a compact format
  • field (str) – Field to run the query against
Returns:

WHOIS records matching the query

WhoisResponse

class passivetotal.libs.whois.WhoisResponse(*args, **kwargs)

Bases: passivetotal.response.Response

Result object to ease interaction with data.

csv

Output data as CSV.

Full WHOIS records are not condusive to CSV representation, so only the sections (admin, tech, registrant) are shown in a CSV format.

Returns:String of formatted data
get_days_since_registration()

Get the amount of days since WHOIS was registered.

Returns:Number of days since WHOIS registration
get_days_since_updated()

Get the amount of days since WHOIS was updated.

Returns:Number of days since WHOIS update
get_days_until_expiration()

Get the amount of days until the WHOIS expires.

Returns:Number of days since WHOIS expires
table

Output data as table.

Full WHOIS records are not condusive to table representation, so only the sections (admin, tech, registrant) are shown in a table format.

Returns:Table of formatted data
text

Output data as text.

Data shown in the text output is not full-featured and contains only content deemed to be most useful to the end-user. For full data output, use JSON or XML outputs.

Returns:String of formatted data