Skip to main content

Draft sdk for yeswehack

Build Wheel from source

python setup sdist bdist_wheel

# Installation

Developpeur

python setup.py install

From pip

pip install yeswehack

From wheel

pip install path/to/yeswehack-wheel.whl

Getting starting with YesWeHack Python SDK

## API Module

In this python module, we define object mapping to YesWeHack API Object.

### YesWeHack

Parameters/attributes:

  • token str: YesWeHack Token
  • api_url str (default="https://api.yeswehack.com"): url for the YesWeHack api.
  • username str: user login to YesWeHack
  • password str: password for the given user
  • lazy bool (default=True): if False, login is run at construction time and data are getted recursively else, You have to do each call.
  • oauth_mode bool (default=False): if True, Oauth2 authentication is used.
  • oauth_args dict (default={}): if oauth_mode is actif, oauth_args is used to authenticate user. (keys : client_id, client_secret, redirect_uri)
  • apps_headers dict (default={}): Specific headers for Apps.
  • (Attribute only) session requests.sessions.Session: Session to build requests call.
  • (Attribute only) managed_pgms list: list of string, containing all programs names of each pgm managed by current user.

methods:

  • call(http_method, path, data=None): requests api url with the given path on the given method.
  • raw_call(method, url, data=None, headers=None): requests url on the given method.
  • login(totp_code=None): login on API
  • get_business_units(): return all BU for the given user
  • get_programs(business_unit): get programs related to the given business_unit
  • get_program(program_slug): get program from program_slug
  • get_reports(program, filters=None, lazy=False): get reports of the given program_slug, filters can be pasted according to the api doc.
  • get_report(report_id): return the Report for the given report_id.
  • post_comment( report_id, comment, private=False): post comment on the report link to the given report_id.
  • managed_programs(lazy=False): return programs managed by the logged user.

Category

Parameters/attributes:

  • name str: name of the category
  • slug str: YesWeHack Slug for this category

### Attachment Parameters/attributes:

  • ywh_api YesWeHack: YesWehack Client object
  • id int: Id of this attachment
  • name str: name of this attachment in YesWeHack API
  • original_name str: original name
  • mime_type str: mime type associated
  • size int: bytes size
  • url str: url access
  • data bytes: bytes content

methods:

  • get_data(): set data attributes

BugType

Parameters:

  • category Category:
  • description str:
  • link str:
  • name str:
  • remediation_link str:
  • slug str:

Author

Parameters/attributes:

  • ywh_api YesWeHack: YesWehack Client object
  • username str: username of the author
  • slug str: slug of the author
  • hunter_profile dict: object according to YesWeHack API
  • avatar Attachment: Image

### CVSS Parameters/attributes:

  • criticity str:
  • score float:
  • vector str:

Log

Parameters/attributes:

  • ywh_api YesWeHack:
  • created_at str:
  • duplicate_of dict:
  • id int:
  • type str:
  • points int:
  • private bool:
  • author Author:
  • canceled bool:
  • cvss_bonus int:
  • old_status dict:
  • status dict:
  • message_html str:
  • attachments list, default=[]:
  • old_cvss CVSS:
  • new_cvss CVSS:
  • priority dict:
  • old_bug_type BugType:
  • new_bug_type BugType:
  • old_tags list, default=[]:
  • new_tags list, default=[]:
  • reward_type str:
  • bounty_reward_amount int:
  • marked_as str:
  • fix_verified:
  • old_details:
  • new_details:
  • rights list default=[]:

Report

Parameters/attributes:

  • ywh_api YesWeHack:
  • id int:
  • application_finger_print str:
  • attachments list, default=[]:
  • bonus int:
  • bug_type BugType:
  • chainable bool:
  • chainable_exploit_description_html str:
  • chainable_report dict, default={}:
  • created_at str:
  • cvss CVSS:
  • cvss_bonus int:
  • description_html str, default="":
  • duplicate_of str:
  • end_point str:
  • hunter dict, default={}:
  • local_id str:
  • logs list:
  • marked_as str:
  • part_name str:
  • payload_sample str:
  • priority dict default={}:
  • program dict default={}:
  • reward int:
  • rights list default=[]:
  • scope str:
  • source_ips list default=[]:
  • status dict default={}:
  • tags list default=[]:
  • technical_information str:
  • technical_information_html str:
  • title str:
  • user_roles:
  • vulnerable_part str:

methods:

  • post_comment(comment, private=False):
  • get_comments(lazy=False)
  • get_attachments_data()
  • get_log_attachments_data()
  • get_report_logs(lazy=False)
  • export(export_format)
  • put_tracking_status(tracking_status, tracker_name, tracker_url, tracker_id=None, message=None)

### Program Parameters:

  • ywh_api YesWeHack:
  • reports list, default=[]:
  • disabled bool:
  • managed bool:
  • bounty_reward_max int:
  • reports_count int:
  • status str:
  • title str:
  • slug str:
  • banner dict:
  • rules str:
  • rules_html str:
  • public bool:
  • hall_of_fame bool:
  • scopes list, default=[]:
  • out_of_scope list default=[]:
  • qualifying_vulnerability list default=[]:
  • non_qualifying_vulnerability list default=[]:
  • bounty bool:
  • gift bool:
  • bounty_reward_min int:
  • disclose_bounty_min_reward bool:
  • disclose_bounty_average_reward bool:
  • disclose_bounty_max_reward bool:
  • reward_grid_default dict:
  • reward_grid_low dict:
  • reward_grid_medium dict:
  • reward_grid_high dict:
  • tags list, default=[]:
  • business_unit dict, default={}:
  • restricted_ips list, default=[]:
  • vpn_active bool:
  • vpn_ips list, default=[]:
  • account_access str:
  • disable_message str:
  • user_agent str:
  • stats dict default={}:
  • event dict:
  • token str:
  • rights list default=[]:

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yeswehack-0.1.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yeswehack-0.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file yeswehack-0.1.tar.gz.

File metadata

  • Download URL: yeswehack-0.1.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.4

File hashes

Hashes for yeswehack-0.1.tar.gz
Algorithm Hash digest
SHA256 3f985bb36e2b81dd7a67954fc058071ba8d53c4cdecc28c94b64a0708104e2ea
MD5 9b8deb5d404f81168dee31c97e4b23b2
BLAKE2b-256 33bf0fb3f5c61094d730f00816caf73cc10f3a408c084dfefdc261936b1f9d71

See more details on using hashes here.

File details

Details for the file yeswehack-0.1-py3-none-any.whl.

File metadata

  • Download URL: yeswehack-0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.4

File hashes

Hashes for yeswehack-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1a7f344e01d9f510b1863ee779c5d9ffbc95ab221abed69562f409d5086a82b5
MD5 c060cd8aa9a3d1c67f26ac08eabb51c8
BLAKE2b-256 fc99adbe8596c7b40915adfd236e97dbff0e37c08ffdf2de252cc849b8322038

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page