기본 콘텐츠로 건너뛰기

패스워드 크래킹 smbexec 정리

smbexec 툴소개


Smbexec는 hash 또는 일반 평문 텍스트 패스워드가 있는 윈도우 시스템을 exploit 할 수 있는 툴로 타겟 머신에 backdoor를 만들어 업로드하여 쉘을 따낼 수 있는 툴이다. 실제 Anti-Virus(V3와 같은 백신 툴)에 걸릴 위험도 적다.


Smbexec is a pass the hash tool if you have the hash or plain text password so you can exploit the windows system using this tool. This tool will generate a backdoor and uploading on a victim machine and running it so other side you will get the meterpreter shell. Av Detection chances are low.


참조링크




smbexec 설치


설치환경 : Kali Linux



# cd /opt
# git clone https://github.com/brav0hax/smbexec.git
# cd smbexec
# ./install.sh

************************************************************

                    smbexec installer       
        A rapid psexec style attack with samba tools              
      Original Concept and Script by Brav0Hax & Purehate    
                    PurpleTeam Smash!
************************************************************

Please choose your OS to install smbexec

1.  Debian/Ubuntu and derivatives
2.  Red Hat or Fedora
3.  Microsoft Windows
4.  Compile smbexec binaries
5.  Exit
Choice: 1
...
...
Making all in msvscpp
make[1]: Entering directory `/tmp/smbexec-inst/libesedb-20120102/msvscpp'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/tmp/smbexec-inst/libesedb-20120102/msvscpp'
make[1]: Entering directory `/tmp/smbexec-inst/libesedb-20120102'
make[1]: Nothing to be done for `all-am'.
make[1]: Leaving directory `/tmp/smbexec-inst/libesedb-20120102'

[+] esedbtools have been installed...

[+] I found nmap installed on your system
[+] I found metasploit installed on your system
[*] Running 'updatedb' again because we installed some new stuff


...happy hunting!      // 설치가 완료되면 "즐겁게 사냥" 하라고 나온다. ;)




설치가 완료되면 /opt 디렉토리 밑에 아래와 같이 4개의 폴더가 생성되 있음을 알 수 있다.


root@kali:/opt# ll
total 36
drwxr-xr-x  9 root root 4096 Oct 16 16:34 .
drwxr-xr-x 23 root root 4096 Oct 16 15:39 ..
drwxr-xr-x  3 root root 4096 Oct 16 16:33 creddump
drwxrwxr-x  4  500  500 4096 Oct 16 16:34 esedbtools
drwxr-xr-x  3 root root 4096 Oct 14 11:11 firmware-mod-kit
drwxr-xr-x  6 root root 4096 Oct 14 13:07 metasploit
drwxr-xr-x  4 root root 4096 Dec 14  2011 NTDSXtract
drwxr-xr-x  6 root root 4096 Oct 16 16:15 smbexec
drwxr-xr-x  7 root root 4096 Oct 14 11:10 Teeth


윈도우용 바이너리 파일 컴파일


smbexec 바이너리 컴파일을 한다. ./install.sh를 다시 실행하여 해당 메뉴를 선택하고엔터.



Please choose your OS to install smbexec
1.  Debian/Ubuntu and derivatives
2.  Red Hat or Fedora
3.  Microsoft Windows
4.  Compile smbexec binaries
5.  Exit

Choice: 4


This script will compile your smbexec binaries


Press any key to continue
...
...
Compiling ../nsswitch/winbind_nss_linux.c
Linking bin/shared/libnss_winbind.so
Linking bin/shared/libsamba-hostconfig.so.0.0.1

[+] smbwinexe has been compiled and moved to the progs folder...


************************************************************

                    smbexec installer       
        A rapid psexec style attack with samba tools              
      Original Concept and Script by Brav0Hax & Purehate    
                    PurpleTeam Smash!
************************************************************

Please choose your OS to install smbexec

1.  Debian/Ubuntu and derivatives
2.  Red Hat or Fedora
3.  Microsoft Windows
4.  Compile smbexec binaries

5.  Exit


컴파일이 완료되면 progs 폴더로 이동하라라고 나온다. 디렉토리를 확인해보면 아래와 같이 컴파일된 파일들을 볼 수 있다.


