[참고: http://grayhash.com/files/netsec.pdf (firmware 획득방법 사진)]

[참고: http://www.powerofcommunity.net/poc2012/re&si.pdf (전반적인 프로세스 참고)]

해당 포스팅은 firmware의 취약점을 간략하게 분석하고 firmware이미지를 추출하는 소개정도로 작성하였습니다.

자세한 내용은 생략되어 있으니 자세한 내용을 원하시는 부분은 댓글주세요.


Firmware 취약

  

Firmware 정의

S/WH/W의 중간에 해당하는 것으로 S/WH/W

일반적으로 롬(ROM)에 기록된  H/W를 제어하는 *마이크로프로그램의 집합

*마이크로프로그램: 컴퓨터의 중앙연산처리장치가 지시 받은 명령을 정확하게 수행하기 위해 중앙처리장치가 하는 일련의 제어 기능을 프로그램으로 만들 필요가 있다. 이 때 만들어진 프로그램을 마이크로프로그램이라고 한다.


Firmware 취약점 사례

IoT보안에서 Firmware 취약점 위협 


Firmware 분석

 

Firmware 적용 분야

-Networking- Routers, Switches, NAS, VoIP Phones
-Surveillance- Alarms, Cameras, CCTV, DVRs, NVRs
-Industry Automation- PLCs, Power Plants, Industrial Process Monitoring and Automation
-Home Automation- Sensoring, Smart Homes, Z-waves, Philips Hue
-Whiteware- Washing Machine, Fridge, Dryer
-Entertainment gear- TV, Stereo, Game Console, MP3, Camera, Mobile Phone, Toys
-Other Devices- Hard Drivers, Printers
-Cars
-Medical Devices

 …..


Firmware 구조

 -Firmware 복잡도에 따른 분류방법
-Full-blown(Full-OS/kernel + Bootloader + libs + apps)
-Integrated(apps + OS-as-a-lib)

-Partial updates(apps or libs or resources or support)

 Firmware 획득 방법

-제조사에서 공개하는 firmware 다운로드
-자동/수동 업데이트 시 packet Sniffing
-UART 포트 접속
-논리적 취약점을 이용한 Shell 접근 권한 획득 후 추출(Partition dump, /dev/mtdblock)
-Flash Memory dump
-JTAG 포트 접속

Firmware Hacking Process


1. Firmware 획득

   획득 방법에는 여러가지 방법이 있지만 별도의 장치가 필요 없는 제조사 제공 firmware로 진행 

2. 분석 tool 사용

-BinwalkBinwalk는 firmware 이미지로부터 분석추출리버스엔지니어링을 하기 위해 설계된 firmware 분석 tool

-usage: kali는 기본 내장ubuntu는 별도 설치 필요

-$binwalk <firmware image>

위의 경우 LZMA압축을 사용하고, Squashfs 파일 시스템을 사용하는 것을 확인할 수 있다.


1. 추출 tool 사용

-Firmware-mod-kit: 리눅스 기반으로 다양한 파일포맷을 지원하는 스크립트를 가지고 있음
(cramfs, jffs2, lzma, squashfs etc)

-ERESI framework: multi-architecture binary를 분석하는 리버스 엔지니어링 소프트웨어

-signsrch: file 내부의 signatures를 찾는 툴

-offzip: raw files, packets, zip archives등 데이터를 포함하는 zipunpack하는 매우 유용한 툴

-TrID: binary signatures로부터 파일 타입을 알아낼 수 있도록 설계된 툴

-PFS: Benq ESG 103, NDC NWH8018과 같은 라우터의 이미지 분석에 사용되는 툴

-ardrone-tool: A.R.Drone을 위한 툴

-UnYAFFS: 파일시스템 중 yaffs으로부터 파일을 추출하기 위한 프로그램

-Squash-tools: SquashFS을 위한 툴


-Firmware-mod-kit사용

https://code.google.com/archive/p/firmware-mod-kit 에서 다운로드

리눅스 기반이기 때문에 우분투에서 사용

다운로드 한 tar 파일을 압축 해제하면 왼쪽과 같이 나온다앞서 다운로드 한 a1004_kr_9_912.bin 파일을 복사

추출은 extract-firmware.sh <firmware.bin>

Re-building은 build-firmware.sh [-nopad] [-min]

-The optional –nopad switch will instruct build_firmware.sh to NOT pad the firmware up to is original size.
-The optional –min switch will use the maximum squashfs block size of 1MB.
Example)

$./extract-firmware.sh <firmware.bin>
$
cp new-telnetd fmk/rootfs/usr/sbin/telnetd
$./build-firmware.sh

$./extract –firmware.sh a1004_kr_9_912.bin

오류 발생 필수 라이브러리 필요(LZMA 압축 방법을 사용하였기 때문에 dev라이브러리 필요)

$sudo apt-get install git build-essential zlib1g-dev liblzma-dev python-magic

성공하면 아래와 같이 firmware extraction successfull이 출력된다.

위의 fmk폴더가 생성된 것을 확인할 수 있다. 더블클릭하면 image_parts, logs, rootfs 폴더가 있다.

image_parts폴더에는 header와 rootfs이미지가 있고, logs에는 추출할 때의 로그가 있다. 마지막으로 rootfs의 경우 firmware 이미지의 파일시스템을 확인할 수 있다.


1. Find bugs and vulnerability

취약점을 찾는 단계이다. 해당포스팅에는 간략하게 설명하는 것으로 제한한다.

공유기에서 관리자 페이지로 접속하면 아래와 같이 cgi-bin폴더 안에 timepro.cgi를 호출한다.

실제 펌웨어 안에 cgibin 내부에 timepro.cgi를 확인할 수 있다. 바이너리 덤프는 포스팅에서 제외(해보면 호출 프로세스 확인)

공유기 쉘로 접근방법이다.

아래와 같이 cgi-bin/d.cgi로 접근 시 화면이 출력된다.

Command Name에 입력하고자 하는 명령어를 입력하고

아래 password에는 #notenoughmineral^ 을 입력하면 된다.

아래는 ls의 결과 화면이다.


물론 cat명령어도 된다.


공유기 방화벽 또한 변경할 수 있다.



해당 부분은 포스팅에서 제외

위에서 언급했듯이, 수정 후 ./build-firmware.sh 하면 리패키징됨.


실제 거주하는 곳에서 무선공유기를 검색하면 옆집, 윗집 공유기가 검색된다.

관리자 page를 포함하여 default id와 passwd의 경우가 많다. 

관리자 page에는 펌웨어 업데이트 기능이 있는데 공격자가 악용하여 펌웨어에 악성코드나 백도어를 넣어 업데이트 한다면 위험하다.


이를 위해서는 관리자 id와 passwd를 꼭 바꾸어놓자. 

또한 원격에서 접근할 수 없도록 아래에 보이는 원격지원 부분에 중단으로 바꾸고 적용하자.

[원문: http://tools.kali.org/information-gathering/hping3]


정의

hping is a command-line oriented TCP/IP packet assembler/analyzer. The interface is inspired to the ping(8) unix command, but hping isn’t only able to send ICMP echo requests. It supports TCP, UDP, ICMP and RAW-IP protocols, has a traceroute mode, the ability to send files between a covered channel, and many other features.


While hping was mainly used as a security tool in the past, it can be used in many ways by people that don’t care about security to test networks and hosts. A subset of the stuff you can do using hping:


-Firewall testing

-Advanced port scanning

-Network testing, using different protocols, TOS, fragmentation

-Manual path MTU discovery

-Advanced traceroute, under all the supported protocols

-Remote OS fingerprinting

-Remote uptime guessing

-TCP/IP stacks auditing

-hping can also be useful to students that are learning TCP/IP.

 간략하게 hping3은 command-line으로 인터페이스는 ping으로부터 영감을 받았다. 그러나 hping3은 ping의 ICMP echo 뿐만 아니라 UDP/TCP패킷 전송이 가능하다. 또한, hping3은 fragmentation, packet body/size를 다룰 수 있으며, 지원되는 프로토콜 아래 파일 전송을 하기 위해 사용되어진다.

(fragmentation 소개: http://kkn1220.tistory.com/76 참고)

지원 목록

-방화벽 테스트

-포트 스캐닝

-protocols, TOS, fragmentation을 이용한 네트워크 테스트

-MTU확인

-traceroute

-OS 핑거프린팅

-업타임 추측

-TCP/IP 스택 감사

-> hping3은 일전에 DoS 공격 때 언급했었는데 상당히 강력하다. 추천!


Usage

#hping3 -h  입력 시 출력되는 것이 상당히 많다.

아래는 조금이나마 편하게(?) 볼 수 있는 페이지이다. 기본 옵션, 자주쓰는 옵션, IP 관련 옵션, ICMP 관련 옵션, TCP/UDP 관련 옵션, TCP FLAGS, Protocol Selection으로 구분할 수 있다.

조금 더 구분을 하자면 아래와 같다.(아래의 자주쓰는 명령어는 지극히 개인적인 판단이니 단순 참고용)

Base

-c, --count: 지정한 패킷만 전송 후 종료

-i, --interval: 간격 정하기

 --fast      alias for -i u10000 (10 packets for second)

      --faster    alias for -i u1000 (100 packets for second)

      --flood    sent packets as fast as possible. Don't show replies.

-V, --verbose: 자세히 보기

IP Related

-a, --spoof: 출발지 ip 변조 (상당히 강력)

--rand-source: 출발지 ip를 랜덤값으로 바꿈(MAC 주소는 안바뀐다고 들었는데 확인 필요)

TCP/UDP Related

-p, --destport: 목적지 port

TCP Flags

-F --fin,  -S --syn, -R --rst, -A --ack

MODE

-1: icmp

-2: udp

-8: scan


활용방법
http://kkn1220.tistory.com/75 참고

위의 주소는 DoS공격에 hping3이 사용되는 것을 확인할 수 있다. 자세한 설명은 위의 주소에서 확인하면 된다.

아래는 대략적인 사용법이다.

1) SYN Flooding

- SYN flooding이란 SYN을 넘치게 하는 것을 뜻한다. 즉 클라이언트가 서버의 SYN Queue를 overflow시켜 서버를 오동작하거나 충돌시키는 공격이다.

#hping3 <target-ip> -a <fake-ip> -p <destination port> -S -i u10000

//-S는 TCP Flags 의 --syn이며, i u10000은 --fast 이다. 위의 명령어에서 확인 가능하다.


2) Land Attack

- 패킷을 전송할 때 출발지 IP주소와 목적지 IP주소 값을 타겟의 IP주소 값으로 똑같이 만들어서 타겟으로 보낸다.

- 시스템은 처음 시도된 SYN에 대한 reply 패킷을 출발지 IP 주소값을 참조하여 그 값을 목적지 IP주소 값으로 설정하여 패킷을 보낸다. 그러나 이 값은 자기 자신의 IP 주소값이기 때문에 네트워크 밖으로 나가지 않고 자기 자신에게 돌아오며 land 공격은 동시 사용자를 점유하는 것 동시에 CPU부하 또한 올리게 된다.

#hping3 <target-ip> -a <target-ip> -s 100 -p 100


3) Smurf Attack 

