게시물 1,376건
   
Winexe (리눅에서 윈도우서버 cmd 확인하기)
글쓴이 : 최고관리자 날짜 : 2009-12-04 (금) 14:04 조회 : 14677
글주소 :
                                
리눅스에서 윈도우에 명령을 전달하여 사용하고 싶을때 유용한 툴이다.
원문에서는 윈도우 2008 지원여부에 대해서 나와있지 않았으나 잘된다...

원본 사이트는 다음과 같다.
http://eol.ovh.org/winexe/

winexe
remotely executes commands on WindowsNT/2000/XP/2003 systems from GNU/Linux (probably also other Unices capable to compile Samba4).

Requirements

  • Linux/Unix side:
    • Working network
    • Samba is NOT neccessary
  • Windows side:
    • Working network
    • Standard Windows installation with enabled remote sharing and administration (Windows XP Home do not support remote administration). What does it mean exactly:
      • Enabled services: Workstation, Server
      • "Windows Network" is running and "Printer and File Sharing" are activated
      • Enabled "Remote IPC" and "Remote Admin" shares. To verify it, in cmd box run command "net share", and check if there are ADMIN$ and IPC$ shares. In Windows XP to enable it you should turn off "Simple sharing" in "Control Panel\Folder Options\View\Use simple file sharing".
      • Account with administrative privileges and not empty password
      • Firewall rules allowing traffic between both machines
  • Compile from sources
    • Install necessary packages (gcc, svn, *-devel....)
    • Get sources from winexe-source-081123.tar.bz2.
    • Compile samba according to README file:
      • cd to unpacked tar.bz2 sources
      • ./autogen.sh
      • ./configure
      • make proto bin/winexe
    • Compiled file will be located in wmi/Samba/source/bin/winexe
    • Install winexe:
      install -s wmi/Samba/source/bin/winexe /usr/local/bin/winexe



    INSTALL

    [root@mojily src]# wget http://eol.ovh.org/winexe/winexe-source-081123.tar.bz2
    --20:58:03--  http://eol.ovh.org/winexe/winexe-source-081123.tar.bz2
    Resolving eol.ovh.org... 213.251.131.44
    Connecting to eol.ovh.org|213.251.131.44|:80... connected.
    HTTP request sent, awaiting response... 200 OK
    Length: 3000344 (2.9M) [application/x-bzip2]
    Saving to: `winexe-source-081123.tar.bz2'

    100%[==========================================================>] 3,000,344   54.8K/s   in 38s

    20:58:42 (77.0 KB/s) - `winexe-source-081123.tar.bz2' saved [3000344/3000344]


    압축풀고 컴파일

    [root@mojily winexe-source-081123]# tar jxvf winexe-source-081123.tar.bz2

    [root@mojily src]# cd winexe-source-081123

    [root@mojily winexe-source-081123]# ./autogen.sh
    ./autogen.sh: running script/mkversion.sh
    ./script/mkversion.sh: 'version.h' created for Samba("4.0.0tp4-SVN-build-UNKNOWN")
    ./autogen.sh: running autoheader -I. -Ilib/replace
    ./autogen.sh: running autoconf -I. -Ilib/replace
    Now run ./configure and then make.

    [root@mojily winexe-source-081123]#./configure

    [root@mojily winexe-source-081123]#make proto bin/winexe



    설치는 완료되었고.....이제는 커맨드로 명령어가 전달되는지 확인해본다...
    내 가상화서버 윈도우 2008로의 IPCONFIG 커맨드 전달!!

    [root@localhost bin]# pwd
    /usr/local/src/winexe-source-081123/bin

    [root@localhost bin]# ./winexe -U Administrator //115.68.27.77 "ipconfig"
    Password for [WORKGROUP\Administrator]:

    Windows IP 구성


    이더넷 어댑터 로컬 영역 연결 3:
       연결별 DNS 접미사. . . . :
       IPv4 주소 . . . . . . . . . : 115.68.27.77
       서브넷 마스크 . . . . . . . : 255.255.255.0
       기본 게이트웨이 . . . . . . : 115.68.27.1

    터널 어댑터 로컬 영역 연결*:

       미디어 상태 . . . . . . . . : 미디어 연결 끊김
       연결별 DNS 접미사. . . . :

    터널 어댑터 로컬 영역 연결* 8:

       연결별 DNS 접미사. . . . :
       IPv6 주소 . . . . . . . . . : 2002:7344:1b4d::7344:1b4d
       기본 게이트웨이 . . . . . . : 2002:c058:6301::c058:6301

    터널 어댑터 로컬 영역 연결* 9:

       미디어 상태 . . . . . . . . : 미디어 연결 끊김
       연결별 DNS 접미사. . . . :


    [root@localhost bin]# ./winexe -U Administrator //115.68.27.77 "netstat -an"
    Password for [WORKGROUP\Administrator]:

    활성 연결

      프로토콜  로컬 주소           외부 주소              상태
      TCP    0.0.0.0:80             0.0.0.0:0              LISTENING
      TCP    0.0.0.0:135            0.0.0.0:0              LISTENING
      TCP    0.0.0.0:445            0.0.0.0:0              LISTENING
      TCP    115.68.27.77:445       115.68.62.38:41048     ESTABLISHED
      TCP    115.68.27.77:3389      218.236.115.201:9123   ESTABLISHED
      TCP    115.68.27.77:50645     66.55.144.238:5512     ESTABLISHED
      TCP    115.68.27.77:50646     66.55.144.231:53683    ESTABLISHED
      TCP    [::]:7                 [::]:0                 LISTENING
      TCP    [::]:9                 [::]:0                 LISTENING
      TCP    [::]:13                [::]:0                 LISTENING
    .....................................................................

  • 이름 패스워드
    비밀글 (체크하면 글쓴이만 내용을 확인할 수 있습니다.)
    왼쪽의 글자를 입력하세요.
       

     



     
    사이트명 : 모지리네 | 대표 : 이경현 | 개인커뮤니티 : 랭키닷컴 운영체제(OS) | 경기도 성남시 분당구 | 전자우편 : mojily골뱅이chonnom.com Copyright ⓒ www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.