root@kali:/opt/smbexec/progs# ll
drwxr-xr-x 2 root root     4096 Oct 16 17:01 .
drwxr-xr-x 6 root root     4096 Oct 16 16:15 ..
-rwxr-xr-x 1 root root    27858 Oct 16 16:15 cachedump.rb
-rwxr-xr-x 1 root root     1648 Oct 16 16:15 ntdspwdump.py
-rwxr-xr-x 1 root root  6656780 Oct 16 16:54 smbexeclient
-rwxr-xr-x 1 root root 10031583 Oct 16 16:58 smbwinexe
-rwxr-xr-x 1 root root   691199 Oct 16 16:15 wce.exe


smbexec를 이용한 윈도우 해킹

smbexec를 이용한 윈도우 시스템을 해킹하기 전에 먼저 윈도우 SMB 해킹부터 해야 한다.

BT5 또는 Kali에 이러한 툴이 있다. 

acccheck 툴 사용
acccheck 툴은 SMB 프토로콜을 이용하여 타겟 윈도우 시스템에 인증을 받기 위한 패스워드 사전공격 툴로 고안되어졌다.

아래 내용을 보자.


root@kali:/usr/share/doc/acccheck# more README.TXT 
acccheck.pl - Windows SMB Password Dictionary Attack Tool
Copyright (C) 2008 Faisal Dean (Faiz)

The tool is designed as a password dictionary attack tool that targets windows authentication via the SMB protocol. It is really a wrapper script around the 'smbclient' binary, and as a result is dependent on it for its execution.

The simplest way to run the tool is as follows:

./acccheck.pl -t 10.10.10.1

This mode of execution attempts to connect to the target ADMIN$ share with the username 'Administrator' and a [BLANK] for the password.

./acccheck.pl -t 10.10.10.1 -u test -p test

This mode of execution attempts to connect to the target IPC$ share with the username 'test' and a password 'test'.

Each -t, -u and -p flags can be substituted by -T, -U and -P, where each represents an input file rather than a single input from standard in.

E.g.
./acccheck.pl -T iplist -U userfile -P passwordfile

Only use -v mode on very small dictionaries, otherwise, this has the affect of slowing the scan down to the rate the system writes to standard out.

Any username/password combinations found are written to a file called 'cracked' in the working directory.

Any comments can be emailed to me at:

fmd@portcullis-security.com








smb 접속 방어
http://computer-forensics.sans.org/blog/2012/03/21/protecting-privileged-domain-accounts-access-tokens

댓글

이 블로그의 인기 게시물

SSH 크랙 , 보안 :: 메두사(Medusa) [소개, 사용법 ] [패스워드 크래킹]

외부에서 서버를 관리하기 위해서는 Telnet 과 같은 원격 쉘을 이용하게 됩니다. 이런 원격 쉘은 시스템에 직접 접근할수 있기 떄문에 특별한 관리와 보안이 필요합니다. 그래서 나온것이 SSH 바로 보안 쉘 입니다. 기본적으로 이동하는 패킷이 암호화 처리 되기 떄문에 TELNET보다는 매우 안전하다고 볼수 있습니다. 오늘은 이 SSH를 크랙하는 방법과 대책에 대해서 약간 알아보겠습니다. 이번에 소개할 툴은 메두사 입니다. 메두사는 Broute Force  공격에 사용되는 툴입니다. 설치 데비안계열 ( 데비안 , Ubuntu , 쿠분투 주분투 등등) 에서는 apt-get install medusa 로 간단하게 설치 할 수 있습니다. 메두사로 SSH서버를 크랙하는 방법에 대해 알아보겠습니다. 메두사의 메뉴얼입니다. 구조는 간단합니다. 상대 SSH서버를 확인한 후에 메두사로 무차별 대입공격을 시도합니다. 물론 상대 시스템에는 로그가 남을수 있겠지요.  일단 실험에 쓰일 노트북(공격자) 데스크탑(피해자) 입니다. 공격자 OS : Debian Net : wlan0 IP   : 192.168.0.26 피해자 OS : BackTrack4 Net : eth0 IP   : 192.168.0.3 ssh :  OpenSSh ( SSH1) 실험에 쓰일 피해자(backTrack)입니다.  현재 SSH서버를 가동하고 아무작업없이 대기중입니다. 공격자는 포트스캐너와 각종 툴들을 이용해 정보를 수집후  피해자가 SSH서버를 이용한다는것과 OpenSSH(SSH1)을 사용한다는 것을 알아냇다는 전제하에  시작하겠습니다. 공격자는 메두사 툴을 이용해 BruteForce공격을 시작합니다. medusa -h 192.168.0.3 -u root -P /home/noon/NOON/pass.txt -M ssh 사용된 옵션을 살펴 보자면 -h   :   호스트 주소입니다.  고로    타켓 주소 -u   :   크랙할 유저의 이름입니다.     유저 목록을 파일로 만들어서 사용할

OllyDbg 64bit 실행방법

OllyDbg 1.1 은 기본적으로 64bit 환경을 지원하지 못합니다. 책의 디버깅 실습은 거의 대부분 OllyDbg 를 이용해서 진행됩니다.  그러나 OllyDbg 1.1 은 64bit 환경을 지원하지 못합니다.  <그림 1. Windows 7 64bit 에서 OllyDbg 1.1 실행시 예외 발생> 64bit OS 에서 "2장 Hello World 리버싱" 실습 예제 파일 HelloWorld.exe 를 OllyDbg 1.1 로 실행시키면 <그림 1>과 같이 예외가 발생하면서 ntdll.dll 모듈 영역의 코드에서 멈춰버립니다. (이것은 OllyDbg 1.1 의 버그입니다.) 64bit 환경에서 OllyDbg 사용할 수 있는 2 가지 방법 #1. 64bit OS + OllyDbg 2.0 OllyDbg 2.0 버전에서는 64bit에서 정상 실행 되지 않는 버그가 수정되었습니다. 다운로드 링크 :  http://www.ollydbg.de/odbg200.zip * 참고 최신 버전 OllyDbg 2.01 beta 2 는 실행 과정에 약간의 문제가 있습니다. 문제가 해결될 때까지는 OllyDbg 2.0 을 사용해 주시기 바랍니다. 위 링크에서 파일을 다운받아 압축을 해제한 후 실행하면 <그림 2> 와 같은 화면이 나타납니다. <그림 2 - Windows 7 64bit 에서 OllyDbg 2.0 으로 HelloWorld.exe 를 띄운 화면> <그림 2>의 화면을 책의  <그림 2.3>  처럼 보이게 하려면 다음과 같이 작업해 주시면 됩니다. 1) 내부의 CPU 윈도우를 최대화 시킵니다. 2) Code/Register/Dump/Stack Window 의 폰트를 변경합니다.    (각각의 창에서 마우스 우측 메뉴 - Appearance - Font - System f

인터넷 웹페이지 디버깅 피들러(fiddler) 사용법

인터넷 디벌깅 툴 피들러 입니다. 개발자들은 인터넷 디버깅 툴을 많이 사용하고 있는데요 인터넷 익스플러워 , 사파리 구글크롬등 디버깅 툴은 내장되어 있습니다.  하지만 원하는 값을 얻기 어렵거나 사용하기 어려운 점도 있습니다. 그래서 사용하기도 간편하고 필요한 기능도 많도 원하는 값을 쉽게 확인 할수 있는 디버깅 툴을 소개 해드리려 합니다. 알고 계시는 분도 많겠지만 피들러 (fiddler) 라는 툴입니다.  피들러에 대하 알아보도록 하겠습니다.  피들러(Fiddler) 설치 피들러 설치를 하기 위해 아래 사이트에 접속합니다.   http://www.telerik.com/fiddler 사이트에 접속하시면 FreeDownload 버튼이 보입니다. 클릭을 해서 피들러 설치를 진행합니다. ▶ 피들러는 닷넷 프레임워크를 사용하는데요 window 7 이상 제품군이시면  Fiddler for NET4을 선택하시고 미만이면 .net2를 선택 하세요  이제 Download Fiddler를 선택합니다.  ▶ 피들러 설치 진행화면이 나옵니다. I Agree를 클릭합니다.    ▶ 설치할 폴더를 선택 후 Install을 클릭합니다.    ▶ 설치가 완료되면 Close 를 클릭합니다.    ▶ 설치가 완료되면 브라우저를 새로 실행 하시고 도구> Fiddler를 선택합니다. 도구메뉴가 안보이시면 Alt를 누르시면 보입니다.    ▶ 우측에도 피들러 메뉴가 있습니다.  도구를 클릭 후 피들러를 클릭합니다.   ▶ 실행이 되면 아래와 같은 화면이 나오는데요  좌측 하든을 보시면 Capturing 가 보입니다. 캡쳐를 진행하는 중이구요 키보드중 F12키를 누르면 캡쳐 중지 다시 F12키를 누르면 캡쳐가 진행됩니다.  원하는 부