1. smurf공격은 공격자가 타겟의 IP로 스푸핑한 후, 타겟이 속해 있는 broadcast network로 broadcast 요청을 보낸다.

2. ICMP request를 수신한 컴퓨터들은 타겟에 reply 패킷을 보낸다.

3. 대량의 ICMP reply를 수신한 타겟은 과부하 상태가 된다.

#hping3 <broadcast network> -a <target-ip> --icmp --flood


4) PortScan

hping3은 타겟의 열린 포트를 확인할 수 있다.

hping –I <interface> --scan <port> -S <target-ip> 

'해킹 > kali tools' 카테고리의 다른 글

[Information-Gathering24]miranda  (0) 2016.03.29
[Information-Gathering23]masscan  (0) 2016.03.24
[Information-Gathering21]goofile  (0) 2016.03.18
[Information-Gathering20]golismero  (0) 2016.03.18
[Information-Gathering19]fragrouter  (0) 2016.03.07

[원문: http://tools.kali.org/information-gathering/goofile]


정의

Use this tool to search for a specific file type in a given domain.

 간략하게 (진짜 간략하다...)goofile은 주어진 도메인 내 특정 파일을 찾는 툴이다....


Usage

일전에 kali에서 제공하지 않는 tool은 포스팅 하지 않는다고 했다.

kali 2.0 이전 버전에서는 제공했는지 모르겠지만 2.0에는 지원을 하지 않는다.

그렇다. 해당 툴을 정말 좋아한다고 한다. 그 뒤의 말이 우습지만 굳이 한글로 번역하진 않겠다...

-install

#wget "https://goofile.googlecode.com/files/goofilev1.5.zip"  -> 경로변경됨

안된다.

https://code.google.com/archive/p/goofile/downloads 로 접속해서 1.5버전을 다운받자.

#unzip -p goofilev1.5.zip goofilev1.5/goofile.py > /usr/bin/goofile && chmod +x /usr/bin/goofile

#goofile

사용법이 정말 심플하다.

안된다

https://code.google.com/archive/p/goofile/issues/5

issue에 올라와있다.

google에서 반환하는 것을 막았다고 개인적으로 공감한다.

그래서 2.0에서는 지원을 하지 않는다고 생각한다.


결론: goofile이니 뭐니 그냥 구글을 이용하자.

'해킹 > kali tools' 카테고리의 다른 글

[Information-Gathering23]masscan  (0) 2016.03.24
[Information-Gathering22]hping3  (0) 2016.03.18
[Information-Gathering20]golismero  (0) 2016.03.18
[Information-Gathering19]fragrouter  (0) 2016.03.07
[Information-Gathering18]fierce  (0) 2016.03.07

[원문: http://tools.kali.org/information-gathering/golismero]


정의

GoLismero is an open source framework for security testing. It’s currently geared towards web security, but it can easily be expanded to other kinds of scans.


The most interesting features of the framework are:


Real platform independence. Tested on Windows, Linux, *BSD and OS X.

No native library dependencies. All of the framework has been written in pure Python.

Good performance when compared with other frameworks written in Python and other scripting languages.

Very easy to use.

Plugin development is extremely simple.

The framework also collects and unifies the results of well known tools: sqlmap, xsser, openvas, dnsrecon, theharvester

Integration with standards: CWE, CVE and OWASP.

Designed for cluster deployment in mind (not available yet).

 간략하게 golismero는 보안테스트를 위한 오픈소스 프레임워크이며 웹 사이트에 맞게 설계는 되어 있지만, 다른 종류의 스캔 방법에 대해 쉽게 확장할 수 있다.

제공하는 PDF를 보자. 이해가 훨씬 빠를 것이다.


- golismero는 파이썬 기반으로 되어 있다. 

- 리눅스, 윈도우, 맥 , BSD(Berkley Software Distribution) 등 다양한 OS에 적용 가능하다. 

- OpenVAS, nmap, SSLscan 등의 툴박스이다.

- 사용이 매우 쉽다.

- 위의 툴박스의 통합된 결과를 report형태로 볼 수 있다.


Usage


installing

- kali는 기본적으로 제공된다.

1)Debian/Ubuntu

$su

# apt-get install python2.7 python2.7-dev python-pip python-docutils git perl nmap sslscan

#cd /opt

#git clone https://github.com/golismero/golismero.git

#cd golismero

#pip install -r requirements.txt

#pip install -r requirements_unix.txt

#ln -s /opt/golismero/golismero.py /usr/bin/golismero

#exit

2)Mac OS

