{ "cells": [ { "cell_type": "markdown", "id": "ad247f35-1a9d-4f3a-9788-ecdbc43b6976", "metadata": {}, "source": [ "## Setup" ] }, { "cell_type": "code", "execution_count": 1, "id": "9051f612-d935-4b90-a623-0c5504b51d9c", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/plain": [ "'Database registered!'" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "%set_database codeql-db" ] }, { "cell_type": "code", "execution_count": 2, "id": "a460e252-30f5-4cad-9a32-253e9d789025", "metadata": {}, "outputs": [], "source": [ "import python\n", "import semmle.python.ApiGraphs\n", "import semmle.python.dataflow.new.RemoteFlowSources\n", "import semmle.python.dataflow.new.DataFlow" ] }, { "cell_type": "markdown", "id": "ee080ea9-375f-432b-8fc8-a93fa0e60910", "metadata": {}, "source": [ "## Code exploration" ] }, { "cell_type": "markdown", "id": "3c305ec3-40f7-4a7e-bef6-845ae0ef0c4f", "metadata": {}, "source": [ "### Find all calls to `subprocess.call`" ] }, { "cell_type": "code", "execution_count": 3, "id": "32c13716-39a0-43d9-8e05-25a11fcd557f", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | n | \n", "URL for n | \n", "
---|---|---|
0 | \n", "ControlFlowNode for Attribute() | \n", "file:///Users/pwntester/src/github.com/github/codeql-jupyter-kernel/example/src/main.py:3:1:3:38 | \n", "