Posts

Showing posts from 2012

Bypass email server filtering provided you have a JDK installed

Image
A few days ago I was facing a funny issue at a client :
No usb key accessOnly CDROM Drive, but I replaced my laptop CDROM by an hardriveMail attachment agressively scanned and filtered So the project binaries I had to deliver (that contains .bat files, .jar, which are likely to cause the rejection) was rejected by the mail server.
So I had the idea to make a base64 encoding of the zip file, zip the text resutlt and send it by email... and it did work ;)
The only requirement is to have a JDK on the traget machine.
I used the SUN.MISC version as it's shipped with the JDK and requires no additional jar.
So Open a text editor, paste the following code : 
import java.io.*; import sun.misc.BASE64Encoder; public class EncodeFileWithBase64 { public static void main(String[] args) throws Exception { if (args.length < 2) { System.out.println("Usage: java EncodeFileWithBASE64 <inputfile> <outputfile>"); return; } String inputFile = args[0]; String …