Richard Robertson Posted September 20, 2007 Share Posted September 20, 2007 (edited) I wrote this quick script to get around different types of web filters. You shoot your HTML file through it, and out comes an HTML file with a small javascript to tell the browser what the page actually contains. I'm sorry this explanation sucks.$source = FileOpenDialog("Select file", "", "HTML Files (*.html)") If @error Then Exit $destination = FileSaveDialog("Save to", "", "HTML Files (*.html)") If @error Then Exit $len = FileGetSize($source) $filein = FileOpen($source, 0) $fileout = FileOpen($destination, 2) FileWrite($fileout, '<html><script>document.write(unescape("') For $a = 1 To $len FileWrite($fileout, "%" & Hex(Asc(FileRead($filein, 1)), 2)) Next FileWrite($fileout, '"));document.close();</script></html>') FileClose($filein) FileClose($fileout) MsgBox(0, "Done", $source & " finshed, output to " & $destination & ".")Going to describe the program literally now.1. Asks for input/output filenames.Loop2. Reads character by character from source file and converts it to the format %HH where HH is the hexadecimal form of the ASCII value.3. Puts the %HH into the output file.Until EOF4. Lets you know it's finished.Ask questions if you have them, I really can't think of what else to say.Edit: Oh, and also your file will get bigger by 3 times plus some more for the javascript. So beware large files. Edited September 20, 2007 by Richard Robertson Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 20, 2007 Moderators Share Posted September 20, 2007 (edited) Since you are doing char by char, I would think this to be faster than opening the file up a million times for writing and reading:$source = FileOpenDialog("Select file", "", "HTML Files (*.html)") If @error Then Exit $destination = FileSaveDialog("Save to", "", "HTML Files (*.html)") If @error Then Exit $sRead = FileRead($source) $len = StringLen($sRead) FileClose(FileOpen($destination, 2)) $sHold = "" For $a = 1 To $len $sHold &= "%" & Hex(Asc(StringMid($sRead, $a, 1)), 2) Next FileWrite($destination, '<html><script>document.write(unescape("' & $sHold & '"));document.close();</script></html>') MsgBox(0, "Done", $source & " finshed, output to " & $destination & ".")oÝ÷ ØÚ-µë-yÑÔáËޮȨ+)®Ún½éßjË^«¢+ØÀÌØíͽÕÉô¥±=Á¹¥±½ ÅÕ½ÐíM±Ð¥±ÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðí!Q50¥±Ì ¨¹¡Ñµ°¤ÅÕ½Ðì¤)%ÉɽÈQ¡¸á¥Ð(ÀÌØíÍÑ¥¹Ñ¥½¸ô¥±MÙ¥±½ ÅÕ½ÐíMÙѼÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðí!Q50¥±Ì ¨¹¡Ñµ°¤ÅÕ½Ðì¤)%ÉɽÈQ¡¸á¥Ð()¥± ±½Í¡¥±=Á¸ ÀÌØíÍÑ¥¹Ñ¥½¸°È¤¤((ÀÌØíÍ!½±ôÅÕ½ÐìÅÕ½Ðì((ÀÌØíÍIô¥±I ÀÌØíͽÕɤ(ÀÌØíÍ!àôMÑÉ¥¹QÉ¥µ1СMÑÉ¥¹Q½ ¥¹Éä ÀÌØíÍI¤°È¤(ÀÌØí±¸ôMÑÉ¥¹1¸ ÀÌØíÍ!à¤()½ÈÀÌØíôÄQ¼ÀÌØí±¸MÑÀÈ($ÀÌØíÍ!½±µÀìôÅÕ½ÐìÅÕ½ÐìµÀìMÑÉ¥¹5¥ ÀÌØíÍ!à°ÀÌØí°È¤)9áÐ()¥±]É¥Ñ ÀÌØíÍÑ¥¹Ñ¥½¸°Ìäì±Ðí¡Ñµ°ÐìØÀíÍÉ¥ÁÐÐí½Õµ¹Ð¹ÝɥѡչÍÁ ÅÕ½ÐìÌäìµÀìÀÌØíÍ!½±µÀìÌäìÅÕ½Ð줤í½Õµ¹Ð¹±½Í ¤ì±Ðì½ÍÉ¥ÁÐÐì±Ð콡ѵ°ÐìÌäì¤()5Í ½à À°ÅÕ½Ðí½¹ÅÕ½Ðì°ÀÌØíͽÕɵÀìÅÕ½Ð쥹͡°½ÕÑÁÕÐѼÅÕ½ÐìµÀìÀÌØíÍÑ¥¹Ñ¥½¸µÀìÅÕ½Ðì¸ÅÕ½Ðì¤ **Just some food for thought. Edited September 20, 2007 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
BillLuvsU Posted September 20, 2007 Share Posted September 20, 2007 Sooooo, this will make a website that your hosting get past web filters?? o_0 [center][/center]Working on the next big thing.Currently Playing: Halo 4, League of LegendsXBL GT: iRememberYhslaw Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 20, 2007 Author Share Posted September 20, 2007 Thanks Smoke, I appreciate the gesture, but I wrote this at 11 PM and didn't bother to think about speed. But yes fear, the filter will just see a bunch of javascript and not see anything worth filtering. Unless it catches javascript that is. If you want to see what it looks like, throw a file through it, then open it up in your browser. Link to comment Share on other sites More sharing options...
Dhilip89 Posted September 20, 2007 Share Posted September 20, 2007 Nice, do this support ASCII characters only ? [u]My Projects[/u]:General:WinShell (Version 1.6)YouTube Video Downloader Core (Version 2.0)Periodic Table Of Chemical Elements (Version 1.0)Web-Based:Directory Listing Script Written In AutoIt3 (Version 1.9 RC1)UDFs:UnicodeURL UDFHTML Entity UDF[u]My Website:[/u]http://dhilip89.hopto.org/[u]Closed Sources:[/u]YouTube Video Downloader (Version 1.3)[quote]If 1 + 1 = 10, then 1 + 1 ≠ 2[/quote] Link to comment Share on other sites More sharing options...
jvanegmond Posted September 20, 2007 Share Posted September 20, 2007 (edited) Pretty cool, and it works very well. I wonder if a website like this rings any bells at Windows Vista's phishing filter...Edit: Check out the two attached files, one of them is "encrypted" and one of them is not.. Spot the differences. Edited September 20, 2007 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
ptrex Posted September 20, 2007 Share Posted September 20, 2007 @Richard Robertson This is a good addition to my Email encoder. (See my signature.) Good job !! regards ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Richard Robertson Posted September 20, 2007 Author Share Posted September 20, 2007 @Dhilip, it only supports ASCII, yes, because javascript's unescape function only loads 2 hexadecimal characters. @Manadar, I do see a difference, but according to DOM, they are identical with the exception that the other has a script in the head block. I loaded in both Firefox and Internet Explorer and saw different results. I don't know why it does that, all I can say is that the browser is handling the render process. It is still the exact same DOM structure. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now