$sudo -s

#easy_install-2.7 -U distribute

#easy_install install pip

#port install nmap sslscan

#cd /opt

#git clone https://github.com/golismero/golismero.git

#cd golismero

#pip install -r requirements.txt

#pip install -r requirements_unix.txt

#ln -s /opt/golismero/golismero.py /usr/bin/golismero

#exit

3)window

cd %HOME%

git clone https://github.com/golismero/golismero.git

cd golismero

pip install -r requirements.txt


제공하는 pdf에는 간단한 사용법이 나와있다.

Quick scan을 해보자.

# golismero scan <target>

툴박스라더니 정말로 그렇다. 유심히 볼 것은 plugin이 disabled 된 것을 확인할 수 있다.

밑에 내용들은 추가를 안했지만 harvester, zone transfer 등을 수행한다.

plugin 목록을 확인해보자

#golismero plugins

엄청 많다...

Plugin list

-------------


-= Import plugins =-

csv_nikto:

    Import the results of a Nikto scan in CSV format.

csv_spiderfoot:

    Import the results of a SpiderFoot scan in CSV format.

xml_nmap:

    Import the results of an Nmap scan in XML format.

xml_openvas:

    Import the results of an OpenVAS scan in XML format.

xml_sslscan:

    Import the results of an SSLScan run in XML format.


