Code for voting using ADSL dial-up and IP address change with vbs

Source: Internet
Author: User

I used to write a vbs that used ADSL dial-up to change IP address traffic. I only need to change the refreshed page slightly (add a automatically submitted JS), but I cannot find any of them, there is no way to re-write.
Another way is to directly submit the file in vbs, but it has been written for a long time and has not been run yet. It will be posted after modification.
I encountered a problem during writing. When I submitted a webpage using JS, the page jumps to the page where the voting result is displayed. A dialog box Indicating successful voting is displayed, this will affect the opening of the following webpage. And can not shield, so the use of a compromise, each end of the browser process, in the brush behind the page. CopyCode The Code is as follows: const forappending = 8
Const forreading = 1
Const filename = "iplog.txt"
Set objfso = Createobject ("scripting. FileSystemObject ")
Set objtextfile = objfso. opentextfile (filename, forappending, true)
Objtextfile. writeline "------------------ use ADSL dial-up to change IP address to vote -----------------"
Objtextfile. writeline "" & now
Objtextfile. Close
For I = 1 to 300'
Do
'---------------------------- Dial ---------------------------------
Set pp = wscript. Createobject ("wscript. Shell ")
Pp. Run "rasdial Internet/disconnect", 0
Wscript. Sleep 2000
Pp. Run "rasdial Internet lan245561315 11811", 0
Set pp = nothing
Wscript. Sleep 2000
'---------------------------- Read IP -------------------------------
Strcomputer = "."
Set ob1_miservice = GetObject ("winmgmts: \" & strcomputer & "\ Root \ cimv2 ")
Set ipconfigset = ob1_miservice. execquery ("select IPaddress from win32_networkadapterconfiguration where ipenabled = true ")
For each ipconfig in ipconfigset
If ipconfig. IPaddress (0) <> "169.254.1.20." then' local connection of ADSL
IPaddress = ipconfig. IPaddress (0)
End if
Next
'---------------------------- Determine whether the IP address is repeated -----------------------
Set objfso = Createobject ("scripting. FileSystemObject ")
Set objtextfile = objfso. opentextfile (filename, forreading)
Do until objtextfile. atendofstream
Strip = objtextfile. Readline
Arriplist = Split (strip ,",")
If arriplist (0) = IPaddress then
Issame = true
Exit do
Else
Issame = false
End if
Loop
Objtextfile. Close
Loop while issame = true
'---------------------------- Save IP record ---------------------------
Set objfso = Createobject ("scripting. FileSystemObject ")
Set objtextfile = objfso. opentextfile (filename, forappending, true)
Objtextfile. writeline IPaddress & "," & now
Objtextfile. Close
'---------------------------- Open the browser and start refreshing ---------------------
Set Ie = wscript. Createobject ("internetexplorer. application ")
Ie. Visible = 1' browser visible 0 invisible
Ie. navigate "http://www.169ol.com/
"'Solve the problem of Netcom redirection (Netcom is so annoying)
Wscript. Sleep 3000
'The modified form submitted can also be submitted locally. You need to set the IE security to a low point. Otherwise, it will be prompted every time.
Ie. navigate "http://www.link888.net/testspeed.html"
Wscript. Sleep 10000
'---------------------------- END the browser process ------------------------
Strcomputer = "."
Set ob1_miservice = GetObject ("winmgmts:" & "{impers }! \ "& Strcomputer &" \ Root \ cimv2 ")
Set colprocesslist = obw.miservice. execquery ("select * From win32_process where name = 'iw.e.exe '")
For each objprocess in colprocesslist
Objprocess. Terminate ()
Next
Next

Testspeed.htmlCopy codeThe Code is as follows: <form action = "http://www.xxx.cn/vote/kuangquanshui/addvote.asp" method = "Post" name = "form1" id = "form1">
<Input name = "Vote" type = "checkbox" id = "Vote" value = "35" Checked = "checked"/>
<Input type = "Submit" name = "submit2" value = "Vote">
</Form>
<Script language = "JavaScript">
SetTimeout ("document. form1.submit ()", 3000) // submit after 3 seconds
</SCRIPT>

This is submitted by means of refreshing web pages (which contains automatically submitted JS files). A better way is to directly submit a form using vbs scripts.
However, this will all have limitations. The voting system I tested has no restrictions on the submission address, but only the IP address, so you can submit it locally. If some servers have restrictions, you cannot directly submit the form.
You can use a frame to include the original webpage, and then use the JS script to submit the form in the frame to break through.
If the frame reference is disabled, it will not be sent, and it must be implemented through software.
Prevents ticket Refresh:
1. Restrict IP addresses
2. Verification Code (a little complicated, not too simple)
3. Restrict the source of the submitted form.
4. Disable external frame reference

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.