corz.org front page. welcome! cor's blog, aka 'corzblog'. I write stuff here.. downloads of all shapes and sizes, documents, secret chasms, you name it.. developing sites, software, stuff.. updates generally get posted here. music is everywhere, sometimes I pin it down.. soul-candy, captured things you can look at.. 'Mathematics For Women' copyright Cor 1994 ;o)
the power to serve, at home or anywhere. webmasters tricks, tips, tools and resources. the devil's work, or a capable multimedia desktop, you decide..
information and search
contact page for corz.org, ways to get $hit to me.. get a print friendly version of this page, probably.. Put YOUR money where MY mouth is!
 
corz.org text viewer..
[currently viewing: /public/docs/comms/router/shell scripts/deprecated/rad.bat - raw]
 
@echo off
::::        rad.bat        ::::
:
:     Router Automatic Deletions  (Windows v0.2)
:     (insert hearty laugh)
:
:    from..
:    http://corz.org/comms/hardware/router/bt.voyager.205_router.how-to.php
:
:     fight back against automatic rule insertion, with..
:     automatic rule deletion!
:
:    incredible! I did a windows version!
:
:     corz.org
:    ;o)
:
:    thanks to Bill Allen for the inspiration!
::::
::::    instructions    ::::
:
: set your prefs below. then drop this script into your PATH somewhere.
: C:\windows\system32\ is a safe bet, or you may have another place for
: keeping batch scripts and other executables.
:
: after a router reboot, simply type "rad" in a DOS shell. TADA!
: or you might want to make a shortcut, keep it somewhere handy.
:
: you'll need the windows scripting host running, it probably is,
: unless you have a really old version of windows.
:
::::
::::    ::::    ::::    IMPORTANT!!!!    ::::    ::::    ::::
:
:     DO NOT TOUCH ANYTHING UNTIL THE SCRIPT IS COMPLETE!!!
:
: It won't break your router, but this is a really messy "send keys" affair
: and if the created window (telnet session) isn't in focus for the entire
: operation, the keys will be sent to the wrong place! when it's all done,
: you can kill the telnet window, if it hasn't killed itself. ;o)
:
: just run it, and all will become clear, if it isn't already.
:
::::    ::::    ::::    IMPORTANT!!!!    ::::    ::::    ::::
::::

: prefs..
:set router=router
set router=192.168.1.1
set user=admin
set password=admin


: okay, here goes..
echo.
echo.
echo.       STEP BACK FROM THE COMPUTER!!!
echo.
echo.             TOUCH NOTHING!!!
echo.
echo.

: create sendKeys script
echo.set sh=WScript.CreateObject("WScript.Shell") > tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs

: send username
echo.sh.SendKeys "%user%" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs
: send password
echo.sh.SendKeys "%password%" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs


: send commands
echo.sh.SendKeys "delete ipf rule entry ruleid 10" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs

echo.sh.SendKeys "delete ipf rule entry ruleid 11" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs

echo.sh.SendKeys "delete ipf rule entry ruleid 12" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs

echo.sh.SendKeys "delete ipf rule entry ruleid 30" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs

echo.sh.SendKeys "delete ipf rule entry ruleid 31" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs

echo.sh.SendKeys "delete ipf rule entry ruleid 32" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs

echo.sh.SendKeys "delete ipf rule entry ruleid 50" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs

echo.sh.SendKeys "delete ipf rule entry ruleid 51" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs

echo.sh.SendKeys "delete ipf rule entry ruleid 52" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs

echo.sh.SendKeys "delete ipf rule entry ruleid 32" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs

echo.sh.SendKeys "delete ipf rule entry ruleid 70" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs

echo.sh.SendKeys "delete ipf rule entry ruleid 71" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs

echo.sh.SendKeys "delete ipf rule entry ruleid 72" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs

echo.sh.SendKeys "delete ipf rule entry ruleid 90" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs

echo.sh.SendKeys "delete ipf rule entry ruleid 91" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs

echo.sh.SendKeys "delete ipf rule entry ruleid 92" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs
echo.WScript.Sleep 1000 >> tmp.vbs

: bye!
echo.sh.SendKeys "exit" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs

: bye bye! I told you to leave it alone!
echo.sh.SendKeys "%%F4" >> tmp.vbs
echo.sh.SendKeys ChrW(13) >> tmp.vbs

: open a telnet session
start telnet %router%

: send keys to telnet window
cscript//nologo  tmp.vbs

: clean-up
del tmp.vbs

exit