-= Recon plugins =-

dns:

    DNS resolver plugin.

    Without it, GoLismero can't resolve domain names to IP addresses.

dns_malware:

    Detect if a domain has been potentially spoofed, hijacked.

exploitdb:

    Integration with Exploit-DB (http://www.exploit-db.com/)

    This plugin requires a working Internet connection to run.

fingerprint_web:

    Fingerprinter of web servers.

geoip:

    Geolocates IP addresses using online services.

    This plugin requires a working Internet connection to run.

punkspider:

    Integration with PunkSPIDER (http://punkspider.hyperiongray.com/)

    This plugin requires a working Internet connection to run.

robots:

    Analyzes robots.txt files and extracts their links.

shodan:

    Integration with Shodan: http://www.shodanhq.com/

    This plugin requires a working Internet connection to run.

spider:

    Web spider plugin.

    Without it, GoLismero can't crawl web sites.

spiderfoot:

    Integration with SpiderFoot: http://www.spiderfoot.net/

theharvester:

    Integration with theHarvester: https://github.com/MarioVilas/theHarvester/


-= Scan plugins =-

brute_directories:

    Tries to discover hidden folders by brute force:

    www.site.com/folder/ -> www.site.com/folder2 www.site.com/folder3 ...

brute_dns:

    Tries to find hidden subdomains by brute force.

brute_url_extensions:

    Tries to discover hidden files by brute force:

    www.site.com/index.php -> www.site.com/index.php.old

brute_url_permutations:

    Tries to discover hidden files by bruteforcing the extension:

    www.site.com/index.php -> www.site.com/index.php2

brute_url_predictables:

    Tries to discover hidden files at predictable locations.

    For example: (Apache) www.site.com/error_log

brute_url_prefixes:

    Tries to discover hidden files by bruteforcing prefixes:

    www.site.com/index.php -> www.site.com/~index.php

brute_url_suffixes:

    Tries to discover hidden files by bruteforcing suffixes:

    www.site.com/index.php -> www.site.com/index2.php

nikto:

    Integration with Nikto: https://www.cirt.net/nikto2

nmap:

    Integration with Nmap: http://nmap.org/

openvas:

    Integration with OpenVAS: http://www.openvas.org/

plecost:

    WordPress vulnerabilities analyzer, completely rewritten for GoLismero,

    based on the original idea of Plecost (https://code.google.com/p/plecost/)

    and their team: @ffranz and @ggdaniel

sslscan:

    Integration with SSLScan: http://sourceforge.net/projects/sslscan/

zone_transfer:

    Detects and exploits DNS zone transfer vulnerabilities.


-= Attack plugins =-

heartbleed:

    Test for the CVE-2014-0160 vulnerability (aka "heartbleed attack").

sqlmap:

    SQL Injection plugin, using SQLMap.

    Only retrieves the DB banner, does not exploit any vulnerabilities.

xsser:

    Integration with XSSer: http://xsser.sourceforge.net/


-= Report plugins =-

bson:

    BSON (Binary JSON) output for programmatic access.

csv:

    Writes reports in Comma Separated Values format.

html:

    Writes reports as offline web pages.

json:

    JSON output for programmatic access.

latex:

    Writes reports in LaTeX document format (.tex).

log:

    Extracts only the logs.

ltsv:

    Extracts only the logs, in labeled tab-separated values format.

msgpack:

    MessagePack output for programmatic access.

    See: http://msgpack.org/

odt:

    Writes reports in OpenOffice document format (.odt).

rst:

    Writes reports in reStructured Text format.

text:

    Writes plain text reports to a file or on screen.

xml:

    XML output for programmatic access.

yaml:

    YAML output for programmatic access.


-= UI plugins =-

console:

    Console user interface. This is the default.

disabled:

    Empty user interface. Used by some unit tests.

전에 shodan에 대해 소개를 했는데 shodan도 제공을 해준다.

(shodan 소개: http://kkn1220.tistory.com/68 참고)

#golismero info <plugins>

apikey가 없다.

vi /usr/share/golismero/golismero.conf에 추가해주면 된다.

[openvas]

host = localhost


[testing/scan/openvas]

user = admin

password = <your password>


[shodan:Configuration]

apikey = <your shodan key>


http://goo.gl/im2FLe for detailed instructions on setting up OpenVAS

http://www.shodanhq.com/account/register for a shodan API key


결과를 콘솔로만 보면 확인의 어려움이 있다. pdf에서 보면 알 수 있듯이 결과 report를 확인할 수 있다.

#golismero scan <target> -o <outputfile_name>

(https://github.com/golismero/golismero 발췌)

'해킹 > kali tools' 카테고리의 다른 글

[Information-Gathering22]hping3  (0) 2016.03.18
[Information-Gathering21]goofile  (0) 2016.03.18
[Information-Gathering19]fragrouter  (0) 2016.03.07
[Information-Gathering18]fierce  (0) 2016.03.07
[Information-Gathering17]exploitdb  (0) 2016.03.02

설치 전 고민이 있었다.

라즈베리 파이용으로 제공되는 것을 설치하여 라즈베리로 이용할까.

안드로이드 루팅된 단말에 설치하여 사용할까.

위의 고민은 라즈베리파이 터치 모니터가 대략 10만원이라는 것을 알고 난 후 안드로이드 단말에 설치하기로 하였다.


대상단말

갤럭시 S3

설치 전 요구사항

-루팅 된 단말 (http://kkn1220.tistory.com/38 참고)

-busybox

-linux deploy

-android vnc viewer

-10기가 정도의 여유 공간

-빠른 네트워크

(어느글에서는 Wi-Fi 로만 다운이 된다고 함, 또 어느 글에서는 사용자 데이터의 무리가 갈 수 있기 때문에 Wi-FI로 하라고함
그래서 그냥 찜찜해서 Wi-Fi로 진행하였음)

-인내심


설치해보자!

맨 위의 것을 다운로드 받으면 된다.

중간 사진을 보면 Installation path가 있는데 나는 처음에 칼리 이미지를 다운받고 해당 경로를 입력하는 줄 알았다...
그냥 설치 경로를 입력해주면 된다. astro나 안드로이드 파일 탐색기를 보면 해당 경로를 확인할 수 있다. 

이것 저것 글을 봤을 때 sdcard를 하라는둥 legacy로 하라는둥 말이 많았지만 해당 단말에서는 위의 경로로 되었다.

Distribution 은 kali linux로 변경

다른 것은 건드리지 않고 맨 우측사진의 Install을 클릭했다.

수정사항

1) Distribution

첫 번째 결과 실패

E: The selected extractor cannot be found: ar

무엇이 문제일까? 

찾아보다가 busybox 문제인 것을 확인하였다. BusyBox stericson not supported ar and other required functions.

stericson busybox는 ar을 지원하지 않는다....... 지우고 meefik's 의 busybox를 설치하였다. 


If system BusyBox not working:

1) Install compatible BusyBox (https://github.com/meefik/busybox/releases)

2) Run BusyBox app.

3) Run Linux Deploy app and change "Settings -> BusyBox directory" to /data/data/ru.meefik.busybox/files/bin

4) Run "Settings -> Update ENV".

linux deploy를 탭하면 설정이 나오는 데 위의 방식대로 경로를 추가하고 업데이트를 해주었다.

수정사항

1) BusyBox directory

-> /data/data/ru.meefik.busybox/files/bin

-> Update ENV 해줘야됨

두 번째 결과 실패

E: linux deploy making new disk image (512mb) fail

ahㅏ......... 위의 준비사항에 끈기의 이유이다.

별짓을 다하였다. 그러던 중 http://forum.xda-developers.com/showthread.php?t=2400638 의 글을 보니 이미지 파일 크기를 7128로 하라고 한다. 

위에서 변경한 것 다 필요없다. Linux deploy 삭제 후 다시 다운로드

원래 초기는 0으로 auto로 정해주는 사이즈로 하는데 맨 위 가운데 사진은 7128로 설정하고 캡처를 하였기에 위의 결과로 출력된 것이다. 원래는 0이다.

수정사항

1) 다시 다운로드하였기 때문에 distribution kali linux로 변경

2) image size

7128로 해준 결과 done이 출력되었다.

쭉쭉쭉 잘넘어간다~~~~~

이전 버전의 linux deploy는 end가 출력되었다고 하는데 내꺼는 <<< install로 출력되었다.

end표시인듯? 

start버튼을 눌러준다.

vnc view로 연결하였다. 

아래의 사진처럼 kali가 드디어 설치가 되었다.

 번째 결과 실패

kali components 설치안함...


그렇다. 위의 포럼에서 가르쳐준거는 이미지파일만 바꾸고 나머지는 default로 하면 된다고 하였기에 이미지 파일 사이즈만 변경하고 설치하였더니 메뉴가 없다...


default는 x server와 kali components에 체크가 안되어있다...체크를 해주자..

수정사항

1) Components

+ X server, Kali components


네 번째 결과 실패

forum에서 GNONE으로 설치하라고 해서 했는데 view가 이상한건지 화면이 출력이 안됨...
default인 LXDE로 다시 설치....


드디어 제대로 된 칼리리눅스 설치 완료

해상도가 720*1280 이라 화면을 가로모드로 했을 때 안습이었다...

linux deploy 에서 GUI Setting부분을 수정해준다.

1280*720으로 바꿔주었다.

끝....

결론

1) linux deploy 다운로드

2) Distribution -> kali linux로 변경

3) Component -> X server, Kali components 추가

4) 우선 설치해보자(사용자 단말에 따라 image size 허용이 다를 수 있기 때문에)

5) 에러메시지 확인(에러 없으면 땡큐~)

The selected extractor cannot be found: ar

-> busybox meefik's 로 다시 설치

linux deploy making new disk image (512mb) fail

-> image size 7128로 변경

중요)에러메시지 출력 후 설치 path로 가서 linux.img가 있으면 꼭 지우고 다시 설치할 것

6) linux deploy 어플에서 start버튼 클릭
7) vnc view 다운로드 후 칼리 접속
8) 이용이 끝나면 vnc view 종료하고 linux deploy어플에서 stop누르면 마운트 해제됨

