- Messages
- 525
- Reaction score
- 0
- Points
- 26
Pre-requisite:
- Router that has USB Port and Supports TomatoUSB firmware (it may work on other firmware as well like OpenWRT and DDWRT, but well going to focus only in TomatoUSB)
- Flash Drive (at least 1Gig)
- Internet Connection
- Telnet or SSH client Program (Putty is a good one)
Instruction:
1. Create a OPTWARE flash drive using polka's tutorial Click Here
2. Open your SSH client and login to your router's CLI interface.
3. Enter this command and wait until it finishes
4. Next, enter this command
5. Nano will launch, enter this block of text.
(use right click on your mouse to paste the copied text)
Save it by pressing Ctrl+O and then ENTER.
To exit nano, press Ctrl+X
6. Your done, exit SSH client and login to TomatoUSB for script scheduling
7. add this script under Administration >> Scripting >> WAN UP
also add another one under scheduler found at Administration >> Scheduler
check the Custom field, set time to ecery 1 minute and check "Everyday"
and type this on command filed
8. To check, visit your Wimax admin page and you should be getting connection reset error or webpage can not be displayed error, as well as telnet is also in-accessible. This proves that the wimax protection is working properly.
---- In case that you want to adjust setting on your Wimax modem, just directly plug it on your PC and restart the wimax modem, you should be able to access telnet and web admin of the modem.
Conclusion: As soon as TomatoUSB booted up, your WiMAX will be automagically protected, and it also run the scipt every 1 minute to assure that the protection is properly applied. And you can trash your Wimax protector on your PC since that will be useless.
Credit to lavaboy for his telnet based wimax defender scipt.
- Router that has USB Port and Supports TomatoUSB firmware (it may work on other firmware as well like OpenWRT and DDWRT, but well going to focus only in TomatoUSB)
- Flash Drive (at least 1Gig)
- Internet Connection
- Telnet or SSH client Program (Putty is a good one)
Instruction:
1. Create a OPTWARE flash drive using polka's tutorial Click Here
2. Open your SSH client and login to your router's CLI interface.
3. Enter this command and wait until it finishes
Code:
ipkg install python nano
4. Next, enter this command
Code:
touch /opt/wimax_defender.py
nano /opt/wimax_defender.py
5. Nano will launch, enter this block of text.
(use right click on your mouse to paste the copied text)
Code:
import sys
import telnetlib
host = "192.168.254.1"
user = "Firefly"
password = "$P4mb1h1r4N4m4nT0!!"
tn = telnetlib.Telnet(host)
tn.read_until("Login: ")
tn.write(user + "\n")
tn.read_until("Password: ")
tn.write(password + "\n")
tn.read_until("ATP>")
tn.write("sh\n")
tn.read_until("/ #")
tn.write("killall web\n")
tn.read_until("/ #")
tn.write("killall cwmp\n")
tn.read_until("/ #")
tn.write("iptables -F INPUT\n")
tn.read_until("/ #")
tn.write("iptables -A INPUT -p udp --dport 68 -j ACCEPT\n")
tn.read_until("/ #")
tn.write("iptables -A INPUT -p tcp --dport 53 -j ACCEPT\n")
tn.read_until("/ #")
tn.write("iptables -A INPUT -p udp --dport 53 -j ACCEPT\n")
tn.read_until("/ #")
tn.write("iptables -A INPUT -p icmp -j DROP\n")
tn.read_until("/ #")
tn.write("iptables -A INPUT -p tcp -m tcp --tcp-flags ACK ACK -j ACCEPT\n")
tn.read_until("/ #")
tn.write("iptables -A INPUT -m state --state ESTABLISHED -j ACCEPT\n")
tn.read_until("/ #")
tn.write("iptables -A INPUT -m state --state RELATED -j ACCEPT\n")
tn.read_until("/ #")
tn.write("iptables -A INPUT -j REJECT\n")
tn.read_until("/ #")
tn.write("killall cli\n")
tn.write("exit\n")
tn.write("exit\n")
Save it by pressing Ctrl+O and then ENTER.
To exit nano, press Ctrl+X
6. Your done, exit SSH client and login to TomatoUSB for script scheduling
7. add this script under Administration >> Scripting >> WAN UP
Code:
python2.5 /opt/wimax_defender.py
also add another one under scheduler found at Administration >> Scheduler
check the Custom field, set time to ecery 1 minute and check "Everyday"
and type this on command filed
Code:
python2.5 /opt/wimax_defender.py
8. To check, visit your Wimax admin page and you should be getting connection reset error or webpage can not be displayed error, as well as telnet is also in-accessible. This proves that the wimax protection is working properly.
---- In case that you want to adjust setting on your Wimax modem, just directly plug it on your PC and restart the wimax modem, you should be able to access telnet and web admin of the modem.
Conclusion: As soon as TomatoUSB booted up, your WiMAX will be automagically protected, and it also run the scipt every 1 minute to assure that the protection is properly applied. And you can trash your Wimax protector on your PC since that will be useless.
Credit to lavaboy for his telnet based wimax defender scipt.