I made this program that makes your computer act as a wifi Pineapple.
For wifi to wifi.
#!/bin/bash
airmon-ng stop mon0
airmon-ng start wlan0
airbase-ng -e "TEST" -c 9 mon0 &
ifconfig at0 up
ifconfig at0 192.168.2.129 netmask 255.255.255.128
route add -net 192.168.2.128 netmask 255.255.255.128 gw 192.168.2.129
dhcpd3 -cf /etc/dhcp3/dhcpd.conf -pf /var/run/dhcp3-server/dhcpd.pid at0
iptables --flush && iptables --table nat --flush && iptables --delete-chain && iptables --table nat --delete-chain &&
iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE &&
iptables --append FORWARD --in-interface at0 -j ACCEPT &&
echo 1 > /proc/sys/net/ipv4/ip_forward
It works but It is set to use Wlan0 as both in and out interfaces because I only have one wifi card.
From ethernet to wifi.
#!/bin/bash
airmon-ng stop mon0
airmon-ng start wlan0
airbase-ng -e "TEST" -c 9 mon0 &
ifconfig at0 up
ifconfig at0 192.168.2.129 netmask 255.255.255.128
route add -net 192.168.2.128 netmask 255.255.255.128 gw 192.168.2.129
dhcpd3 -cf /etc/dhcp3/dhcpd.conf -pf /var/run/dhcp3-server/dhcpd.pid at0
iptables --flush && iptables --table nat --flush && iptables --delete-chain && iptables --table nat --delete-chain &&
iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE &&
iptables --append FORWARD --in-interface at0 -j ACCEPT &&
echo 1 > /proc/sys/net/ipv4/ip_forward
From wifi to ethernet.
#!/bin/bash
route add -net 192.168.2.128 netmask 255.255.255.128 gw 192.168.2.129
dhcpd3 -cf /etc/dhcp3/dhcpd.conf -pf /var/run/dhcp3-server/dhcpd.pid at0
iptables --flush && iptables --table nat --flush && iptables --delete-chain && iptables --table nat --delete-chain &&
iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE &&
iptables --append FORWARD --in-interface eth0 -j ACCEPT &&
echo 1 > /proc/sys/net/ipv4/ip_forward
Thats All of them!