시간 오래걸리니 설치하면서 할 일 하시면 됩니다.

대략 1시간 소요

이걸로 무슨 부귀영화를 누리려고 시작했는지는 모르겠으나 
설치 완료.....

'해킹 > 해킹' 카테고리의 다른 글

firmware hacking process  (8) 2016.03.23
IP fragmentation을 이용한 공격  (0) 2016.02.12
DoS(Denial of Service) 소개 및 공격유형  (0) 2016.02.12
스푸핑 (Spoofing) 소개  (0) 2016.02.11
스니핑 도구 dsniff 소개  (0) 2016.02.02

[원문: http://tools.kali.org/information-gathering/fragrouter]


정의

This program was written in the hopes that a more precise testing methodology might be applied to the area of network intrusion detection, which is still a black art at best.


Conceptually, fragrouter is just a one-way fragmenting router – IP packets get sent from the attacker to the fragrouter, which transforms them into a fragmented data stream to forward to the victim.

 간략하게 fragrouter는 네트워크 침입 탐지를 회피하는 툴킷이다. fragrouter는 "Insertion, Evasion, and Denial of Service"와 같은 대부분의 공격에 실행된다.


Usage

 usage는 심플하다. i로 인터페이스를 지정해주고 ATTACK단에 아래 -option을 주면 된다.

 단계적으로 target의 arp를 속이기 위해 arpspoof를 수행한다.

 dsniff나 ettercap 등으로 스니핑하면 패킷 중 원하는 정보를 도청할 수 있는데 그 이유는 arpspoof만 수행했을 경우 패킷이 빠져 나갈 곳이 없기 때문이다. 패킷이 모두 공격자로 오기 때문에 포워딩이 필요하다. 이 때 사용되는 것이 fragrouter이며 fragrouter를 통해 패킷을 밖으로 보낼 수 있다. 

 스니핑을 하거나 세션을 가로챘을 때 공격자에게 온 패킷을 정상적으로 전달해주려면 패킷 포워딩이 필요하다.

공격대상의 세션이 끊어지면 계속 사용할 수 없게 되므로 공격자 역시 스니핑을 할 수 없다.

 따라서 fragrouter는 스니핑한 세션을 마치 정상적인 것처럼 돌려주기 위해 필요하다.

ettercap: http://kkn1220.tistory.com/63 참고

dsniff: http://kkn1220.tistory.com/72 참고 

fragrouter 부분 또한 http://kkn1220.tistory.com/72 에서 dnsspoof 부분을 참고

실제 웹페이지 패스워드 도청: http://kkn1220.tistory.com/32 참고


'해킹 > kali tools' 카테고리의 다른 글

[Information-Gathering21]goofile  (0) 2016.03.18
[Information-Gathering20]golismero  (0) 2016.03.18
[Information-Gathering18]fierce  (0) 2016.03.07
[Information-Gathering17]exploitdb  (0) 2016.03.02
[Information-Gathering16]enum4linux  (0) 2016.02.29

[원문: http://tools.kali.org/information-gathering/fierce]


정의

First what Fierce is not. Fierce is not an IP scanner, it is not a DDoS tool, it is not designed to scan the whole Internet or perform any un-targeted attacks. It is meant specifically to locate likely targets both inside and outside a corporate network. Only those targets are listed (unless the -nopattern switch is used). No exploitation is performed (unless you do something intentionally malicious with the -connect switch). Fierce is a reconnaissance tool. Fierce is a PERL script that quickly scans domains (usually in just a few minutes, assuming no network lag) using several tactics.

 간략하게 fierce는 semi-lightweight한 스캐너로 DNS, whois, ARIN같은 것들을 이용하여 특정 도메인을 위한 비연속적 IP와 hostnames의 위치에 대해 취약점을 테스트하는 데 이용하는 도구이다.

또한, fierce는 주로 DNS를 이용하기 때문에 internal address space의 mis-configured networks를 찾는 데 사용된다.


Usage

syntax: #fierce -dns example.com

-delay    The number of seconds to wait between lookups.

-dns     The domain you would like scanned.

-dnsfile   Use DNS servers provided by a file (one per line) for reverse lookups (brute force).

-dnsserver Use a particular DNS server for reverse lookups 

-file A file you would like to output to be logged to.

-help This screen.

-range Scan an internal IP range (must be combined with -dnsserver).  

Usage: #fierce-range 111.222.333.0-255 -dnsserver ns1.example.co


-search  Search list.  When fierce attempts to traverse up and

down ipspace it may encounter other servers within other

domains that may belong to the same company.  If you supply a 

comma delimited list to fierce it will report anything found.

This is especially useful if the corporate servers are named

different from the public facing website.  

Usage: #fierce -dns examplecompany.com -search corpcompany,blahcompany 

Note that using search could also greatly expand the number of

hosts found, as it will continue to traverse once it locates

servers that you specified in your search list.  The more the

better.

-traverse Specify a number of IPs above and below whatever IP you

have found to look for nearby IPs.  Default is 5 above and 

below.  Traverse will not move into other C blocks.

-wordlist Use a seperate wordlist (one word per line).  

Usage: #fierce -dns examplecompany.com -wordlist dictionary.txt

fierce는 zone transfer를 수행하는데 아래는 수행이 되는 화면의 모습이다.

whoah가 인상적이다.

하지만 다른 사이트를 실행하면 알 수 있듯이 대부분의 사이트는 zone transfer가 수행되지 않는다.

zone transfer가 허용되지 않으면 무차별 대입으로 넘어가게 된다. 

output("Okay, trying the good old fashioned way... brute force"); 

$wordlist = $wordlist || 'hosts.txt'; 

if (-e $wordlist) { 

# user provided or default 

open (WORDLIST, '<', $wordlist) or 

open (WORDLIST, '<', 'hosts.txt') or 

quit_early("Can't open $wordlist or the default wordlist");

hosts.txt에는 2,280개의 host names이 들어가 있다. 

2013년 10월 이전까지는 kali의 버그로 인해 hosts.txt 위치를 찾을 수 없다고 출력되었는데 11월에 수정이 되었다.

vi편집기로 hosts.txt를 확인한 결과이다.

fierce는 2,280개의 common host names을 가지고 도메인 내의 특정 host names을 찾는다.

위의 구글 결과를 보면 알 수 있다.

아래는 hosts파일을 이용한 것이 아닌 개별로 작성한 wordlist의 결과화면이다.

wordlist에는 간략하게 mail, www, admin 정도만 넣었고 결과는 아래와 같다.


'해킹 > kali tools' 카테고리의 다른 글

[Information-Gathering20]golismero  (0) 2016.03.18
[Information-Gathering19]fragrouter  (0) 2016.03.07
[Information-Gathering17]exploitdb  (0) 2016.03.02
[Information-Gathering16]enum4linux  (0) 2016.02.29
[Information-Gathering15]DotDotPwn  (0) 2016.02.29

[원문: http://tools.kali.org/information-gathering/exploitdb]


정의

Searchable archive from The Exploit Database.

 간략하게 exploitdb는 로컬 exploitdb 저장소로부터 검색할 수 있는 쉘 스크립트이다. 원문 사이트에 가면 알 수 있듯이 정의가 저 한줄로 끝이다...


Usage

exploitdb는 기존의 다른 명령어와 달리 exploitdb가 아니다.

해당 디렉토리로 가보자.

칼리의 경우 아래 경로를 따른다.

#cd /usr/share/exploitdb

위의 사진을 보면 알 수 있듯이 명령은 searchsploit이다.

아래 사진을 보면 간단한 Usage가 나온다. 

file.csv에는 약 35,000개의 exploit 내용들을 포함하고 있다.

searchsploit명령어를 입력하고 간단하게 windows, linux 등의 찾고 싶은 단어를 입력하면 아래와 같이 exploit 제목과 해당 경로가 출력된다.

grep으로 원하는 문자를 입력하여 찾아볼 수 있다.

안드로이드의 예이다.

하지만 위의 안드로이드를 보면 알 수 있듯이 옛날 버전이 대다수이다. 위의 exploit을 사용해봤자 패치가 되었기 때문에 사용하기 어렵다. 그렇기 때문에 최신의 데이터가 필요하다.

https://www.exploit-db.com 에 접속해보자.



위의 사이트에 접속하면 최신 날짜에 새로운 것들이 추가되어있다. 다운로드가 가능하며 소스코드를 확인할 수 있다. 보안관리자의 경우 해당사이트의 업데이트를 가끔씩이나마 확인할 필요가 있어보인다.


실제로 윈도우 원격통제를 허용한다. 물론 xp버전이다. 최신 버전에서의 환경 구축 후 테스트 할 예정이다.


'해킹 > kali tools' 카테고리의 다른 글

[Information-Gathering19]fragrouter  (0) 2016.03.07
[Information-Gathering18]fierce  (0) 2016.03.07
[Information-Gathering16]enum4linux  (0) 2016.02.29
[Information-Gathering15]DotDotPwn  (0) 2016.02.29
[Information-Gathering14]dnswalk  (0) 2016.02.25

[원문: http://tools.kali.org/information-gathering/enum4linux]


정의

A Linux alternative to enum.exe for enumerating data from Windows and Samba hosts.


Overview:


Enum4linux is a tool for enumerating information from Windows and Samba systems. It attempts to offer similar functionality to enum.exe formerly available from www.bindview.com.


It is written in Perl and is basically a wrapper around the Samba tools smbclient, rpclient, net and nmblookup.


The tool usage can be found below followed by examples, previous versions of the tool can be found at the bottom of the page.


Key features:


RID cycling (When RestrictAnonymous is set to 1 on Windows 2000)

User listing (When RestrictAnonymous is set to 0 on Windows 2000)

Listing of group membership information

Share enumeration

Detecting if host is in a workgroup or a domain

Identifying the remote operating system

Password policy retrieval (using polenum)

 간략하게 enum4linux는 윈도우나 삼바 호스트로부터 정보를 나열하는 도구이다. 

위의 정의를 보면 알 수 있듯이 사용법은 간단할 것으로 보인다.  


Usage

syntax를 보면 알 수 있듯이 enum4linux.pl [옵션] ip 만 입력하면 끝이다.

#enum4linux -v target-ip

자세히 모드

#enum4linux -a target-ip

target에 대해 모든 옵션 실행(apart from dictionary based share name guessing)

#enum4linux -U target-ip

username list 출력

#enum4linux -u administrator -p password -U target-ip

username, password 명시

#enum4linux -r target-ip

RID 사이클을 통해 user 나열

#enum4linux -R 500-550 target-ip

RID범위를 지정하여 실행

#enum4linux -G target-ip

그룹과 멤버리스트 출력

#enum4linux -S target-ip

sharelist 출력

#enum4linux -s <share_file> target-ip

share_file을 가지고 무차별 대입 실시

#enum4linux -o target-ip

os정보 출력

등등


테스트 환경

target: samba가 구축된 우분투 pc(192.168.100.2)

#enum4linux -o 192.168.100.2

OS에 대한 정보가 출력됨을 확인할 수 있다.

#enum4linux -S 192.168.100.2

workgroupm을 보면 KKN-VIRTUAL-MACH 이 있는데 해당 머신이 실제적으로 2번 삼바와 워크그룹으로 묶여있다.

캡처는 안했지만 옵션 a를 주어 전체적으로 테스트하면 도메인 SID와 세션, Nbtstat을 확인할 수 있고 RID가 사이클되는 것을 확인할 수 있다.


'해킹 > kali tools' 카테고리의 다른 글

[Information-Gathering18]fierce  (0) 2016.03.07
[Information-Gathering17]exploitdb  (0) 2016.03.02
[Information-Gathering15]DotDotPwn  (0) 2016.02.29
[Information-Gathering14]dnswalk  (0) 2016.02.25
[Information-Gathering13]dnstracer  (0) 2016.02.25

[원문: http://tools.kali.org/information-gathering/dotdotpwn]


정의

It’s a very flexible intelligent fuzzer to discover traversal directory vulnerabilities in software such as HTTP/FTP/TFTP servers, Web platforms such as CMSs, ERPs, Blogs, etc.


Also, it has a protocol-independent module to send the desired payload to the host and port specified. On the other hand, it also could be used in a scripting way using the STDOUT module.


It’s written in perl programming language and can be run either under *NIX or Windows platforms. It’s the first Mexican tool included in BackTrack Linux (BT4 R2).


Fuzzing modules supported in this version:


HTTP

HTTP URL

FTP

TFTP

Payload (Protocol independent)

STDOUT

 간략하게 dotdotpwn는 디렉토리 접근 공격 퍼저(Directory Traversal Fuzzer)로 웹 플랫폼의 디렉토리를 탐색하고 해당 디렉토리의 접근 취약점을 알아보기 위한 도구이다. 

 dotdotpwn은 HTTP, FTP, TFTP와 같은 서버나, CMSs, ERPs, Blogs등과 같은 웹 플랫폼의 디렉토리 접근 취약점을 분석해주고, 표준출력(STDOUT)모듈을 이용할 수도 있다는 것으로 나와있다.

 또한 디렉토리 접근(Directory traversal)은 ../(dot dot slash)로도 알려져있다.

 아키텍처는 밑의 그림 참고(blackhat에서 그림 발췌)


Usage

관련 옵션이 상당히 많다.

테스트로는 -m(모듈), -h(호스트), -O(nmap을 통한 os정보 획득), -s(서비스 버전) 정도로 진행하고자 한다.

-S옵션을 줄 경우 SSL을 이용하는지 확인하는데 해당 사이트에서 사용하지 않을경우 종료되는 점 유의(다른 것도 마찬가지)

해당 호스트에서의 OS는 출력되지 않았지만 service의 경우 출력된 것을 확인할 수 있다. 해당 버전을 확인할 수 있기 때문에 버전 취약점을 이용한 악성행위가 가능하다.

또한 Path에 대해 취약하다는 것을 표시해준다.

dot와 slash, 패턴을 이용하여 서버에 보내고 서버로부터 응답코드를 확인하여 취약점이 있는지 판단하게 되는 구조이다. 

Example

1) HTTP Module

./dotdotpwn.pl -m http -h 192.168.1.1 -x 8080 -f /etc/hosts -k "localhost" -d 8 -t 200 -s

-m(mode), -h(hostname), -x(port), -f(file), -k(text pattern), -d(depth of traversals), -t(request time), -s(service)

2) URL module

./dotdotpwn.pl -m http-url -u http://192.168.1.1:10000/unauthenticated/TRAVERSAL -O -k "root:" -r webmin.txt

-m(mode), -u(specified URL), -O(os), -k(text pattern), -r(report file name)

3)FTP module

./dotdotpwn.pl -m ftp -h 192.168.1.1 -s -U nitr0us -P n1tr0u5pwnzj00 -o windows -q -r ftp_server.txt

-m(mode), -h(hostname), -s(sevice), -U(specified Username), -P(password), -o(known os), -q(quiet mode)

4)TFTP module

./dotdotpwn.pl -m tftp -h 192.168.1.1 -b -t 1 -f windows/system32/drivers/etc/hosts

-m(mode), -h(hostname), -b(취약점 발견시 종료), -t(request time), -f(file)

5)PAYLOAD module

./dotdotpwn.pl -m payload -h 192.168.1.1 -x 10000 -p payload_sample_1.txt -k "root:" -f /etc/passwd

6)STDOUT module

./dotdotpwn.pl -m stdout -d 5

The Traversal Engine will create fuzz pattern strings with 8 levels of deepness and DotDotPwn will 

print the results to STDOUT, so you can use it as you wish, by example, passing the traversal 

patterns as a parameter to another application, pipe, socket, etc.


'해킹 > kali tools' 카테고리의 다른 글

[Information-Gathering17]exploitdb  (0) 2016.03.02
[Information-Gathering16]enum4linux  (0) 2016.02.29
[Information-Gathering14]dnswalk  (0) 2016.02.25
[Information-Gathering13]dnstracer  (0) 2016.02.25
[Information-Gathering12]dnsrecon  (0) 2016.02.24

+ Recent posts