Under pure PHP we can use something like ioncube/else with obfuscation. Under pre-HHVM we can use already compiled code without sources. But under current HHVM can we somehow hide our sources?
Tag: obfuscation,hhvm,code-security
Under pure PHP we can use something like ioncube/else with obfuscation. Under pre-HHVM we can use already compiled code without sources. But under current HHVM can we somehow hide our sources?
@paulbliss:
You could compile a bytecode repository and run that, but it's not something that would be difficult to reverse engineer. ... There isn't any great documentation on building repos. The wrapper script in tools/hhvm_wrapper.php has some useful shortcuts, you can look at the help options. There really isn't a great option for obfuscation, but repo-authoritative is probably your best bet as it will do some optimizations on top of the bytecode.
@see https://github.com/facebook/hhvm/issues/4929#issuecomment-76751039
Ini settings for hhvm and it's server: https://github.com/facebook/hhvm/wiki/INI-Settings
Complete shell that compiles, removes sources and run from optimized repo: https://gist.github.com/garex/b0fa539903746e67ad6c
So as a workaround you can have compiled sources under root user but run hh server under www-data. So even if attacker will break you through web -- it will not see sources there.
You can do what you want using only ObfuscationAttribute, but it's tedious: apply [Obfuscation(ApplyToMembers=false)] to the class, and [Obfuscation] to every individual member except the constructor. Alternatively, use your obfuscator's configuration to exclude the constructor from consideration. Since ObfuscationAttribute offers only very limited control (just turning features on and off,...
The main part here is imageloadfont is not supported, which means calling it will cause a fatal error like the one you're seeing. You could open an issue about it to see if it can be implemented, or if the HNI definition can be removed so that a function_exists for...
This is currently hardcoded in hhvm's source. I highly recommend submitting a feature request to the hhvm team, they're a bunch of very helpful people. If you're not interested in that, you could pretty easily edit the timestamp call to include the offset, then rearrange the snprintf() lines to match...
The code looks like generated by Dean Edwards' packer (or another similar one). You could unpack it with this tool. It's indeed JavaScript, however replaced keywords, method, variables with meaningless strings. The bottom half of the file you provided is actually a mapper between obscured and original. And this, it...
Nothing appears to be available for this TODAY: There are very few tools that work on Java source code obfuscation to begin with. Some of these are either not free or are not Java based. Source code (formatting) tools that remain are not customizable enough to remove all the comments...
The code will not work. The JIT isn't an addition to an existing PHP implementation. HHVM is a completely separate implementation, including differences in what will and won't run.
azure,windows-azure-storage,obfuscation
I am no security expert, but IMHO, you are being over cautious... with the name, that is.. Having said that, it is always a good security policy to rotate the access keys at a given frequency. The very reason why these services support primary and secondary access keys is to...
"en" == r.language && (o += "-" + r.language.toString().toLowerCase()), Ooh...that line's tricky. So, example: If you were to write var myVar = false && thisFunctionThrowsError(), where the function would throw an exception if it were called, that would actually not return an error - because anything after the ampersand won't...
java,gson,proguard,obfuscation
Your classes look fine. ClassCastException means that Gson didn't know that a field should have been serialized as Profile. Make sure your proguard.cfg contains all of these rules....
If you go here you can see that Apple is simply storing all external js in one file. Probably to increate page load speed (more info).
If you want to obfuscate your application's JavaScript code - go ahead and obfuscate. The following blog post details obfuscation instructions in Worklight-based applications (this includes MobileFirst Platform): Obfuscating JavaScript code in Worklight applications...
ios,obfuscation,code-access-security
The script uses git and you are running it from a non-git directory. I would recommend commenting-out the git commands....
In your project directory you will find a proguard folder click it, and then you will see 4 text files, DUMP MAPPING SEEDS USAGE.. elaboration dump.txt Describes the internal structure of all the class files in the .apk file mapping.txt Lists the mapping between the original and obfuscated class, method,...
This means that hh_client executable was called and returned something other than "No errors!".
First of all, sorry for the amount of text I wrote. Secondly, I totally agree with the answer to the question you linked to: Stay away from code-flow-altering "obfuscators". (I'd call them "scramblers", but that would be a case for English.) Thirdly, very strictly speaking, pure obfuscation (as in class...
.net,windows-store-apps,obfuscation
I have found solution in installing VS plugin of .NetReactor, where i have set settings for obfuscation of some libraries, and then when i have created new store package, plugin working in this proccess and obfuscated code in prepared package.
magento,cookies,nginx,session-cookies,hhvm
We solved this issue by adding the HHVM ini setting: hhvm.server.allow_duplicate_cookies = 0 More info: https://github.com/facebook/hhvm/issues/2758...
No, this is correct. HHVM doesn't output anything yet than "HipHop". This was already reported 2010. https://github.com/facebook/hhvm/issues/172 https://github.com/facebook/hhvm/issues/1038 You could use this to see what your configuration is https://gist.github.com/ck-on/67ca91f0310a695ceb65...
arrays,vector,nullable,hhvm,hacklang
The easiest way would be to not use a nullable Vector. private Vector<string> $lines = Vector {}; gets around the need for a constructor too. Otherwise, you'll need to check if the value isn't null, then append to it: public function addLine(string $line): void { $vec = $this->lines; if ($vec...
Okay I've solved my first question. I don't have any global scope issues. My require is being done from inside function main(), so it's as if the code from lookuptable####.php is being inserted into function main(). HHVM docs: "If the include occurs inside a function..." Basically if you were to...
php,pdf,imagemagick,imagick,hhvm
OK...so the (kind of hacky) way to fix this in my situation is to use fopen() and then use setIteratorIndex(0) which is HIGLY unintuitive. But for those having the same problem...there you go! $pdf_handle = fopen('/path/to/file.pdf', 'rb'); $doc_preview = new Imagick(); $doc_preview->setResolution(180,180); $doc_preview->readImageFile($pdf_handle); $doc_preview->setIteratorIndex(0); $doc_preview->setImageFormat('jpeg'); $doc_preview->writeImage('/path/to/file.jpg'); $doc_preview->clear(); $doc_preview->destroy(); ...
HHVM can't optimize code running at the top level (i.e., outside a function) very well. In the first example, most of the work is happening outside a function -- the "work" is the $sum += $i. Moving that into a function, your second example, allows HHVM to optimize it pretty...
In the gui of ConfuserEx you can simply select the already added modules and edit them. In the edit mask you can add your key and the key password. Done! Alternatively you can directly edit the .crproj file with a texteditor and add 2 attributes snKey and snKeyPass to your...
Functions like this marked as missing in HHVM are usually because the function is part of an extension that hasn't been implemented yet. The PHP.net docs say it's part of a PECL extension, pecl_http -- which doesn't look to be on by default even in PHP5 (although of course it...
java,android,proguard,obfuscation,twitter4j
Looks like there were a number of issues. Got it sorted in the end. In case it helps anyone else, here is my full proguard-project.txt file: # To enable ProGuard in your project, edit project.properties # to define the proguard.config property as described in that file. # # Add project...
Proguard is part of the android eclipse plugin, so you do not have to invoke it manually. You just need to activate it on your build. Read more here....
Some code can reference variables / types (symbols) using a string (e.g., strings read from resource files) - for example through reflection. The obfuscator you found is probably unable to detect when a symbol is referenced by string - it can possibly rename a symbol, whose name appears in a...
These code examples cause undefined behaviour because t-- is unsequenced with respect to the t at the start of the expression. The sequencing relations here are: t-- is sequenced-before the other expressions in the ternary operator The arguments to scanf are each sequenced-before using the return value of scanf However...
php,html,url,obfuscation,percent-encoding
$url = '..'; $encoded = join(array_map(function ($byte) { return "%$byte"; }, str_split(bin2hex($url), 2))); That's essentially the entire encoding mechanism. Take the raw bytes in hex (bin2hex), 2 characters per byte, and prepend a %. Not that this will really do a whole lot for obfuscation. The browser may indeed not...
Turns out that happens if you try to serialize an Exception. (In this case, outputting it via Log::error("...", [$e]). Just stringify it and all is good.
javascript,obfuscation,referenceerror,rot13
Try this ... the last part of the script is just plain wrong: <span id="obf"> <script>document.getElementById("obf").innerHTML="<n uers=\"znvygb:[email protected]\" >[email protected]</n>".replace(/[a-zA-Z]/g,function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);});</script> <noscript>[Enable JavaScript to see email]</noscript> </span> ...
I wouldn't put much energy to doing it very thoroughly, because the reverse engineer is going to win this round. http://programmers.stackexchange.com/questions/155131/is-it-important-to-obfuscate-c-application-code Obfuscating C++ binaries is a bit of a losing battle. It depends on who you are dealing with, but if your reverse engineer is smart enough to use IDA...
android,gradle,mapping,proguard,obfuscation
Many thanx to Sergii Pechenizkyi who helped me to found this good solution. To implement copying of proguard mapping files for each flavor we can create "root" task copyProguardMappingTask and number of dynamic tasks for each flavor def copyProguardMappingTask = project.tasks.create("copyProguardMapping") applicationVariants.all { variant -> variant.outputs.each { output -> ......
obfuscation,hhvm,code-security
@paulbliss: You could compile a bytecode repository and run that, but it's not something that would be difficult to reverse engineer. ... There isn't any great documentation on building repos. The wrapper script in tools/hhvm_wrapper.php has some useful shortcuts, you can look at the help options. There really isn't a...
css,html5,twitter-bootstrap,obfuscation
You're not doing anything wrong, so no worries there. It's just that IE, although it knows about direction:rtl, forgets to apply it to the :before as well. One way to make it work is to make the container of the span rtl, so that the whole of the span, including...
I figured out the problem we had where the image disappeared when we enabled HHVM from control Panel. The problem is the memory limit in the .INI file was -1 and magneto GD2.php does not recognize -1 value in memory check function in GD2.php as in the code below (LINE...
Where is your HHVM pid file configured to live? In /etc/hhvm/server.hdf or similar, do you have a PidFile = setting? I set mine to PidFile = /var/run/hhvm/pid. I then did a mkdir /var/run/hhvm....
javascript,obfuscation,google-closure-compiler
Update As of the 20150315 release of Closure-compiler, the type based optimizations are enabled by default. This is actually covered in the project FAQ. The option you want is use_types_for_optimization. This will enable property renaming even if a property of the same name is defined on an unrelated object. The...
Sorry for the noise, but it looks like this is a bug. https://github.com/facebook/hhvm/issues/4993
Replace the below HHVM conf with yours: location ~ \.(hh|php)$ { fastcgi_keep_conn on; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } Problem I see a space between $document_root and $fastcgi_script_name. Update Solved by changing $document_root with /var/www...
android,android-studio,sdk,obfuscation,r.java-file
The Android Archive (AAR) format does what you want. It's like an Android-specific JAR file and contains compiled code, but includes its own resources and manifest. You can also include obfuscation as part of the build process. By default, the current version of Android Studio (1.2) and Gradle automatically build...
java,maven,maven-3,proguard,obfuscation
I fixed the problem by changing the version of proguard-maven-plugin from 2.0.7 to 2.0.8.
design-patterns,singleton,hhvm,hacklang
How do I assign a default value to a static property? If it's an object, like in this case, you can't. With primitives, you can do something like this: <?hh // strict class Foo { private static int $x = 0; // ... } However, for objects, you'd need...
You are probably using an outdated version of HHVM. This problem sounds an awful lot like this race condition, which was fixed in HHVM 3.5.0 and newer (and was backported into the 3.3.3 LTS release). Notably, 3.4.x still had the bug. What version of HHVM are you using?...
This is not supported. A Hack project is designed to be checked as a single project, with full analysis going across all of the different parts of it. If it doesn't typecheck as a whole, then the behavior of HHVM on it is undefined. You should really, really carefully consider...
c#,visual-studio-2010,crash,obfuscation,dotfuscator
Based off of the error dialog you posted, you are having stack issues in native code: From MSDN: 0xC0000409 STATUS_STACK_BUFFER_OVERRUN The system detected an overrun of a stack-based buffer in this application. This overrun could potentially allow a malicious user to gain control of this application. Tracking down what is...
java,obfuscation,deobfuscation
First of all, you should note that it is the parameters which have this unicode and not the methods. Why is this important? Parameters do not need to have names specified, as they are mostly indexed by a number reference. However it can be specified and I assume that most...