Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pyrocat101
Created August 19, 2014 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pyrocat101/c1c300c4d806513c1a56 to your computer and use it in GitHub Desktop.
Save pyrocat101/c1c300c4d806513c1a56 to your computer and use it in GitHub Desktop.
HITCON CTF2014 - polyglot (Python2/Python3/C/Ruby/Haskell polyglot to `cat flag`)
x = {-
#if 0
0 + """".to_i => 0}
print `cat flag`
__END__
""".find('x')}
import os
p = os.system;{
#endif
1};
#define p(s) main(){system(s);}
p("cat flag");
#define x // -}();main = do x <- readFile "flag"; putStr x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment