코드 스니펫

재사용 가능한 코드 조각들을 저장하고 관리합니다.

+ 새 스니펫
언어: 전체 bash python
python

SSH 명령 실행

상세 보기
import subprocess

def ssh_exec(host, command, user="hacker"):
    """SSH로 원격 명령 실행"""
    cmd = f"ssh {user}@{host} \"{command}\""
    result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
    return result.stdout, result.stderr
bash

iproxy 연결

상세 보기
#!/bin/bash
# 대박폰 연결
UDID="00008101-0002359E3E38001E"
LOCAL_PORT=2221
DEVICE_PORT=22

iproxy $LOCAL_PORT $DEVICE_PORT -u $UDID &
echo "iproxy started on port $LOCAL_PORT"