Reference

Core

Scapy core modules.

Cloudflare Worker module to deploy Root certificate.

class scapy.core.worker.Worker(token=None)[source]

Cloudflare Worker class which handle the deployment of Root certificate.

deploy(name, file)[source]

Deploy the worker in to Cloudflare Edge network.

Parameters
  • name (str) – Name of worker. This name will be reflected in the worker url.

  • file (str) – Javascript file of the worker to deploy

Returns

Worker url which is deployed in to CLoudflare Edge network

Return type

str

get_metadata(namespace)[source]

Generate for the Cloudflare worker.

Parameters

namespace (CloudflareAPI.dataclass.Namespace) – Namespace instance of Cloudflare API.

Return type

None

loadCA(rootCA)[source]

Load the CA certificate and write to the Cloudflare KV Namespace.

Parameters

rootCA (str) – Root Certificate file location

Return type

None

store(web_title, fingerprint, ca_url)[source]

Store data to be published.

Parameters
  • web_title (str) – Title of the Worker

  • fingerprint (str) – Fingerprint to attach to the worker

  • ca_url (str) – CA URL to attach to the worker

Return type

None

CLI

CLI Command utilities.

exception scapy.cli.utils.DownloadError(*args, **kwargs)[source]

Error class raised while download fails.

class scapy.cli.utils.Printer[source]

Custom Styled Printer class.

animate(content, speed=0.2)[source]

Add animation in front of content using multithreading.

Parameters
  • content (str) – Content to print

  • speed (float, optional) – Time intervel between each animation frame. Defaults to 0.2.

Return type

None

done(content, url='')[source]

Print completed content.

Parameters
  • content (str) – Content to print

  • url (str, optional) – URL to print and launch in browser. Defaults to “”.

Return type

None

loop_animation(position, last_postition)[source]

Loop animation logic.

Parameters
  • position (int) – Current position of moving part

  • last_postition (int) – Final position of moving part

Returns

Calculated position of moving part

Return type

int

static_arrow(content)[source]

Non-animated printing method for first line.

Parameters

content (str) – Content to print

Return type

None

stop_animation()[source]

Stop the current animation in progress.

Return type

None

working(content, animate=True)[source]

Print animated content with WIP context.

Parameters
  • content (str) – Content to print

  • animate (bool, optional) – [description]. Defaults to True.

Return type

None

scapy.cli.utils.download(url, location=None, verbose=True)[source]

Download the content and write to file.

Parameters
  • url (str) – URL location to download.

  • location (str, optional) – Location to write downloaded file. Defaults to None.

  • verbose (bool, optional) – Control verbose. Defaults to True.

Returns

Path of the file written.

Return type

str

scapy.cli.utils.fetch(url)[source]

Fetch content from URL.

Parameters

url (str) – URL string

Raises

DownloadError – Raise when download fails

Returns

JSON data or Binary data

Return type

Any