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:
tokenstr: YesWeHack Tokenapi_urlstr (default="https://api.yeswehack.com"): url for the YesWeHack api.usernamestr: user login to YesWeHackpasswordstr: password for the given userlazybool (default=True): if False, login is run at construction time and data are getted recursively else, You have to do each call.oauth_modebool (default=False): if True, Oauth2 authentication is used.oauth_argsdict (default={}): if oauth_mode is actif, oauth_args is used to authenticate user. (keys :client_id,client_secret,redirect_uri)apps_headersdict (default={}): Specific headers for Apps.- (Attribute only)
sessionrequests.sessions.Session: Session to build requests call. - (Attribute only)
managed_pgmslist: 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 APIget_business_units(): return all BU for the given userget_programs(business_unit): get programs related to the given business_unitget_program(program_slug): get program from program_slugget_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:
namestr: name of the categoryslugstr: YesWeHack Slug for this category
### Attachment Parameters/attributes:
ywh_apiYesWeHack: YesWehack Client objectidint: Id of this attachmentnamestr: name of this attachment in YesWeHack APIoriginal_namestr: original namemime_typestr: mime type associatedsizeint: bytes sizeurlstr: url accessdatabytes: 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_apiYesWeHack: YesWehack Client objectusernamestr: username of the authorslugstr: slug of the authorhunter_profiledict: object according to YesWeHack APIavatarAttachment: Image
### CVSS Parameters/attributes:
criticitystr:scorefloat:vectorstr:
Log
Parameters/attributes:
ywh_apiYesWeHack:created_atstr:duplicate_ofdict:idint:typestr:pointsint:privatebool:authorAuthor:canceledbool:cvss_bonusint:old_statusdict:statusdict:message_htmlstr:attachmentslist, default=[]:old_cvssCVSS:new_cvssCVSS:prioritydict:old_bug_typeBugType:new_bug_typeBugType:old_tagslist, default=[]:new_tagslist, default=[]:reward_typestr:bounty_reward_amountint:marked_asstr:fix_verified:old_details:new_details:rightslist default=[]:
Report
Parameters/attributes:
ywh_apiYesWeHack:idint:application_finger_printstr:attachmentslist, default=[]:bonusint:bug_typeBugType:chainablebool:chainable_exploit_description_htmlstr:chainable_reportdict, default={}:created_atstr:cvssCVSS:cvss_bonusint:description_htmlstr, default="":duplicate_ofstr:end_pointstr:hunterdict, default={}:local_idstr:logslist:marked_asstr:part_namestr:payload_samplestr:prioritydict default={}:programdict default={}:rewardint:rightslist default=[]:scopestr:source_ipslist default=[]:statusdict default={}:tagslist default=[]:technical_informationstr:technical_information_htmlstr:titlestr:user_roles:vulnerable_partstr:
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_apiYesWeHack:reportslist, default=[]:disabledbool:managedbool:bounty_reward_maxint:reports_countint:statusstr:titlestr:slugstr:bannerdict:rulesstr:rules_htmlstr:publicbool:hall_of_famebool:scopeslist, default=[]:out_of_scopelist default=[]:qualifying_vulnerabilitylist default=[]:non_qualifying_vulnerabilitylist default=[]:bountybool:giftbool:bounty_reward_minint:disclose_bounty_min_rewardbool:disclose_bounty_average_rewardbool:disclose_bounty_max_rewardbool:reward_grid_defaultdict:reward_grid_lowdict:reward_grid_mediumdict:reward_grid_highdict:tagslist, default=[]:business_unitdict, default={}:restricted_ipslist, default=[]:vpn_activebool:vpn_ipslist, default=[]:account_accessstr:disable_messagestr:user_agentstr:statsdict default={}:eventdict:tokenstr:rightslist default=[]:
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f985bb36e2b81dd7a67954fc058071ba8d53c4cdecc28c94b64a0708104e2ea
|
|
| MD5 |
9b8deb5d404f81168dee31c97e4b23b2
|
|
| BLAKE2b-256 |
33bf0fb3f5c61094d730f00816caf73cc10f3a408c084dfefdc261936b1f9d71
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a7f344e01d9f510b1863ee779c5d9ffbc95ab221abed69562f409d5086a82b5
|
|
| MD5 |
c060cd8aa9a3d1c67f26ac08eabb51c8
|
|
| BLAKE2b-256 |
fc99adbe8596c7b40915adfd236e97dbff0e37c08ffdf2de252cc849b8322038
|