rawsec-cli API Essentials

This section exposes the API for all the rawsec-cli functionality that will be necessary for most users.

rawsec_cli tools

Utils tools for rawsec project

rawsec_cli.tools.get_all_ctf(json: Dict)List[Dict][source]

Get all ctf in rawsec json.

Parameters

json (Dict) – rawsec json.

Returns

ctf list.

Return type

List[Dict]

rawsec_cli.tools.get_all_operating(json: Dict)List[Dict][source]

Get all os in rawsec json.

Parameters

json (Dict) – rawsec json.

Returns

os list.

Return type

List[Dict]

rawsec_cli.tools.get_all_resources(json: Dict)List[Dict][source]

Get all resources in rawsec json.

Parameters

json (Dict) – rawsec json.

Returns

resources list.

Return type

List[Dict]

rawsec_cli.tools.get_all_tools(json: Dict)List[Dict][source]

Get all tools in rawsec json.

Parameters

json (Dict) – rawsec json.

Returns

tools list

Return type

List[Dict]

rawsec_cli.tools.get_ctf_by_category(json: Dict, category: str)List[Dict][source]

Get ctf_platforms by category in rawsec json.

Parameters
  • json (Dict) – rawsec json.

  • category (str) – category.

Returns

ctf_platforms by category list, [] if category is not available.

Return type

List[Dict]

rawsec_cli.tools.get_ctf_category(json: Dict)List[str][source]

Get ctf category present on rawsec.

Parameters

json (Dict) – rawsec json.

Returns

ctf category list.

Return type

List[str]

rawsec_cli.tools.get_ctf_json(json: Dict)Dict[source]

Get ctf in rawsec json.

Parameters

json (Dict) – rawsec json.

Returns

ctf dict.

Return type

Dict

rawsec_cli.tools.get_operating_by_category(json: Dict, category: str)List[Dict][source]

Get operating_systems by category in rawsec json.

Parameters
  • json (Dict) – rawsec json.

  • category (str) – category.

Returns

operating_systems by category list, [] if category is not available.

Return type

List[Dict]

rawsec_cli.tools.get_operating_category(json: Dict)List[str][source]

Get os category present on rawsec.

Parameters

json (Dict) – rawsec json.

Returns

os category list.

Return type

List[str]

rawsec_cli.tools.get_operating_json(json: Dict)Dict[source]

Get operating in rawsec json.

Parameters

json (Dict) – rawsec json.

Returns

operating dict.

Return type

Dict

rawsec_cli.tools.get_resources_by_category(json: Dict, category: str)List[Dict][source]

Get resources by category in rawsec json.

Parameters
  • json (Dict) – rawsec json.

  • category (str) – category.

Returns

resources by category list, [] if category is not available.

Return type

List[Dict]

rawsec_cli.tools.get_resources_category(json: Dict)List[str][source]

Get resources category present on rawsec.

Parameters

json (Dict) – rawsec json.

Returns

resources category list.

Return type

List[str]

rawsec_cli.tools.get_resources_json(json: Dict)Dict[source]

Get resources in rawsec json.

Parameters

json (Dict) – rawsec json.

Returns

resources dict.

Return type

Dict

rawsec_cli.tools.get_tools_by_category(json: Dict, category: str)List[Dict][source]

Get tools by category in rawsec json.

Parameters
  • json (Dict) – rawsec json.

  • category (str) – category.

Returns

tools by category list, [] if category is not available.

Return type

List[Dict]

rawsec_cli.tools.get_tools_category(json: Dict)List[str][source]

Get tool category present on rawsec.

Parameters

json (Dict) – rawsec json.

Returns

tool category list.

Return type

List[str]

rawsec_cli.tools.get_tools_json(json: Dict)Dict[source]

Get tools in rawsec json.

Parameters

json (Dict) – rawsec json.

Returns

tools dict.

Return type

Dict

rawsec_cli.tools.load_inventory_json()Dict[source]

Get rawsec inventory json.

Returns

rawsec dict of project

Return type

Dict

rawsec_cli search

Search rawsec project file

rawsec_cli.search.search_project(json: Dict, project: str)List[Dict][source]

Search project in all category.

Parameters
  • json (Dict) – rawsec projects json.

  • project (str) – project name or description.

Returns

list of rawsec projects.

Return type

List[Dict]

rawsec_cli.search.search_project_ctf(json: Dict, project: str)List[Dict][source]

Search project in ctf’s category.

Parameters
  • json (Dict) – rawsec projects json.

  • project (str) – project name or description.

Returns

list of rawsec projects.

Return type

List[Dict]

rawsec_cli.search.search_project_operating(json: Dict, project: str)List[Dict][source]

Search project in os’s category.

Parameters
  • json (Dict) – rawsec projects json.

  • project (str) – project name or description.

Returns

list of rawsec projects.

Return type

List[Dict]

rawsec_cli.search.search_project_resources(json: Dict, project: str)List[Dict][source]

Search project in resources’s category.

Parameters
  • json (Dict) – rawsec projects json.

  • project (str) – project name or description.

Returns

list of rawsec projects.

Return type

List[Dict]

rawsec_cli.search.search_project_tools(json: Dict, project: str)List[Dict][source]

Search project in tool’s category.

Parameters
  • json (Dict) – rawsec projects json.

  • project (str) – project name or description.

Returns

list of rawsec projects.

Return type

List[Dict]

rawsec_cli output

Output file

rawsec_cli.output.csv_output(projects: list, wanted_keys: list, file=None)[source]

Generate csv output format.

Parameters
  • projects (List[Dict]) – projects list.

  • wanted_keys (List[str]) – only keys you want.

  • file (str, optional) – file name.

rawsec_cli.output.json_output(projects: list, file=None)[source]

Generate json output format.

Parameters
  • projects (List[Dict]) – project list.

  • file (str, optional) – file name.

rawsec_cli.output.list_output(projects: list, file=None)[source]

Generate txt list output format.

Parameters
  • projects (List[Dict]) – projects list.

  • file (str, optional) – file name.

rawsec_cli.output.print_output(projects: List, output='list', file=None, wanted_keys=None)[source]

Generate Output.

Parameters
  • projects (List[Dict]) – project list.

  • output (str) – output format.

  • file (str or None) – file name, file extension will erased output variable.

  • wanted_keys (List, optional) – only keys you want.

Returns

output

Return type

None

rawsec_cli.output.table_output(projects: list, wanted_keys: list, file=None)[source]

Generate txt output format, use columnar for generate table. :param projects: projects list. :type projects: List[Dict] :param wanted_keys: only keys you want. :type wanted_keys: List[str] :param file: file name. :type file: str, optional

rawsec_cli filter

Filter file

rawsec_cli.filter.filter_projects(projects: List, lang=None, paid=False, free=False, online=False, offline=False, blackarch=False)List[Dict][source]

Filter method.

Parameters
  • projects (List) – project List.

  • lang (str, optional) – Language name.

  • paid (bool, optional) – paid or not.

  • free (bool, optional) – free or not.

  • online (bool, optional) – online or not.

  • offline (bool, optional) – offline or not.

  • blackarch (bool, optional) – present on blackarch.

Returns

project filter.

Return type

List[Dict]

Indices and tables