Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Autore: greyfox
- ## Sviluppo: Beta
- ## Programmi richiesti:
- ## 1) airmon-ng
- ## 2) airbase-ng
- import os
- ## Modifica file DNS
- dnsfile = open('/etc/dhcp3/dhcpd.conf','w')
- dnsfile.write('ddns-update-style ad-hoc;\n')
- dnsfile.write('default-lease-time 600;\n')
- dnsfile.write('max-lease-time 7200;\n')
- dnsfile.write('subnet 192.168.2.128 netmask 255.255.255.128 {\n')
- dnsfile.write('option subnet-mask 255.255.255.128;\n')
- dnsfile.write('option broadcast-address 192.168.2.255;\n')
- dnsfile.write('option routers 192.168.2.129;\n')
- dnsfile.write('option domain-name-servers 4.2.2.2;\n')
- dnsfile.write('range 192.168.2.130 192.168.2.140;}\n')
- dnsfile.close()
- ## Inserimento dati canale
- channel_name = raw_input('Inserisci il nome del canale:')
- channel_number = raw_input('Inserisci il numero del canale:')
- ## Impostazione base airmon-airbase
- cmd_airbase = "airbase-ng -e"+channel_name+" -c"+channel_number+" mon0"
- airmon_start = os.popen('airmon-ng')
- airmon_start = os.popen('airmon-ng start wlan0')
- airbase = os.popen(cmd_airbase)
- airbase = os.popen(cmd_airbase)
- ## Impostazione base ifconfig
- ifconfig = os.popen('ifconfig at0 up')
- ifconfig = os.popen('ifconfig at0 192.168.2.129 netmask 255.255.255.128')
- ifconfig = os.popen('route add -net 192.168.2.128 netmask 255.255.255.128 gw 192.168.2.129')
- ## Start DHCP
- dhcp_start = os.popen('mkdir -p /var/run/dhcpd && chown dhcpd:dhcpd /var/run/dhcpd')
- dhcp_start = os.popen('dhcpd3 -cf /etc/dhcp3/dhcpd.conf -pf /var/run/dhcpd/dhcpd.pid at0')
- ## Configurazione e impostazione IPTABLES
- iptables = os.popen('iptables --flush')
- iptables = os.popen('iptables --table nat --flush')
- iptables = os.popen('iptables --delete-chain')
- iptables = os.popen('iptables --table nat --delete-chain')
- iptables = os.popen('echo 1 > /proc/sys/net/ipv4/ip_forward')
- iptables = os.popen('iptables --table nat --append POSTROUTING --out-interface wlan1 -j MASQUERADE')
- iptables = os.popen('iptables --append FORWARD --in-interface at0 -j ACCEPT')
- iptables = os.popen('iptables -t nat -A PREROUTING -p udp --dport 53 -j DNAT --to 192.168.1.1')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement