<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gtorok</id>
		<title>OWASP - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gtorok"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/Gtorok"/>
		<updated>2026-04-26T00:17:38Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Javascript_obfuscation&amp;diff=256593</id>
		<title>Javascript obfuscation</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Javascript_obfuscation&amp;diff=256593"/>
				<updated>2020-01-08T21:10:19Z</updated>
		
		<summary type="html">&lt;p&gt;Gtorok: Added page on JavaScript Obfuscation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is JavaScript obfuscation and in app protection? == &lt;br /&gt;
An obfuscator converts JavaScript source code into something that is virtually unreadable by humans but remains fully functional. In conjunction with obfuscation, various self-defending techniques can be injected to protect the app. For example:&lt;br /&gt;
* Execution can be prevented within a debugger. This may stop easy inspection and probing.&lt;br /&gt;
* Execution can be prevented if the app is tampered with in any way. This may hinder probing and theft.&lt;br /&gt;
* Execution can be limited to a certain time range. This may be useful for demos.&lt;br /&gt;
* Execution can be limited to running from a specified domain. This may prevent someone from easily copying and reusing it. &lt;br /&gt;
&lt;br /&gt;
== What are the difference between minification and obfuscation for JavaScript apps?==&lt;br /&gt;
Both transform your JavaScript app, but their goals are entirely different.&lt;br /&gt;
The goal of minification is to improve performance by decreasing the size of your code.&lt;br /&gt;
A JavaScript minifier will typically remove whitespace, comments, new line characters, etc. Generally, anything that can be removed without compromising functionality is taken out. Some minifiers also change some identifier names as a way to save space.  This makes the code harder to read for a casual viewer, but that is a side effect and not the main intent.&lt;br /&gt;
The goal of obfuscation and in-app protection is to make the app harder to inspect, probe, alter or misuse. &lt;br /&gt;
&amp;lt;p&amp;gt;Obfuscators typically perform standard minification techniques, but might also apply additional renaming techniques that can further reduce the size of the app. If an obfuscator stopped there, it would match or beat a minifier in size reduction. However, many of its other protection and self-defending transforms add code, so overall it may or may not reduce the size of your original app depending on your configuration options. &amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What is different about obfuscating Java or .NET vs.  obfuscating JavaScript apps?==&lt;br /&gt;
Unlike languages like Java or .NET which compile to some type of intermediate language before being distributed as binary executables, JavaScript apps are generally delivered as source code for execution. &lt;br /&gt;
That makes it inherently more difficult to protect them from copying, inspection, theft and tampering. And hackers can easily step through the executing code via a debugger built into their browser.  Also, since they have the source, they can easily use tools to statically analyze the code for vulnerabilities.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Java or .NET -&amp;gt; &amp;lt;i&amp;gt;Compiler&amp;lt;/i&amp;gt; -&amp;gt; Executable -&amp;gt; &amp;lt;i&amp;gt;Obfuscator &amp;amp; Protector&amp;lt;/i&amp;gt; -&amp;gt; Protected Executable&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
JavaScript Source Code -&amp;gt; &amp;lt;i&amp;gt;Obfuscator &amp;amp; Protector&amp;lt;/i&amp;gt; -&amp;gt; Protected Source Code&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What criteria should I consider when deciding to obfuscate and protect a JavaScript app? ==&lt;br /&gt;
* Does it contain code you don't want competitors to copy or steal?&lt;br /&gt;
* Would an attacker want to bypass some of your checks or actively look for vulnerabilities?&lt;br /&gt;
* Is there a risk that the code might be modified to serve malware, enable phishing, etc.? &lt;br /&gt;
If the answer is “yes” to any of these questions, then you might consider obfuscating and protecting your JavaScript code. It will make it more difficult for a hacker to do these things. &lt;br /&gt;
However, obfuscating and protecting your JavaScript will NOT make these things impossible, only much harder. The only way to completely protect JavaScript code is to not run in it in an untrusted environment where potential attackers can access it. But with today’s architectures, it is usually not possible to implement this strategy, because your JavaScript needs to run in web browsers, on mobile devices, on desktops, or even on servers hosted on networks that you don’t control.  Obfuscation and other in-app protection techniques provide another layer of security in these situations.&lt;br /&gt;
In addition, attackers can use many different paths through your application to do harm to your business or organization. &lt;br /&gt;
&amp;lt;p&amp;gt;For a more comprehensive look at these attack vectors see: &lt;br /&gt;
* [https://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project/ OWASP Top 10 Application Security Risks] &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==What are some techniques used by a JavaScript Obfuscator and Protection Tool?==&lt;br /&gt;
* &amp;lt;b&amp;gt;Renaming&amp;lt;/b&amp;gt; changes the name of identifiers making them much harder for a human to read. The new names can follow different schemes like &amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;, &amp;quot;c&amp;quot;, or unprintable characters. Names may be used multiple times in a scope by using function overloading. Renaming is a basic technique used by almost every obfuscator. &lt;br /&gt;
* &amp;lt;b&amp;gt;Control Flow Obfuscation&amp;lt;/b&amp;gt;creates conditional, branching, and iterative constructs that produce valid executable logic, but are much harder for humans to understand.&lt;br /&gt;
* &amp;lt;b&amp;gt;String Encryption&amp;lt;/b&amp;gt; encodes string literals in the source code, and adds logic to decode them when needed. This removes clues that attackers and tools use to understand the code when performing static analysis.&lt;br /&gt;
* &amp;lt;b&amp;gt;Integer and Boolean Transformations&amp;lt;/b&amp;gt; transforms integer and Boolean literals into equivalent expressions that are harder to statically analyze and understand.&lt;br /&gt;
* &amp;lt;b&amp;gt;Dummy Code Insertion&amp;lt;/b&amp;gt; inserts code that does not affect the program’s logic, but makes the code much harder to analyze.&lt;br /&gt;
* &amp;lt;b&amp;gt;Debugger Removal&amp;lt;/b&amp;gt; removes key information from JavaScript making it harder for hackers to inspect.&lt;br /&gt;
* &amp;lt;b&amp;gt;PropertyIndirection&amp;lt;/b&amp;gt; changes direct property access to indirect property access making it harder to follow code execution. This also allows property names to be encoded.&lt;br /&gt;
* &amp;lt;b&amp;gt;DomainLock&amp;lt;/b&amp;gt; binds the code to a domain or subdomain. If the JavaScript is downloaded to the browser from a non-matching domain, it will break.&lt;br /&gt;
* &amp;lt;b&amp;gt;DateLock&amp;lt;/b&amp;gt; allows the code to only run in a certain date range. If the current date is not in that range the code will fail to execute properly. &lt;br /&gt;
* &amp;lt;b&amp;gt;Self-Defending Functions&amp;lt;/b&amp;gt; wraps code to observe if a function’s body has been altered in any way. If it has, then the code will fail to execute properly.&lt;br /&gt;
* &amp;lt;b&amp;gt;Debugger Detection&amp;lt;/b&amp;gt; prevents the code from running when a debugger is active. If the code detects that it is running inside a debugger, it will stop running.&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
* [https://blog.usejournal.com/javascript-web-application-security-guide-fdade350e373/ JavaScript Web Application Security Guide]&lt;br /&gt;
* [https://www.preemptive.com/blog/article/1146-no-beans-about-it-why-you-need-javascript-obfuscation/106-risk-management/ Why you need JavaScript Obfuscation to Manage Risk?]&lt;/div&gt;</summary>
		<author><name>Gtorok</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Bytecode_obfuscation&amp;diff=256229</id>
		<title>Bytecode obfuscation</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Bytecode_obfuscation&amp;diff=256229"/>
				<updated>2019-12-03T20:03:49Z</updated>
		
		<summary type="html">&lt;p&gt;Gtorok: Added Google's R8 tool&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Status==&lt;br /&gt;
Completely Updated: 7 March 2018&amp;lt;br&amp;gt;&lt;br /&gt;
Released: 14/1/2008&lt;br /&gt;
==Author==&lt;br /&gt;
Pierre Parrend&lt;br /&gt;
&lt;br /&gt;
== Principles ==&lt;br /&gt;
&lt;br /&gt;
Java source code is typically compiled into Java bytecode -- the instruction set of the Java virtual machine. The compiled Java bytecode can be easily reversed engineered back into source code by a freely available decompilers. &lt;br /&gt;
Bytecode Obfuscation is the process of modifying Java bytecode (executable or library) so that it is much harder to read and understand for a hacker but remains fully functional. Almost all code can be reverse-engineered with enough skill, time and effort. However, for some platforms such as Java, Android, or.NET, free decompilers can easily reverse-engineer source code from an executable or library with no real time or effort. &lt;br /&gt;
Automated bytecode obfuscation makes reverse-engineering a program difficult and economically unfeasible. Other advantages could include helping to protect licensing mechanisms and unauthorized access, hiding vulnerabilities and shrinking the size of the executable.&lt;br /&gt;
&lt;br /&gt;
=== How to recover Source Code from Bytecode? ===&lt;br /&gt;
There are a number of freely available Java decompilers that can recreate source code from Java bytecode (executables or libraries). Popular decompilers include:&lt;br /&gt;
* [https://bytecodeviewer.com Bytecode Viewer] - A Java 8 Jar &amp;amp; Android APK Reverse Engineering Suite (Decompiler, Editor, Debugger &amp;amp; More) &lt;br /&gt;
* [http://www.benf.org/other/cfr/ CFR] - Another Java decompiler&lt;br /&gt;
* [http://jd.benow.ca/ JDGui] - Yet another fast Java decompiler&lt;br /&gt;
* [https://github.com/fesh0r/fernflower Fernflower] - An analytical decompiler for Java&lt;br /&gt;
&lt;br /&gt;
=== How to help prevent Java source code from being Reverse-Engineered? ===&lt;br /&gt;
Java bytecode obfuscation consists of multiple complementary techniques that can help create a layered defense against reverse engineering and tampering. Some typical examples of obfuscation techniques include:&lt;br /&gt;
* &amp;lt;b&amp;gt;Renaming&amp;lt;/b&amp;gt; to alter the name of methods and variables to make the decompiled source much harder for a human to understand. &lt;br /&gt;
* &amp;lt;b&amp;gt;Control Flow Obfuscation&amp;lt;/b&amp;gt;creates conditional, branching, and iterative constructs that produce valid executable logic, but yield non-deterministic semantic results when decompiled.&lt;br /&gt;
* &amp;lt;b&amp;gt;String Encryption&amp;lt;/b&amp;gt; hides strings in the executable and only restores their original value when needed&lt;br /&gt;
* &amp;lt;b&amp;gt;Instruction Pattern Transformation&amp;lt;/b&amp;gt; converts common instructions to other, less obvious constructs potential confusing decompliers.&lt;br /&gt;
* &amp;lt;b&amp;gt;Dummy Code Insertion&amp;lt;/b&amp;gt; inserts code that does not affect the program’s logic, but breaks decompilers or makes reverse-engineered code harder to analyze.&lt;br /&gt;
* &amp;lt;b&amp;gt;Unused Code and Metadata Removal&amp;lt;/b&amp;gt; prunes out debug, non-essential metadata and used code from applications to reduce the information available to an attacker.&lt;br /&gt;
* &amp;lt;b&amp;gt;Class file encryption&amp;lt;/b&amp;gt; requires the JVM to decrypt the java executable before running confusing decompilers. Unlike some of the other transforms, this one is easy to circumvent by modifing the local JVM to simply write the executable to disk in its unencrypted form. See: [http://www.javaworld.com/javaworld/javaqa/2003-05/01-qa-0509-jcrypt.html?page=2 Javaworld article]).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What obfuscation tools are available? ===&lt;br /&gt;
You can find popular tools for Java bytecode obfuscation below, or simply type 'java obfuscator' in your favorite search engine. &lt;br /&gt;
* [https://sourceforge.net/projects/proguard/ ProGuard Java Optimizer] is a very popular open source Java class file shrinker, optimizer, obfuscator, and preverifier.&lt;br /&gt;
* [https://www.preemptive.com/products/dasho/overview DashO Android &amp;amp; Java Obfuscator] a Java, Kotlin and Android application hardening and obfuscation tool that provides passive and active protection.&lt;br /&gt;
* [http://www.zelix.com/klassmaster/ KlassMaster Heavy Duty Protection], shrinks and obfuscates both code and string constants. It can also translate stack traces back to readable form if you save the obfuscation log.&lt;br /&gt;
* [http://sourceforge.net/projects/javaguard/ Javaguard], a simple obfuscator without a lot of documentation.&lt;br /&gt;
* [https://discotek.ca/modifly.xhtml Modifly], a feature-rich byte code obfuscator capable of run-time transformations (never run the same byte code twice, yet each run is functionally equivalent).&lt;br /&gt;
&lt;br /&gt;
For Android also see:&lt;br /&gt;
* [https://r8-docs.preemptive.com/ Google's R8 code shrinker] Google intends R8 to be a drop-in replacement for ProGuard.  &lt;br /&gt;
&lt;br /&gt;
== Using Proguard ==&lt;br /&gt;
The following section provides a short tutorial for using [http://proguard.sourceforge.net/ Proguard].&lt;br /&gt;
First, download the code under [http://sourceforge.net/project/showfiles.php?group_id=54750 following url] and unzip it.&lt;br /&gt;
&lt;br /&gt;
For this tutorial, we use the [http://www.rzo.free.fr/applis/fr.inria.ares.sfelixutils-0.1.jar fr.inria.ares.sfelixutils-0.1.jar package].&lt;br /&gt;
&lt;br /&gt;
Go to the main directory of Proguard. To launch it, use following script and parameters:&lt;br /&gt;
&lt;br /&gt;
       java -jar lib/proguard.jar @config-genericFrame.pro&lt;br /&gt;
&lt;br /&gt;
config-genericFrame.pro is the option file&lt;br /&gt;
(do not forget to adapt the libraryjars parameter to your own system) :&lt;br /&gt;
&lt;br /&gt;
 -obfuscationdictionary ./examples/dictionaries/compact.txt&lt;br /&gt;
 -libraryjars /usr/java/j2sdk1.4.2_10/jre/lib/rt.jar&lt;br /&gt;
 -injars fr.inria.ares.sfelixutils-0.1.jar&lt;br /&gt;
 -outjar fr.inria.ares.sfelixutils-0.1-obs.jar&lt;br /&gt;
 -dontshrink&lt;br /&gt;
 -dontoptimize&lt;br /&gt;
 -keep public class proguard.ProGuard {&lt;br /&gt;
 public static void main(java.lang.String[]);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Remark that the 'keep' option is mandatory, we use this default class for not keep anything out.&lt;br /&gt;
&lt;br /&gt;
The example dictionary (here compact.txt) is given with the code.&lt;br /&gt;
&lt;br /&gt;
The output is stored in the package 'genericFrameOut.jar'.&lt;br /&gt;
&lt;br /&gt;
You can observe the modifications implied by obfuscation with following commands:&lt;br /&gt;
&lt;br /&gt;
 jar xvf genericFrameOut.jar&lt;br /&gt;
 cd genericFrame/pub/gui/&lt;br /&gt;
 jad c.class&lt;br /&gt;
 more c.jad more c.jad&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [https://www.guardsquare.com/en/proguard Proguard]&lt;br /&gt;
* [http://sourceforge.net/projects/javaguard/ Javaguard]&lt;br /&gt;
* [https://www.preemptive.com/obfuscation Elements of Java Obfuscation]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Obfuscation_(software) Software Obfuscation]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
[[Category:Control]]&lt;/div&gt;</summary>
		<author><name>Gtorok</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Reverse_Engineering_and_Code_Modification_Prevention_Project&amp;diff=254027</id>
		<title>OWASP Reverse Engineering and Code Modification Prevention Project</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Reverse_Engineering_and_Code_Modification_Prevention_Project&amp;diff=254027"/>
				<updated>2019-08-21T16:57:59Z</updated>
		
		<summary type="html">&lt;p&gt;Gtorok: /* News and Events */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Overview=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;height:160px;border:0,margin:0;overflow: hidden;&amp;quot;&amp;gt;[[File:OWASP_Project_Header.jpg|link=]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;padding: 0;margin:0;margin-top:10px;text-align:left;&amp;quot; |-&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
==Project Description==&lt;br /&gt;
&lt;br /&gt;
This project educates security professionals about the risks of reverse engineering and how to ensure that code cannot be reverse engineered or modified.  If you are placing sensitive code in an environment in which an attacker can get physical access to that environment (read: mobile, desktops, cloud, particular geographies), you should be concerned with the risks of reverse engineering or unauthorized code modification.  This umbrella project will help you understand the risks and how to mitigate them.&lt;br /&gt;
&lt;br /&gt;
==A Brief History of This Problem Space==&lt;br /&gt;
&lt;br /&gt;
Historically, organizations offered their customers web applications that exposed an interface to some necessary business services.  The services expose high-value functionality that allows an organization to deliver value to its clients.  Attackers had a specific set of threats or goals that they realized by exploiting vulnerabilities that the organization exposed through the application’s presentation layer.  Security practitioners address these specific sets of vulnerabilities through the web application or the associated infrastructure security disciplines.&lt;br /&gt;
&lt;br /&gt;
Most often, attackers successfully realized their threats by providing malicious input that they fed into the web application’s presentation layer.  Classic attack vectors used by attackers that use this technique include: SQL Injection, Cross-Site (XSS) Scripting, and URL parameter tampering vulnerabilities.  Often, security professionals detect the presence of these vulnerabilities through source code analysis or penetration testing.  In response to the detection, security professionals recommend to the organization that its Software Engineers should mitigate these vulnerabilities by applying secure coding techniques and adding appropriate data validation security controls to the affected application.  Generally, this is sage advice and it works well for traditional web-based applications.  In this common scenario, this advice is enforceable because the organization is hosting the web application in a highly controlled (more trustworthy) environment where only the organization’s Software Engineers can modify the application’s underlying code.&lt;br /&gt;
&lt;br /&gt;
In present day, consumers have demanded richer user experiences than what organizations could traditionally offer through web applications they exposed online.  In response to these demands, organizations began augmenting the user experience with mobile applications.  These applications offer genuinely quicker and richer user experiences than what users would otherwise get through traditional browser-based web applications.&lt;br /&gt;
&lt;br /&gt;
In making the switch to mobile applications, organizations are now deploying more of the presentation layer and business layer of the application on a phone instead of on their own servers.  As a result, they lose a lot more control over who gets to see or modify their application’s code.  Before the switch, most of the application’s presentation and business layer functionality was hidden within the organization’s trusted server environments.  Outside users or attackers did not get much of an opportunity to see executing code in action.&lt;br /&gt;
&lt;br /&gt;
With the recent move towards mobile applications, an attacker can now see, touch, and directly modify a lot of the application’s presentation and business layer code within the attacker’s mobile computing environment.  This capability allows the attacker to realize the same traditional business threats as before (with web applications) but in genuinely new and unconventional ways.&lt;br /&gt;
&lt;br /&gt;
==Licensing==&lt;br /&gt;
&lt;br /&gt;
Any documentation or educational material associated with this project is free to use. It is licensed under the http://creativecommons.org/licenses/by-sa/3.0/ Creative Commons Attribution-ShareAlike 3.0 license], so you can copy, distribute and transmit the work, and you can adapt it, and use it commercially, but all provided that you attribute the work and if you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;border-right: 1px dotted gray;padding-right:25px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== What does this project deliver? ==&lt;br /&gt;
&lt;br /&gt;
Prevent an attacker from reverse engineering your code or making unauthorized changes to that code.  The following audiences get something from this project:&lt;br /&gt;
&lt;br /&gt;
* ''Risk Specialists'' - Understand the business and technical risks that an attacker will deploy in order to reverse engineer or modify your code in unsafe environments;&lt;br /&gt;
&lt;br /&gt;
* ''Security Architects'' - Understand the architectural features that should be embedded into code to prevent an attacker from reverse engineering or modifying your code;&lt;br /&gt;
&lt;br /&gt;
* ''Penetration Testers'' - Learn how to conduct binary attacks against mobile apps understand threats that can be realized against various different platforms.  You'll have a better understanding of useful attack vectors to verify the strength of reverse engineering prevention or unauthorized code modification;&lt;br /&gt;
&lt;br /&gt;
* ''Software Engineers'' - Learn things that you can do to make reverse engineering as painful as possible for someone that is interested in reverse-engineering your code.  &lt;br /&gt;
&lt;br /&gt;
== Sub-projects ==&lt;br /&gt;
&lt;br /&gt;
''RISK'': [[Technical Risks of Reverse Engineering and Unauthorized Code Modification]]&lt;br /&gt;
&lt;br /&gt;
This sub-project helps organizations understand the various technical risks that they are exposed to when they host sensitive code in untrustworthy environments.  It is useful to stakeholders that must decide how/if to mitigate these risks.&lt;br /&gt;
&lt;br /&gt;
''ARCHITECTURE'': [[Architectural Principles That Prevent Code Modification or Reverse Engineering]]&lt;br /&gt;
&lt;br /&gt;
This sub-project helps security architects and designers understand the features of their application that should be included to prevent reverse engineering or code modification.&lt;br /&gt;
&lt;br /&gt;
== Related Projects ==&lt;br /&gt;
&lt;br /&gt;
This project is associated with&lt;br /&gt;
* [[OWASP_Mobile_Security_Project]]&lt;br /&gt;
* [[OWASP_AppSensor_Project]]&lt;br /&gt;
* [[OWASP_iMAS_iOS_Mobile_Application_Security_Project]]&lt;br /&gt;
* [[Mobile_Jailbreaking_Cheat_Sheet]]&lt;br /&gt;
&lt;br /&gt;
| valign=&amp;quot;top&amp;quot;  style=&amp;quot;padding-left:25px;width:200px;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
== Project Contributors ==&lt;br /&gt;
&lt;br /&gt;
* Jonathan Carter (Leader)&lt;br /&gt;
* Kajihara Masao (Project Contributor)&lt;br /&gt;
* Jim DelGrosso (Project Contributor)&lt;br /&gt;
* Chris Stahly (Project Contributor)&lt;br /&gt;
* Rennie Allen (Project Contributor)&lt;br /&gt;
&lt;br /&gt;
== Presentations ==&lt;br /&gt;
* [[Media:OWASP Mobile App Hacking (AppSecUSA 2015) Workshop Feedback.pdf]]&lt;br /&gt;
* [[Media:Consequences_of_a_Jailbroken_iDevice.pdf]]&lt;br /&gt;
* [[Media:Mobile Risks and Solutions.pdf]]&lt;br /&gt;
* [[Media:OWASP Mobile App Hacking (AppSecUSA 2014) Workshop Content.pdf]]&lt;br /&gt;
* [[Media:OWASP Mobile App Hacking (AppSecUSA 2014) Feedback.pdf]]&lt;br /&gt;
&lt;br /&gt;
== News and Events ==&lt;br /&gt;
* [Sept 2019] - Global AppSec DC 2019&lt;br /&gt;
* [May 2015] - AppSecEU Workshop 2015 conducted&lt;br /&gt;
* [May 2015] - Oracle Webinar on Project Conducted&lt;br /&gt;
* [September 2014] - AppSec USA Workshop 2014 conducted&lt;br /&gt;
* [April 2014] - Architectural Principles content finalized and released&lt;br /&gt;
* [March 2014] - Technical Risks content translated into Japanese&lt;br /&gt;
* [January 2014] - Technical Risks content finalized and released&lt;br /&gt;
* [December 2013] - Establishment of project wiki&lt;br /&gt;
&lt;br /&gt;
==Classifications==&lt;br /&gt;
&lt;br /&gt;
   {| width=&amp;quot;200&amp;quot; cellpadding=&amp;quot;2&amp;quot;&lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot; rowspan=&amp;quot;2&amp;quot;| [[File:Owasp-incubator-trans-85.png|link=https://www.owasp.org/index.php/OWASP_Project_Stages#tab=Incubator_Projects]]&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-builders-small.png|link=]]  &lt;br /&gt;
   |-&lt;br /&gt;
   | align=&amp;quot;center&amp;quot; valign=&amp;quot;top&amp;quot; width=&amp;quot;50%&amp;quot;| [[File:Owasp-defenders-small.png|link=]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Cc-button-y-sa-small.png|link=http://creativecommons.org/licenses/by-sa/3.0/]]&lt;br /&gt;
   |-&lt;br /&gt;
   | colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;  | [[File:Project_Type_Files_DOC.jpg|link=]]&lt;br /&gt;
   |}&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=FAQs=&lt;br /&gt;
&lt;br /&gt;
; Is there anything that an organization can really do to prevent someone from modifying their code if the attacker has physical access to the code?&lt;br /&gt;
: Absolutely.  There are a lot of things that Software Engineers can do to prevent an attacker from understanding or modifying their code.&lt;br /&gt;
&lt;br /&gt;
; Is this really a frequently occurring problem?&lt;br /&gt;
: Yes, this is a huge problem that many different business verticals have had to deal with over time.  It's just now starting to hit the web and mobile development communities.&lt;br /&gt;
&lt;br /&gt;
= Road Map and Getting Involved =&lt;br /&gt;
&lt;br /&gt;
=Project About=&lt;br /&gt;
{{:Projects/OWASP_Reverse_Engineering_and_Code_Modification_Prevention_Project}}  &lt;br /&gt;
&lt;br /&gt;
__NOTOC__ &amp;lt;headertabs /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP Project]]  [[Category:OWASP_Builders]] [[Category:OWASP_Defenders]]  [[Category:OWASP_Document]]&lt;/div&gt;</summary>
		<author><name>Gtorok</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Application_Hardening_and_Shielding&amp;diff=242191</id>
		<title>Application Hardening and Shielding</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Application_Hardening_and_Shielding&amp;diff=242191"/>
				<updated>2018-07-31T17:11:49Z</updated>
		
		<summary type="html">&lt;p&gt;Gtorok: Added NIST publications to regulations list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Application Hardening and Shielding&lt;br /&gt;
&lt;br /&gt;
== App Hardening and Shielding ==&lt;br /&gt;
A set of technologies that typically modify an application’s binary code to make it more resistant to reverse-engineering, tampering, invasive monitoring and intrusion. Enterprises harden their applications to protect their software assets and the data touched by the application.&lt;br /&gt;
== Risks ==&lt;br /&gt;
For applications that contain unique IP or process sensitive data or functionality, the potential risks of NOT applying some form of hardening and/or shielding may include:&lt;br /&gt;
*Intellectual Property theft&lt;br /&gt;
*Piracy&lt;br /&gt;
*Vulnerability discovery&lt;br /&gt;
*Malware-based exploits&lt;br /&gt;
*Unauthorized data access and breaches &lt;br /&gt;
&lt;br /&gt;
== Regulations ==&lt;br /&gt;
The growing emphasis on application hardening and shielding as a required application security layer is fueling regulatory and statutory changes including (but not limited to)&lt;br /&gt;
*&amp;lt;b&amp;gt;2016: Defend Trade Secret Act and EU Directive 943:&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;These coordinated updates to trade secret theft protection are notable in that reverse engineering is explicitly excluded from the definition of misappropriation (theft) – meaning that courts will not consider IP made accessible via reverse-engineering to be treated as a “secret” – and, as such, that IP could not be protected under these laws. This legislation created an entire new set of obfuscation use cases.&lt;br /&gt;
*&amp;lt;b&amp;gt;2017: DFARS and PCI Mobile:&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;In each of these two very different control frameworks, Least Privilege risk mitigation controls were updated to require active anti-debug &amp;amp; anti-root/jailbreak controls. &lt;br /&gt;
*&amp;lt;b&amp;gt;2017: 2018 PCI PIN Entry and GDPR:&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt; Both transactional security and personal privacy standards declare code security and data protection to be inseparable – security by design and by default. &lt;br /&gt;
*&amp;lt;b&amp;gt;2018: NIST:&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt; National Institute of Standards and Technology publications include increasingly prescriptive obligations for application developers around data security.&lt;br /&gt;
&lt;br /&gt;
== Industry Consensus ==&lt;br /&gt;
One hundred percent industry consensus around application protection and security is impossible to achieve. However, OWASP is trying to create quality go-to guidelines.  It recently released new protection guidelines around how mobile apps handle, store and protect sensitive information. For example, the&lt;br /&gt;
[https://www.owasp.org/images/6/61/MASVS_v0.9.4.pdf OWASP Mobile Application Security Verification Standard] under section V8: Resiliency Against Reverse Engineering Requirements among other things recommends that apps:&lt;br /&gt;
* Detect and respond to the presence of a jailbroken device&lt;br /&gt;
* Prevent or detect debugging attempts&lt;br /&gt;
* Include multiple defense mechanisms&lt;br /&gt;
* Leverage obfuscation and encryption&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
App hardening and shielding along with layered security measures are recognized as a critical component of overall IT compliance. Be familiar with applicable standards and regulations; and implement app development best practices to enhance security for all your apps that process or give access to sensitive data or functionality. &lt;br /&gt;
And, perhaps an obvious confirmation, but application hardening is meant to complement, not replace other security controls. See the [https://www.owasp.org/index.php/OWASP_Mobile_Security_Testing_Guide OWASP Mobile Security Testing Guide] for an comprehensive information on mobile application security.  &lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
* [https://www.pcisecuritystandards.org/documents/PCI_Mobile_Payment_Acceptance_Security_Guidelines_for_Developers_v2_0.pdf PCI Mobile Payment Acceptance Security Guidelines for Developers]&lt;br /&gt;
* [https://gdpr-info.eu/art-25-gdpr/ GDPR - Data protection by design and by default]&lt;br /&gt;
* [https://www.congress.gov/bill/114th-congress/senate-bill/1890/text Defend Trade Secrets Act of 2016]&lt;br /&gt;
* [https://www.gartner.com/smarterwithgartner/five-mobile-app-security-techniques-hackers-dont-want-you-to-use/ Five Mobile App Security Techniques Hackers Don’t Want You to Use]&lt;br /&gt;
* [https://www.preemptive.com/blog/article/986-technology-trust-issues-when-running-in-untrusted-environments-try-application-shielding/102-mobile-protection Article:Technology Trust Issues When Running in UNTRUSTED Environments? Try Application Shielding]&lt;br /&gt;
* [https://dzone.com/articles/what-approach-to-application-hardening-is-right-fo Article:What Approach to Application Hardening is Right For You?]&lt;br /&gt;
* [https://www.preemptive.com/blog/article/1046-latest-nist-publications-reinforce-development-obligations-in-securing-data/106-risk-management Article:NIST Publications reinforce the importance of application hardening in securing data]&lt;/div&gt;</summary>
		<author><name>Gtorok</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=.NET_Obfuscation&amp;diff=242190</id>
		<title>.NET Obfuscation</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=.NET_Obfuscation&amp;diff=242190"/>
				<updated>2018-07-31T16:59:36Z</updated>
		
		<summary type="html">&lt;p&gt;Gtorok: Created complementary page for .NET (IL) vs. Java (Bytecode) Obfuscation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== What is .NET? ==&lt;br /&gt;
.NET is a free, cross-platform, open source developer platform for building many different types of applications. With .NET, you can use multiple languages, editors, and libraries to build for web, mobile, desktop, gaming, and IoT.&lt;br /&gt;
&lt;br /&gt;
== What are .NET Assemblies? ==&lt;br /&gt;
A .NET project generates assemblies (usual executables) that contains Intermediate Language (IL) instructions, managed resources and metadata describing the types, methods, properties, fields and events. The metadata and IL instructions maintain high-level information about your code including its structure and class, field, method, property and parameter names. This makes it possible to understand the assembly structure and the method instructions in order to easily decompile the assembly back to high-level source code. &lt;br /&gt;
&lt;br /&gt;
== Why might I want to obfuscate .NET Assemblies / Executables? ==&lt;br /&gt;
An attacker could easily reverse engineer and/or debug a .NET program to understand how it was implemented, which would allow them to easily copy the functionality, or manipulate / steal sensitive information or algorithms. Obfuscating the application before releasing it modifies the executable so that it is difficult to reverse engineer or probe by a hacker. While obfuscation may change metadata or the actual method instructions, it does not alter the logic flow or the output of the program.&lt;br /&gt;
&lt;br /&gt;
==What are some techniques used by an Obfuscator?==&lt;br /&gt;
* &amp;lt;b&amp;gt;Renaming&amp;lt;/b&amp;gt; to alter the name of methods and variables to make the decompiled source much harder for a human to understand. The new names can follow different schemes like &amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;, &amp;quot;c&amp;quot;, or numbers, characters from non-Latin scripts, unprintable characters or invisible characters. Names may be used multiple times in a scope by using method overloading. Name obfuscation is the most basic technique that is used by every .NET obfuscator solution. Microsoft’s Visual Studio includes a basic [https://docs.microsoft.com/en-us/visualstudio/ide/dotfuscator/ .NET Obfuscator] by default which performs renaming.&lt;br /&gt;
* &amp;lt;b&amp;gt;Control Flow Obfuscation&amp;lt;/b&amp;gt;creates conditional, branching, and iterative constructs that produce valid executable logic, but yield non-deterministic semantic results when decompiled.&lt;br /&gt;
* &amp;lt;b&amp;gt;String Encryption&amp;lt;/b&amp;gt; hides strings in the executable and only restores their original value when needed. Since the string data must be restored automatically at runtime, a hacker could execute the application in a debugger to capture the string values.&lt;br /&gt;
* &amp;lt;b&amp;gt;Instruction Pattern Transformation&amp;lt;/b&amp;gt; converts common instructions to other, less obvious constructs potential confusing decompliers.&lt;br /&gt;
* &amp;lt;b&amp;gt;Dummy Code Insertion&amp;lt;/b&amp;gt; inserts code that does not affect the program’s logic, but breaks decompilers or makes reverse-engineered code harder to analyze.&lt;br /&gt;
* &amp;lt;b&amp;gt;Unused Code and Metadata Removal&amp;lt;/b&amp;gt; prunes out debug, non-essential metadata and used code from applications to reduce the information available to an attacker.&lt;br /&gt;
&lt;br /&gt;
==Attack Detection Technologies==&lt;br /&gt;
While technically not obfuscation, App Hardening and Shielding tools typically have the ability to detect and respond to potential attacks on application code including tamper detection, debug detection, and jailbroken device detection making it harder for attackers to steal IP or gain access to sensitive data used by the application.&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
* [https://www.owasp.org/index.php/Application_Hardening_and_Shielding Application Hardening and Shielding]&lt;br /&gt;
* [https://www.owasp.org/index.php/Bytecode_obfuscation Java Bytecode Obfuscation]&lt;br /&gt;
* [https://blog.xamarin.com/protecting-xamarin-apps-dotfuscator/ Obfuscating Xamarin Apps]&lt;br /&gt;
* [https://github.com/MicrosoftDocs/visualstudio-docs/blob/master/docs/ide/dotfuscator/index.md  Microsoft’s Visual Studio &amp;amp; Dotfuscator Docs] &lt;/div&gt;</summary>
		<author><name>Gtorok</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_Application_Security_FAQ&amp;diff=242002</id>
		<title>OWASP Application Security FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_Application_Security_FAQ&amp;diff=242002"/>
				<updated>2018-07-19T17:49:35Z</updated>
		
		<summary type="html">&lt;p&gt;Gtorok: Added Application Hardening and Shielding explanation and internal OWASP link to misc. section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Login Issues  =&lt;br /&gt;
&lt;br /&gt;
==What are the best practices I should remember while designing the login pages?  ==&lt;br /&gt;
&lt;br /&gt;
* From the login page, the user should be sent to a page for authentication. Once authenticated, the user should be sent to the next page. This is explained in the answer to the next question. &lt;br /&gt;
* The password should never be sent in clear text (unencrypted) because it can be stolen by sniffing; saving the password in clear text in the database is dangerous too.&lt;br /&gt;
* The best way to manage sessions would be to use one session token with two values during authentication. One value before authentication and one after.&lt;br /&gt;
&lt;br /&gt;
==Is it really required to redirect the user to a new page after login?  ==&lt;br /&gt;
&lt;br /&gt;
Is it really required to redirect the user to a new page after login? &lt;br /&gt;
&lt;br /&gt;
Yes. Consider the application has a login page that sends the username and password as a POST request to the server. If a user clicks refresh on the second page (the page after login), the same request including the username and password in the POST will be sent again. Now suppose a valid user browses through our application and logs out, but does not close the window. The attackers come along and click the back button of the browser till they reach the second page. They only have to do a refresh and since the username and password are resubmitted and revalidated, the attackers can login as the user. Now let's assume the application has a login page which takes the user to an intermediate page for authentication. Once authenticated, the user is redirected to the second page with a session token. In this case, even if the attackers reach the second page and do a refresh, the username and password will not be resubmitted. This is so because the request that will be submitted is the one for the second page which does not contain the username and password. Therefore, it is always better to redirect the user. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How can my &amp;quot;Forgot Password&amp;quot; feature be exploited?  ==&lt;br /&gt;
&lt;br /&gt;
The Forgot Password feature is implemented in a number of different ways. One common way is to ask the user a hint question for which the user has submitted the answer during registration. These are questions like What is your favorite color? or What is your favorite pastime? If the answer is correct, either the original password is displayed or a temporary password is displayed which can be used to log in. In this method, an attacker trying to steal the password of a user may be able to guess the correct answer of the hint question and even reset the password. &lt;br /&gt;
&lt;br /&gt;
==In &amp;quot;Forgot Password&amp;quot;, is it safe to display the old password?  ==&lt;br /&gt;
&lt;br /&gt;
If the old password is displayed on the screen, it can be seen by shoulder surfers. So it is a good idea not to display the password and let the user change to a new one. Moreover, displaying the password means it has to be stored in a recoverable form in the database which is not a good practice. If the password is stored as a one way hash in the database, the only way Forgot Password can be implemented is by letting the user reset the old password. So, it is always better to force the users reset their passwords when they forget their passwords. (A one way hash is the result obtained when we pass a string to a one way hash function. The result is such that it is impossible to get back the original value from it. Passwords are best stored as non-recoverable hashes in the database.) &lt;br /&gt;
&lt;br /&gt;
==Is there any risk in emailing the new password to the user's authorized mail id?  ==&lt;br /&gt;
&lt;br /&gt;
Emailing the actual password in clear text can be risky as an attacker can obtain it by sniffing. Also the mail containing the password might have a long life time and could be viewed by an attacker while it is lying in the mailbox of the user.&lt;br /&gt;
&lt;br /&gt;
Apart form the above threats, a malicious user can do shoulder-surfing to view the password or login credentials.&lt;br /&gt;
&lt;br /&gt;
==What is the most secure way to design the Forgot Password feature?  ==&lt;br /&gt;
&lt;br /&gt;
We should first ask the user to supply some details like personal details or ask a hint question. Then we should send a mail to the users authorized mail id with a link which will take the user to a page for resetting the password. This link should be active for only a short time, and should be SSL- enabled. This way the actual password is never seen. The security benefits of this method are: the password is not sent in the mail; since the link is active for a short time, there is no harm even if the mail remains in the mailbox for a long time. &lt;br /&gt;
&lt;br /&gt;
==How do I protect against automated password guessing attacks?  ==&lt;br /&gt;
&lt;br /&gt;
Password guessing with automated tools is a serious problem since there are a number of tools available for this purpose. These tools essentially keep trying out different passwords till one matches. Locking out the account after 5 failed attempts is a good defense against these tools. However, the important point then is how long you lock out the account for. If it is for too long, service to valid users might be denied as the attackers repeatedly lock out your users. If the time is too short say about 1-2 minutes, the tool could start again after the timeout. So the best method would be to insist on human intervention after a few failed attempts. A method used by a number of sites these days is to have the user read and enter a random word that appears in an image on the page. Since this cannot be done by a tool, we can thwart automated password guessing. The following are some tools that guess passwords of web applications: Brutus - http://www.hoobie.net/brutus/ WebCracker http://www.securityfocus.com/tools/706&lt;br /&gt;
&lt;br /&gt;
==How can I protect against keystroke loggers on the client machine?  ==&lt;br /&gt;
&lt;br /&gt;
Keystroke loggers on the end users machines can sometimes ruin all our efforts of securely transmitting and storing the passwords. The users themselves may not be aware that a key logger has been installed on their machines and records each key pressed. Since the highest risk is with the password, if we can authenticate the users without having them use the keyboard, or reveal the entire password, we solve the problem. The different ways of doing this are: &lt;br /&gt;
&lt;br /&gt;
* Having a graphical keyboard where the users can enter the characters they want by clicking the mouse on it. This is especially useful for numeric PINs. &lt;br /&gt;
* Asking the users to type a part of their password each time and not the whole password. For example you could say &amp;quot;Please enter the 1st, 3rd and 6th letters of your password&amp;quot; and this rule could be a random one each time. &lt;br /&gt;
==My site will be used from publicly shared computers. What precautions must I take?  ==&lt;br /&gt;
&lt;br /&gt;
If the application will be accessed from publicly shared computers such as libraries, the following may protect its security.&lt;br /&gt;
&lt;br /&gt;
* Avoid caching the site's pages on the system by setting the correct cache control directives. &lt;br /&gt;
* Exclude sensitive information from the site's URLs since the history of the client browser will store these. &lt;br /&gt;
* Consider protecting user input against external recording via keyboard loggers or video cameras.  A graphical keyboard or prompts for a varying part of the password may help.&lt;br /&gt;
* Use TLS to prevent sniffing or modifying sensitive data in transit.&lt;br /&gt;
* Avoid weak hash algorithms in storing sensitive data by [[Password_Storage_Cheat_Sheet#Impose_infeasible_verification_on_attacker|making it harder to inverse the hash]].  The clear text password in the memory should be reset after computing the hash.&lt;br /&gt;
&lt;br /&gt;
=SQL Injection  =&lt;br /&gt;
&lt;br /&gt;
==What is SQL Injection?  ==&lt;br /&gt;
&lt;br /&gt;
SQL Injection is a technique by which attackers can execute SQL statements of their choice on the backend database by manipulating the input to the application. Let's understand SQL Injection through the example of a login page in a web application where the database is SQL Server. The user needs to input Username and Password in the text boxes in Login.asp page. Suppose the user enters the following: Username : Obelix and Password : Dogmatix This input is then used to build a query dynamically which would be something like: SELECT * FROM Users WHERE username= 'Obelix' and password='Dogmatix' This query would return to the application a row from the database with the given values. The user is considered authenticated if the database returns one or more rows to the application. Now, suppose an attacker enters the following input in the login page: Username : ' or 1=1-- The query built will look like this: SELECT * FROM Users WHERE username='' or 1=1-- and password='' -- in SQL Server is used to comment out the rest of the line. So, our query is now effectively: SELECT * FROM Users WHERE username='' or 1=1 This query will look in the database for a row where either username is blank or the condition 1=1 is met. Since the latter always evaluates to true, the query will return all rows of the Users table and the user is authenticated. The attacker has been successful in logging into the application without a username and password. You can read more on this at the Securiteam site: http://www.securiteam.com/securityreviews/5DP0N1P76E.html &lt;br /&gt;
&lt;br /&gt;
==Is it just ASP and SQL Server or are all platforms vulnerable?  ==&lt;br /&gt;
&lt;br /&gt;
Almost all platforms are vulnerable to SQL Injection. Inadequate checking of user input and the use of dynamic SQL queries are what make an application vulnerable to these attacks. The syntax of the input entered for SQL Injection will depend on the database being used. During our application security audits we have found many applications using other databases to be vulnerable. The above example would work on SQL Server, Oracle and MySQL. This shows that the problem is with the inadequate checking of user input and the use of dynamic SQL and not the underlying database. &lt;br /&gt;
&lt;br /&gt;
==Apart from username and password which variables are candidates for SQL Injection?  ==&lt;br /&gt;
&lt;br /&gt;
Any input field that makes up the where clause of a database query is a candidate for SQL Injection, eg. account numbers, and credit card numbers in the case of an online banking application. In addition to form fields, an attacker can use hidden fields and query strings also for injecting commands.&lt;br /&gt;
&lt;br /&gt;
Apart from input fields, URL parameters are also vulnerable to SQL Injection as well as other input based attacks.&lt;br /&gt;
&lt;br /&gt;
==How do we prevent SQL Injection in our applications?  ==&lt;br /&gt;
&lt;br /&gt;
It is quite simple to prevent SQL injection while developing the application. You need to check all input coming from the client before building a SQL query. The best method is to remove all unwanted input and accept only expected input. While server side input validation is the most effective method of preventing SQL Injection, the other method of prevention is not using dynamic SQL queries. This can be achieved by using stored procedures or bind variables in databases that support these features. For applications written in Java, CallableStatements and PreparedStatements can be used. For ASP applications, ADO Command Objects can be used. You can check the following article for more on SQL Injection in Oracle: http://www.integrigy.com/info/IntegrigyIntrotoSQLInjectionAttacks.pdf &lt;br /&gt;
&lt;br /&gt;
==I'm using stored procedures for authentication, am I vulnerable?  ==&lt;br /&gt;
&lt;br /&gt;
Maybe, but probably no. Using stored procedures can prevent SQL Injection because the user input is no longer used to build the query dynamically. Since a stored procedure is a group of precompiled SQL statements and the procedure accepts input as parameters, a dynamic query is avoided. Although input is put into the precompiled query as is, since the query itself is in a different format, it does not have the effect of changing the query as expected. By using stored procedures we are letting the database handle the execution of the query instead of asking it to execute a query we have built. The exception to this is where the stored procedure takes a string as input and uses this string to build the query without validating it. While this is more difficult to exploit, this scenario still often leads to successful SQL Injection. This article explains how SQL Injection affects stored procedures in more detail: http://palisade.plynt.com/issues/2006Jun/injection-stored-procedures/&lt;br /&gt;
&lt;br /&gt;
==I'm using client side JavaScript code for checking user input. Isn't that enough?  ==&lt;br /&gt;
&lt;br /&gt;
No. Although client side checking disallows the attacker to enter malicious data directly into the input fields, that alone is not enough to prevent SQL Injection. Client side scripts only check for input in the browser. But this does not guarantee that the information will remain the same till it reaches the server. To bypass client side JavaScript, the attacker can trap the request in a proxy (eg. WebScarab, [http://www.parosproxy.org Paros]) after it leaves the browser and before it reaches the server and there he can alter input fields. The attacker can also inject commands into the querystring variables which are not checked by the client side scripts, or could disable JavaScript rendering client-side scripting useless.&lt;br /&gt;
&lt;br /&gt;
==Are Java servlets vulnerable to SQL injection?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, they are if the user input is not checked properly, and if they build SQL queries dynamically. But Java servlets also have certain features that prevent SQL Injection like CallableStatements and PreparedStatements. Like stored procedures and bind variables, they avoid the need of dynamic SQL statements.&lt;br /&gt;
&lt;br /&gt;
==Can an automated scanner discover SQL Injection? ==&lt;br /&gt;
&lt;br /&gt;
Sometimes yes, sometimes no. Whether a scanner can discover SQL injection or not depends on a variety of factors: the discovery technique used, the response from the application when a malformed SQL snippet is added, and some luck. Specifically, scanners that use Blind SQL Injection are most likely to detect SQL Injection. Scanners that claim hundreds of test cases for SQL Injection are misleading. This entry from the [http://www.plynt.com/resources/learn/tools/do_scanners_catch_sql_injectio_1/  Penetration Testing Learning Center] explains this in detail.&lt;br /&gt;
&lt;br /&gt;
=Variable Manipulation  =&lt;br /&gt;
&lt;br /&gt;
==Why can't I trust the information coming from the browser?  ==&lt;br /&gt;
&lt;br /&gt;
There are chances that the information is modified before it reaches the server. Attackers browsing the site can manipulate the information in a GET or POST request. There are a number of HTTP/HTTPS proxy tools like [http://www.mavensecurity.com/achilles Achilles], Paros, WebScarab, etc which are capable of intercepting all this information and allow the attacker running the tool to modify it. Also, the information that the user sees or provides on a web page has to travel through the internet before it reaches the server. Although the client and the server may be trusted, we cannot be sure that the information is not modified after it leaves the browser. Attackers can capture the information on the way and manipulate it.&lt;br /&gt;
&lt;br /&gt;
==What information can be manipulated by the attacker?  ==&lt;br /&gt;
&lt;br /&gt;
Manipulating the variables in the URL is simple. But attackers can also manipulate almost all information going from the client to the server like form fields, hidden fields, content-length, session-id and http methods.&lt;br /&gt;
&lt;br /&gt;
==How do attackers manipulate the information? What tools do they use?  ==&lt;br /&gt;
&lt;br /&gt;
For manipulating any information, including form fields, hidden variables and cookies, attackers use tools known as HTTP/HTTPS proxy tools. Once the browser's proxy settings are configured to go through the HTTP/HTTPS proxy, the tool can see all information flowing between the client and the server; it even allows the attacker to modify any part of the request before sending it. Some such tools are: WebScarab can be downloaded from the OWASP site. Odysseus can be found at http://www.bindshell.net/tools/odysseus Paros can be downloaded from http://www.parosproxy.org&lt;br /&gt;
&lt;br /&gt;
==I'm using SSL. Can attackers still modify information?  ==&lt;br /&gt;
&lt;br /&gt;
Although SSL provides a lot of security, SSL alone is not enough to prevent variable manipulation attacks. SSL was supposed to prevent against Man in the Middle attacks but it is vulnerable to it. To successfully carry out the MITM attack, first the attacker has to divert the victim's requests to his machine i.e. redirecting the packets meant for the server to himself. He can do this by ARP poisoning / DNS Cache poisoning. Once he is able to redirect, he can see all the requests the victim is trying to make. Now when the victim tries to establish an SSL connection with a legitimate server, he gets connected to the attacker. The attacker, during the SSL Handshaking, provides a fake certificate to the victim, which the victim accepts even though the browser warns him. Thus, the victim establishes an SSL connection with the attacker instead of the server. The attacker establishes a different SSL connection with that legitimate server, which the victim was trying to connect. Now all data flow between the victim and the server will be routed through the attacker and the attacker can see all data the victim (as well as the server) sends. This is because the victim will encrypt all data with the attacker's public key, which the attacker can decrypt with his private key. The attacker can then manipulate all data that is passing through his machine.&lt;br /&gt;
&lt;br /&gt;
==Is there some way to prevent these proxy tools from editing the data?  ==&lt;br /&gt;
&lt;br /&gt;
The main threat these proxy tools pose is editing the information sent from the client to the server. One way to prevent it is to sign the message sent from the client with a Java Applet downloaded onto the client machine. Since the applet we developed will be the one validating the certificate and not the browser, a proxy tool will not be able to get in between the client and the server with a fake certificate. The applet will reject the fake certificate. The public key of this certificate can then be used to digitally sign each message sent between the client and the server. An attacker would then have to replace the embedded certificate in the applet with a fake certificate to succeed - that raises the barrier for the attacker. &lt;br /&gt;
&lt;br /&gt;
=Browser Cache  =&lt;br /&gt;
&lt;br /&gt;
==How can the browser cache be used in attacks?  ==&lt;br /&gt;
&lt;br /&gt;
The browser has a capability to temporarily store some of the pages browsed. These cached files are stored in a folder, like the Temporary Internet Files folder in the case of Internet Explorer. When we ask for these pages again, the browser displays them from its cache. This is much faster than downloading the page from the server. Let's consider the particular scenario where a user has logged in to an application with username and password. The user browses the different pages which contain sensitive information. Let's suppose a page with the user's credit card information gets cached in the browser and the user logs out of the application. Now suppose the attackers access the same machine and searches through the Temporary Internet Files, they will get the credit card details. The attackers do not need to know the username and password of the user to steal the information. &lt;br /&gt;
&lt;br /&gt;
==How do I ensure that sensitive pages are not cached on the user's browser?  ==&lt;br /&gt;
&lt;br /&gt;
The response header sent from the server has some cache control directives that can be set from your code. These directives control the caching of content on any cache. The directives to be set are Cache-Control : no-cache, no-store and Expires: 0. But since legacy HTTP 1.0 servers do not support the Cache-Control headers, universally, Pragma: no-cache header should be used, too.&lt;br /&gt;
&lt;br /&gt;
==What's the difference between the cache-control directives: no-cache, and no-store?  ==&lt;br /&gt;
&lt;br /&gt;
The no-cache directive in a response indicates that the response must not be used to serve a subsequent request i.e. the cache must not display a response that has this directive set in the header but must let the server serve the request. The no-cache directive can include some field names; in which case the response can be shown from the cache except for the field names specified which should be served from the server. The no-store directive applies to the entire message and indicates that the cache must not store any part of the response or any request that asked for it. &lt;br /&gt;
&lt;br /&gt;
==Am I totally safe with these directives?  ==&lt;br /&gt;
&lt;br /&gt;
No. But generally, use both Cache-Control: no-cache, no-store and Pragma: no-cache, in addition to Expires: 0 (or a sufficiently backdated GMT date such as the UNIX epoch).  Non-html content types like pdf, word documents, excel spreadsheets, etc often get cached even when the above cache control directives are set (although this varies by version and additional use of must-revalidate, pre-check=0, post-check=0, max-age=0, and s-maxage=0 in practice can sometimes result at least in file deletion upon browser closure in some cases due to browser quirks and HTTP implementations). Also, 'Autocomplete' feature allows a browser to cache whatever the user types in an input field of a form. To check this, the form tag or the individual input tags should include 'Autocomplete=&amp;quot;Off&amp;quot; ' attribute. However, it should be noted that this attribute is non-standard (although it is supported by the major browsers) so it will break XHTML validation.&lt;br /&gt;
&lt;br /&gt;
==Where can I learn more about caching?  ==&lt;br /&gt;
&lt;br /&gt;
Some useful links that talk about caching are - Caching Tutorial for Web Authors and Webmasters by Mark Nottingham at http://www.mnot.net/cache_docs/ and HTTP RFC (sec14.9.1) at http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html&lt;br /&gt;
&lt;br /&gt;
=Cross Site Scripting  =&lt;br /&gt;
&lt;br /&gt;
==What is Cross Site Scripting?  ==&lt;br /&gt;
&lt;br /&gt;
Cross Site scripting (XSS) is a type of attack that can be carried out to steal sensitive information belonging to the users of a web site. This relies on the server reflecting back user input without checking for embedded javascript. This can be used to steal cookies and session IDs. Let's see how it works. We would all have come across the following situation sometime - we type a URL in the browser, say www.abcd.com/mypage.asp, and receive an error page that says &amp;quot;Sorry www.abcd.com/mypage.asp does not exist&amp;quot; or a page with a similar message. In other words, pages that display the user input back on the browser. Pages like this could be exploited using XSS. Instead of a normal input, think what will happen if the input contains a script in it. While reflecting back the input, instead of rendering it as normal HTML output, the browser treats it as a script and executes it. This script could contain some malicious code. The attackers can send a link that contains a script as part of the URL to a user. When the user clicks it, the script gets executed on the user's browser. This script may have been written to collect important information about the user and send it to the attacker. Kevin Spett's paper Cross Site Scripting, Are your web applications vulnerable? is a good source of information on this topic and is available at http://www.spidynamics.com/whitepapers/SPIcross-sitescripting.pdf The Cross Site Scripting FAQ at CGI Security is another good place to learn more on XSS. &lt;br /&gt;
&lt;br /&gt;
==What information can an attacker steal using XSS?  ==&lt;br /&gt;
&lt;br /&gt;
The attackers can steal the session ID of a valid user using XSS. The session ID is very valuable because it is the secret token that the user presents after login as proof of identity until logout. If the session ID is stored in a cookie, the attackers can write a script which will run on the user's browser, query the value in the cookie and send it to the attackers. The attackers can then use the valid session ID to browse the site without logging in. The script could also collect other information from the page, including the entire contents of the page. &lt;br /&gt;
&lt;br /&gt;
==Apart from mailing links of error pages, are there other methods of exploiting XSS?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, there are other methods. Let's take the example of a bulletin board application that has a page where data entered by one user can be viewed by other users. The attackers enter a script into this page. When a valid user tries to view the page, the script gets executed on the user's browser. It will send the user's information to the attackers. &lt;br /&gt;
&lt;br /&gt;
==How can I prevent XSS?  ==&lt;br /&gt;
&lt;br /&gt;
XSS can be prevented while coding the application. You should be validating all input and output to and from the application and escape all special characters that may be used in a script. If the code replaces the special characters by the following before displaying the output, XSS can be prevented to some extent.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;text-align:center;&amp;quot;| Special Character&lt;br /&gt;
! Escape Sequence&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;||&amp;amp;amp;lt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;gt;||&amp;amp;amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
|(||&amp;amp;amp;#40; &lt;br /&gt;
|-&lt;br /&gt;
|)||&amp;amp;amp;#41; &lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;#42;||&amp;amp;amp;#42; &lt;br /&gt;
|-&lt;br /&gt;
|&amp;amp;||&amp;amp;amp;amp;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Gunter Ollmann has written an excellent paper on the use of special characters in XSS attacks. For instance, the above technique of escaping special characters cannot protect against a script injected like &amp;quot;javascript:self.location.href = 'www.evil.org' &amp;quot; as this script does not use any of the special characters.&lt;br /&gt;
&lt;br /&gt;
==Can XSS be prevented without modifying the source code?  ==&lt;br /&gt;
&lt;br /&gt;
There is a method that requires minimal coding as compared to performing input, output validation to prevent the stealing of cookies by XSS. Internet Explorer 6 has an attribute called HTTP Only that can be set for cookies. Using this attribute makes sure that the cookie can not be accessed by any scripts. More details are available at the MSDN site on httpcookies at http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/httponly_cookies.asp Mozilla also has plans to implement a similar feature. Researchers have found a method to beat this. It is known as Cross Site Tracing. &lt;br /&gt;
&lt;br /&gt;
==What is Cross Site Tracing (XST)? How can it be prevented?  ==&lt;br /&gt;
&lt;br /&gt;
Attackers are able to bypass the HTTP Only attribute to steal cookie information by Cross Site tracing (XST). TRACE is a HTTP method that can be sent to the server. The server sends back anything included in the TRACE request back to the browser. In a site that uses cookies, the cookie information is sent to the server in each request. If we send a TRACE request in a URL of such a site, the server will send back all cookie information to the browser. Now imagine a situation similar to the one described in XSS but the site in this case is using the HTTP Only cookies. The attackers make a valid user click on a link that contains a script that calls the TRACE method. When the user clicks on the link the TRACE request as well as all the cookie information is sent to the server. The server then sends back the cookie information back to the script in the browser. Suppose that the malicious script also contains code to send this information to the attackers. The attackers have succeeded again in stealing the cookies although HTTP Only Cookies were used. To summarize, HTTP Only cookies prevent the JavaScript from directly accessing the cookies but the attacker was able to retrieve it through an indirect method. XST can be prevented by disabling the TRACE method on the web server. This paper by Jeremiah Grossman discusses XST in greater detail http://www.cgisecurity.com/whitehat-mirror/WhitePaper_screen.pdf &lt;br /&gt;
&lt;br /&gt;
=Web Server Fingerprinting  =&lt;br /&gt;
&lt;br /&gt;
==How do attackers identify which web server I'm using?  ==&lt;br /&gt;
&lt;br /&gt;
Identifying the application running on a remote web server is known as fingerprinting the server. The simplest way to do this is to send a request to the server and see the banner sent in the response. Banners will generally have the server name and the version number in it. We can address this problem by either configuring the server not to display the banner at all or by changing it to make the server look like something else.&lt;br /&gt;
&lt;br /&gt;
==How can I fake the banners or rewrite the headers from my web server?  ==&lt;br /&gt;
&lt;br /&gt;
There are a number of tools that help in faking the banners. URLScan is a tool that can change the banner of an IIS web server. http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/tools/URLScan.asp mod_security has a feature for changing the identity of the Apache web server. It can be found at http://www.modsecurity.org/ Servermask for faking banners of IIS, can be found at http://www.servermask.com/ &lt;br /&gt;
&lt;br /&gt;
==Once I fake the banners, can my web server still be fingerprinted?  ==&lt;br /&gt;
&lt;br /&gt;
Yes. Unfortunately there are tools that fingerprint the web server without relying on the banners. Different web servers may implement features not specified in HTTP RFCs differently. Suppose we make a database of these special requests and the responses of each web server. We can now send these requests to the web server we want to fingerprint and compare the responses with the database. This is the technique used by tools like Fire &amp;amp; Water. This tool can be found at http://www.ntobjectives.com/products/firewater/ There is a paper by Saumil Shah that discusses the tool httprint at http://net-square.com/httprint/httprint_paper.html httprint can be found at http://net-square.com/httprint/ &lt;br /&gt;
&lt;br /&gt;
==A friend told me it's safer to run my web server on a non-standard port. Is that right?  ==&lt;br /&gt;
&lt;br /&gt;
A web server generally needs to be accessed by a lot of people on the internet. Since it normally runs on port 80 and all browsers are configured to access port 80 of the web server, users are able to browse the site. If we change the port, the users will have to specify the port in addition to the domain name. But this is a good idea for an intranet application where all users know where to connect. It is more secure since the web server will not be targeted by automated attacks like worms that scan port 80 and other standard ports. &lt;br /&gt;
&lt;br /&gt;
==Should I really be concerned that my web server can be fingerprinted?  ==&lt;br /&gt;
&lt;br /&gt;
Well, there are two schools of thought here. According to the first school, yes you should take precaution against fingerprinting as correctly identiying the web server maybe the first step in a more dangerous attack. Once attackers have found out that the web server is say IIS 5, they will search for known vulnerabilities for IIS 5. If the web server is not patched for all known vulnerabilities or the attackers find one for which a patch has not been released yet, there is nothing to stop them from attacking it. Also automated tools and worms can be fooled by changing the version information. Some determined and focused attackers might go to additional lengths to identify the server but the hurdles that the attackers have to overcome have increased when it's more difficult to fingerprint the web server name and version. Jeremiah Grossman pointed out the other school of thought. Evasive measures are futile as any scanner targeting a web site, will normally not care what the web server is. The scanner will run ALL its tests no matter if they apply to the system or not. This is a typical shotgun approach. A bad guy targeting the site might be hampered by not knowing the exact version, but if he's determined he would still try out all related exploits and try to break in. &lt;br /&gt;
&lt;br /&gt;
=Testing  =&lt;br /&gt;
&lt;br /&gt;
==I want to chain my proxy tool with a proxy server; are there tools that let me do that?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, there are several tools that allow proxy chaining. Some of these are: WebScarab - http://www.owasp.org/development/webscarab Exodus - http://home.intekom.com/rdawes/exodus.html Odysseus - http://www.wastelands.gen.nz/odysseus/index.php &lt;br /&gt;
&lt;br /&gt;
==Can't web application testing be automated? Are there any tools for that?  ==&lt;br /&gt;
&lt;br /&gt;
There are tools that scan applications for security flaws. But these tools can only look for a limited number of vulnerabilities, and do not find all the problems in the application. Moreover, a lot of attacks require understanding of the business context of the application to decide on the variables to manipulate in a particular request, which a tool is incapable of doing. A presentation by Jeremiah Grossman of White Hat Security which talks about the [http://www.blackhat.com/presentations/bh-federal-03/bh-fed-03-grossman-up.pdf limitations of automated scanning]. &lt;br /&gt;
&lt;br /&gt;
This piece explains [http://www.plynt.com/resources/learn/tools/what_cant_a_scanner_find_1/ what a scanner can't find].&lt;br /&gt;
&lt;br /&gt;
In our tests using a slightly modified WebGoat the best Black-box scanning tool found less than 20% of the issues ! Some tools for automated scanning are: SpikeProxy, open source and freely available at http://www.immunitysec.com/spikeproxy.html WebInspect, can be found at http://www.spidynamics.com/productline/WE_over.html&lt;br /&gt;
&lt;br /&gt;
==Where can I try out my testing skills? Is there a sample application I can practice with?  ==&lt;br /&gt;
&lt;br /&gt;
OWASP provides a sample application that can be used for this purpose called . As the site says, the WebGoat project's goal is to teach web security in an interactive teaching environment. There are lessons on most of the common vulnerabilities. Another interesting site is Hackingzone which has a game on SQL Injection at http://www.hackingzone.org/sql/index.php &lt;br /&gt;
&lt;br /&gt;
==Are there source code scanning tools for .NET languages, Java, PHP etc that predict vulnerabilities in the source code?  ==&lt;br /&gt;
&lt;br /&gt;
Rough Auditing Tool for Security (RATS) is a tool that scans the source code for security flaws in C, C++, Python, Perl and PHP programs. It can be found at http://code.google.com/p/rough-auditing-tool-for-security/downloads/list FX Cop was created by the Microsoft Team at the GotDotNet community site to check for the .NET Frameowork guidelines which include security. Prexis is a commercial source code and run-time analyzer. Flawfinder is a static source code analyzer. Compaq ESC is a run-time analyzer for Java. Parasoft AEP is a commercial source code analyzer for Java. Fortify SCA from Fortify Software is another source code analyzer that supports mixed language analysis of C, C++, C#, ASP.NET, Java, JSP, PL/SQL, VB.NET, XML, etc. Secure Coding plugins are also available. Similar source code analyzers are Klocwork K7 for C, C++ and Java; Coverity Prevent for detecting security violations and defects in code; Ounce Solutions for C, C++, C#, ASP.NET, Java and JSP. We would like to know about more tools for scanning source code. If you know about any, please inform us and we'll add to this FAQ&lt;br /&gt;
&lt;br /&gt;
==Can non-HTTP protocols also be intercepted and played with like this?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, Interactive TCP Replay is a tool that acts as a proxy for non-HTTP applications and also allows modifying the traffic. It allows editing of the messages in a hex editor. ITR also logs all the messages passing between the client and the server. It can use different types of character encoding like ASCII or EBCDIC for editing and logging. More information on this can be found at http://www.webcohort.com/web_application_security/research/tools.html &lt;br /&gt;
&lt;br /&gt;
=Cryptography/SSL  =&lt;br /&gt;
&lt;br /&gt;
==What is SSL?  ==&lt;br /&gt;
&lt;br /&gt;
Secure Socket Layer (SSL) gives us assurance of two things. Firstly when a client connects to a web server, the client can be sure that it is talking to the right server by checking the certificate the server sends it. Secondly, SSL assures you of the confidentiality of the data, as the client and the server exchange encrypted messages that cannot be understood by anybody else. This is how SSL works: When the client requests for a SSL page, the server sends a certificate that it has obtained from a trusted certificate authority. This certificate contains the public key of the server. After satisfying itself that the certificate is correct and the server is a genuine one, the client generates one random number, the session key. This key is encrypted by the public key of the server and sent across. The server decrypts the message with its private key. Now both sides have a session key known only to the two of them. All communication to and fro is encrypted and decrypted with the session key. An interesting link on SSL is http://www.rsasecurity.com/standards/ssl/basics.html &lt;br /&gt;
&lt;br /&gt;
==Should I use 40-bit or 128-bit SSL?  ==&lt;br /&gt;
&lt;br /&gt;
There are 2 strengths in SSL - 40-bit and 128-bit. These refer to the length of the secret key used for encrypting the session. This key is generated for every SSL session and is used to encrypt the rest of the session. The longer the key the more difficult it is to break the encrypted data. So, 128-bit encryption is much more secure than 40-bit. Most browsers today support 128-bit encryption. There are a few countries which have browsers with only 40-bit support. In case you are using 40-bit SSL, you may need to take further precautions to protect sensitive data. Salted hash for transmitting passwords is a good technique. This ensures that the password can not be stolen even if the SSL key is broken. &lt;br /&gt;
&lt;br /&gt;
==Is 40-bit SSL really unsafe?  ==&lt;br /&gt;
&lt;br /&gt;
40-bit SSL is not really unsafe. It's just that it is computationally feasible to break the key used in 40-bit but not the key used in 128-bit. Even though 40-bit can be broken, it takes a fairly large number of computers to break it. Nobody would even attempt to do that for a credit card number or the like. But there are claims of breaking the 40-bit RC4 key in a few hours. So depending on the data your application deals with, you can decide on the SSL strength. Using 128-bit is definitely safer.&lt;br /&gt;
&lt;br /&gt;
With home computers gtting faster day by day, a dedicated, expensive and very fast computer can break 40-bit encryption in few minutes (ideally testing a million keys per second). On the other hand, 128-bit encryotion will have about 339,000,000,000,000,000,000,000,000,000,000,000 (Couple of Trillions or 2^128) possible key combinations and it will take around 1000 Years to break 128-bit encryptions with the help of a cluster of very fast computers.&lt;br /&gt;
&lt;br /&gt;
==What all are encrypted when I use SSL? Is the page request also encrypted?  ==&lt;br /&gt;
&lt;br /&gt;
After the initial SSL negotiation is done and the connection is on HTTPS, everything is encrypted including the page request. So any data sent in the query string will also be encrypted. &lt;br /&gt;
&lt;br /&gt;
==Which cryptographic algorithms do SSL use?  ==&lt;br /&gt;
&lt;br /&gt;
SSL supports a number of cryptographic algorithms. During the initial &amp;quot;handshaking&amp;quot; phase, it uses the RSA public key algorithm. For encrypting the data with the session key the following algorithms are used - RC2, RC4, IDEA, DES, triple-DES and MD5 message digest algorithm. &lt;br /&gt;
&lt;br /&gt;
==I want to use SSL. Where do I begin?  ==&lt;br /&gt;
&lt;br /&gt;
There are several Certificate Authorities that you can buy a SSL certificate from. Whichever CA you choose, the basic procedure will be as follows - &lt;br /&gt;
&lt;br /&gt;
* Create key pair for the server &lt;br /&gt;
* Create the Certificate Signing Request. This will require you to provide certain details like location and fully qualified domain name of the server. &lt;br /&gt;
* Submit the CSR to the CA along with documentary proof of identity. &lt;br /&gt;
* Install the certificate sent by the CA&lt;br /&gt;
The first two steps are done from the web server. All servers have these features. While installing the certificate issued by the CA, you will have to specify which web pages are to be on SSL.&lt;br /&gt;
&lt;br /&gt;
A good starting point for working on POC in a Windows development environment could be: &amp;quot;HOW TO: Secure XML Web Services with Secure Socket Layer in Windows 2000&amp;quot; - http://support.microsoft.com/default.aspx?scid=kb;en-us;q307267&amp;amp;sd=tech&lt;br /&gt;
&lt;br /&gt;
=Cookies and Session Management  =&lt;br /&gt;
&lt;br /&gt;
==Are there any risks in using persistent vs non-persistent cookies?  ==&lt;br /&gt;
&lt;br /&gt;
Persistent cookies are data that a web site places on the user's hard drive (or equivalent) for maintaining information over more than one browser session. This data will stay in the user's system and can be accessed by the site the next time the user browses the site. Non-persistent cookies on the other hand are those that are used only in the browser session that creates it. They stay only in the memory of the machine and are not persisted on the hard disk. The security risk with persistent cookies is that they are generally stored in a text file on the client and an attacker with access to the victim's machine can steal this information. &lt;br /&gt;
&lt;br /&gt;
==Can another web site steal the cookies that my site places on a user's machine?  ==&lt;br /&gt;
&lt;br /&gt;
No, it is not possible for a website to access another site's cookies. Cookies have a domain attribute associated with them. Only a request coming from the domain specified in the attribute can access the cookie. This attribute can have only one value. &lt;br /&gt;
&lt;br /&gt;
==Which is the best way to transmit session ids- in cookies, or URL or a hidden variable?  ==&lt;br /&gt;
&lt;br /&gt;
Transmitting session IDs in the URL can lead to several risks. Shoulder surfers can see the session ID; if the URL gets cached on the client system, the session ID will also be stored; the session ID will get stored in the referrer logs of other sites. Hidden variables are not always practical as every request might not be a POST. Cookies are the safest method as cookies do not get cached, are not visible in the W3C or referrer logs, and most users anyway accept cookies. &lt;br /&gt;
&lt;br /&gt;
==What are these secure cookies?  ==&lt;br /&gt;
&lt;br /&gt;
A cookie can be marked as &amp;quot;secure&amp;quot; which ensures the cookie is used only over SSL sessions. If &amp;quot;secure&amp;quot; is not specified, the cookie will be sent unencrypted over non-SSL channels. Sensitive cookies like session tokens should be marked as secure if all pages in the web site requiring session tokens are SSL-enabled. One thing to keep in mind here is that images are generally not downloaded over SSL and they usually don't require a session token to be presented. By setting the session cookie to be secure, we ensure that the browser does not send the cookie while downloading the image over the non-SSL connection.&amp;lt;&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==If I use a session ID that is a function of the client's IP address, will session hijacking be prevented?  ==&lt;br /&gt;
&lt;br /&gt;
An attacker can hijack another user's session by stealing the session token. Methods have been suggested to prevent the session from being hijacked even if the session token is stolen. For instance, using a session token that is a function of the user's IP address. In this approach, even if the attacker stole the token, he would need the same IP address as the user to successfully hijack a session. However, session hijacking can still be possible. Suppose the attacker is on the same LAN as the user and uses the same Proxy IP as the user to access the web site. The attacker can still steal the session if he is able to sniff the session token. It may also be not possible to implement this if the IP of the client changes during a session, making the session invalid if the token is tied to the initial IP address. This may happen if the client is coming from behind a bank of proxy servers. &lt;br /&gt;
&lt;br /&gt;
==How about encrypting the session id cookies instead of using SSL?  ==&lt;br /&gt;
&lt;br /&gt;
Encrypting just the session ID over a non-SSL connection will not serve any purpose. Since the session ID will be encrypted once and the same value will be sent back and forth each time, an attacker can use the encrypted value to hijack the session. &lt;br /&gt;
&lt;br /&gt;
==What is the concept of using a page id, in addition to the session id?  ==&lt;br /&gt;
&lt;br /&gt;
A Session ID or token has the lifetime of a session and is tied to the logged in user. A page ID or token has a lifetime of a page and is tied to a page that is served. It is a unique token given when a page is downloaded and is presented by the user when accessing the next page. The server expects a particular value for the user to access the next page. Only if the token submitted matches what the server is expecting is the next page served. An application can use this to ensure that a user accesses pages only in the sequence determined by the application. The user cannot paste a deep URL in the browser and skip pages just because he has a session token, as the page token would not be authorized to access the deeper URL directly. Good Read: [http://palisade.plynt.com/issues/2005Aug/page-tokens/ Secure your sessions with Page Tokens]&lt;br /&gt;
&lt;br /&gt;
=Logging and Audit Trails  =&lt;br /&gt;
&lt;br /&gt;
==What are these W3C logs?  ==&lt;br /&gt;
&lt;br /&gt;
W3C is a logging format used for Web server log files. W3C logs record access details of each request: the timestamp, source IP, page requested, the method used, http protocol version, browser type, the referrer page, the response code etc. Note that these are access logs, and so a separate record is maintained for each request. When a page with multiple gif files is downloaded, it would be recorded as multiple entries in the W3C log; so, W3C logs tend to be voluminous. &lt;br /&gt;
&lt;br /&gt;
==Do I need to have logging in my application even if I've W3C logs?  ==&lt;br /&gt;
&lt;br /&gt;
Yes, it's important that your application maintains &amp;quot;application level&amp;quot; logs even when W3C logging is used. As W3C logs contain records for every http request, it is difficult (and, at times impossible) to extract a higher level meaning from these logs. For instance, the W3C logs are cumbersome to identify a specific session of user and the activities that the user performed. It's better that the application keeps a trail of important activities, rather than decode it from W3C logs. &lt;br /&gt;
&lt;br /&gt;
==What should I log from within my application?  ==&lt;br /&gt;
&lt;br /&gt;
Keep an audit trail of activity that you might want to review while troubleshooting or conducting forensic analysis. Please note that it is inadvisable to keep sensitive business information itself in these logs, as administrators have access to these logs for troubleshooting. Activities commonly kept track of are: &lt;br /&gt;
&lt;br /&gt;
* Login and logout of users &lt;br /&gt;
* Critical transactions (eg. fund transfer across accounts) &lt;br /&gt;
* Failed login attempts &lt;br /&gt;
* Account lockouts &lt;br /&gt;
* Violation of policies &lt;br /&gt;
The data that is logged for each of these activities usually include: &lt;br /&gt;
&lt;br /&gt;
* User ID &lt;br /&gt;
* Time stamp &lt;br /&gt;
* Source IP &lt;br /&gt;
* Error codes, if any &lt;br /&gt;
* Priority &lt;br /&gt;
==Should I encrypt my logs? Isn't that a performance hit?  ==&lt;br /&gt;
&lt;br /&gt;
Encryption is required when information has to be protected from being read by unauthorized users. Yes, encryption does take a performance hit, so if your logs do not contain sensitive information you might want to forego encryption. However, we strongly urge that you protect your logs from being tampered by using digital signatures. Digital signatures are less processor intensive than encryption and ensure that your logs are not tampered. &lt;br /&gt;
&lt;br /&gt;
==Can I trust the IP address of a user I see in my audit logs? Could a user be spoofing/impersonating their IP address?  ==&lt;br /&gt;
&lt;br /&gt;
A bad guy who wants to hide his actual IP address might use a service like anonymizer, or use open HTTP relays. [HTTP open relays are improperly configured web servers on the web that are used as a HTTP proxy to connect to other sites.] In such cases, the IP address you see in your log files will be those of these services or the open relay that is being used. So, the IP address you see in your log files might not always be trustworthy. &lt;br /&gt;
&lt;br /&gt;
=Miscellaneous  =&lt;br /&gt;
&lt;br /&gt;
==What are Buffer Overflows? ==&lt;br /&gt;
&lt;br /&gt;
Buffer overflow vulnerability affects the web applications that require user input. The application stores the input in a buffer which is of a fixed size, as defined by the programmer. When the input that is sent to the application is more than the buffer capacity and the buffers are left unchecked, buffer overflow occurs. The severity depends on the user input. If a malicious code executes as a result of the overflow, it can even compromise the whole system.&lt;br /&gt;
To learn more, please read the OWASP article on [http://www.owasp.org/index.php/Buffer_Overflow buffer overflows.]&lt;br /&gt;
&lt;br /&gt;
==What are application firewalls? How good are they really?  ==&lt;br /&gt;
&lt;br /&gt;
Application firewalls analyze the requests at the application level. These firewalls are used for specific applications like a web server or a database server. The web application firewalls protect the web server from HTTP based attacks. They monitor the requests for attacks that involve SQL Injection, XSS, URL encoding etcetera. However, application layer firewalls cannot protect against attacks that require an understanding of the business context - this includes most attacks that rely on variable manipulation. Some application firewalls are: Netcontinuum's NC-1000 Kavado Inc.'s InterDo Teros Inc.'s Teros-100 APS&lt;br /&gt;
&lt;br /&gt;
==What is all this about &amp;quot;referrer logs&amp;quot;, and sensitive URLs?  ==&lt;br /&gt;
&lt;br /&gt;
The HTTP header contains a field known as Referrer. For visiting a web page we may either: &lt;br /&gt;
&lt;br /&gt;
* Type its URL directly into the address bar of the browser &lt;br /&gt;
* Click a link on some other page that brings us there &lt;br /&gt;
* Be redirected there by some page. &lt;br /&gt;
In the first case, the referrer field will be empty but in the other two cases it will contain the URL of the previous page. The URL of the first page will get stored in the web server access logs of the second page when the user reaches the second page from the first page. Now suppose, the two pages belong to different sites and the first URL contains sensitive information like a user's session ID. If the second site belongs to attackers, they can obtain this information by just going through the logs. Information in the URLs will get stored in the referrer logs as well as the history of the browser. Therefore, we should be careful not to have any sensitive information in the URL. &lt;br /&gt;
&lt;br /&gt;
==What is Application Hardening and Shielding?  ==&lt;br /&gt;
&lt;br /&gt;
Application Hardening and Shielding is a set of technologies that typically modify an application’s binary code to make it more resistant to reverse-engineering, tampering, invasive monitoring and intrusion. Enterprises harden their applications to protect their software assets and the data touched by the application. &lt;br /&gt;
&lt;br /&gt;
To learn more, please read the OWASP article on [http://www.owasp.org/index.php/Application_Hardening_and_Shielding App Hardening and Shielding].&lt;br /&gt;
&lt;br /&gt;
==I want to use the most secure language; which language do you recommend?  ==&lt;br /&gt;
&lt;br /&gt;
Any language can be used since secure programming practices are what make applications safe. Most security techniques can be implemented in any language. Our advice would be to use any language you are comfortable with. But some languages like Java have additional features like bind variables that aid security; you could use those additional features if you decide to program in that language. &lt;br /&gt;
&lt;br /&gt;
==What are the good books to learn secure programming practices?  ==&lt;br /&gt;
&lt;br /&gt;
The OWASP Guide to Building Secure Web Application and Web Services is a good guide for web application developers. You can download it from http://www.owasp.org/documentation/guide Writing Secure Code by Michael Howard and David LeBlanc has a chapter on Securing Web-Based Services. More information on this book can be found at: http://www.microsoft.com/mspress/books/toc/5612.asp Secure Programming for Linux and Unix HOWTO by David Wheeler talks about writing secure applications including web applications; it also specifies guidance for a number of languages. The book can be found at: http://www.dwheeler.com/secure-programs&lt;br /&gt;
&lt;br /&gt;
Another good book on application security, which also covers some web service specific topics: 19 Deadly Sins of Software Security, by: Michael Howard, David LeBlanc and John Viega (http://books.mcgraw-hill.com/getbook.php?isbn=0072260858).&lt;br /&gt;
&lt;br /&gt;
==Are there any training programs on secure programming that I can attend?  ==&lt;br /&gt;
&lt;br /&gt;
Microsoft offers training programs on Developing Security-Enhanced Web Applications and Developing and Deploying Secure Microsoft .NET Framework Application. More information can be found at http://www.microsoft.com/traincert/syllabi/2300AFinal.asp and http://www.microsoft.com/traincert/syllabi/2350BFinal.asp Foundstone offers secure coding training through Global Knowledge Aspect Security offers a similar course. &lt;br /&gt;
&lt;br /&gt;
OWASP_FAQ_Ver3.doc&lt;/div&gt;</summary>
		<author><name>Gtorok</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=PCI_DSS&amp;diff=241449</id>
		<title>PCI DSS</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=PCI_DSS&amp;diff=241449"/>
				<updated>2018-06-21T14:00:51Z</updated>
		
		<summary type="html">&lt;p&gt;Gtorok: Rewrote to make current with latest PCI security guidelines&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PCI DSS - Mobile Security Recommendations&lt;br /&gt;
== PCI Mobile Payment Acceptance Security Guidelines ==&lt;br /&gt;
The 2017 PCI Mobile Payment Acceptance Security Guidelines states, “Bypassing permissions can allow untrusted security decisions to be made, thus increasing the number of possible attack vectors.”&lt;br /&gt;
== Section 4.3 Prevent Escalation of Privileges ==&lt;br /&gt;
Controls should exist to prevent the escalation of privileges on the device (e.g., root or group privileges). Bypassing permissions can allow untrusted security decisions to be made, thus increasing the number of possible attack vectors. Therefore, the device should be monitored for activities that defeat operating system security controls—e.g., jailbreaking or rooting—and, when detected, the device should be quarantined by a solution that removes it from the network, removes the payment-acceptance application from the device, or disables the payment application. Offline jailbreak and root detection and auto quarantine are key since some attackers may attempt to put the device in an offline state to further circumvent detection. Hardening of the application is a method to that may help prevent escalation of privileges in a mobile device. Controls should include, but are not limited to: &lt;br /&gt;
*Providing the capability for the device to produce an alarm or warning if there is an attempt to root or jailbreak the device; &lt;br /&gt;
*Providing the capability within the payment-acceptance solution for identifying authorized objects and designing controls to limit access to only those objects&lt;br /&gt;
== Links ==&lt;br /&gt;
*[https://www.pcisecuritystandards.org/documents/PCI_Mobile_Payment_Acceptance_Security_Guidelines_for_Developers_v2_0.pdf PCI Mobile Payment Acceptance Security Guidelines for Developers • September 2017]&lt;br /&gt;
* [https://www.preemptive.com/blog/article/980-an-app-hardening-use-case-filling-the-pci-prescription-for-preventing-privilege-escalation-in-mobile-apps/106-risk-management Blog on Preventing Privilege Escalation in Mobile Payment Apps (PCI Mobile Payment Acceptance Security Guidelines Section 4.3)]&lt;br /&gt;
* [http://www.PCISecurityStandards.org PCISecurityStandards.org Website]&lt;/div&gt;</summary>
		<author><name>Gtorok</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=OWASP_.NET_Recommended_Resources&amp;diff=240642</id>
		<title>OWASP .NET Recommended Resources</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=OWASP_.NET_Recommended_Resources&amp;diff=240642"/>
				<updated>2018-05-11T12:39:18Z</updated>
		
		<summary type="html">&lt;p&gt;Gtorok: Added Resources&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| align=&amp;quot;right&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! OWASP .NET Quick Reference&lt;br /&gt;
|- &lt;br /&gt;
| &lt;br /&gt;
*[[OWASP Code Review Project]]&amp;lt;br /&amp;gt;&lt;br /&gt;
*[[OWASP Testing Guide]]&amp;lt;br /&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
==OWASP .NET Recommended Resources==&lt;br /&gt;
&lt;br /&gt;
This is a canonical list of outside resources for .NET developers seeking security information.&lt;br /&gt;
&lt;br /&gt;
===Blogs &amp;amp; People===&lt;br /&gt;
&lt;br /&gt;
[http://securitybuddha.com/ Mark Curphrey's Blog]&lt;br /&gt;
&lt;br /&gt;
[http://blogs.msdn.com/michael_howard/default.aspx Michael Howard's Blog]&lt;br /&gt;
&lt;br /&gt;
[http://blogs.msdn.com/jmeier/archive/tags/Security/default.aspx J.D. Meier's Blog]&lt;br /&gt;
&lt;br /&gt;
[http://www.leastprivilege.com Dominick Baier's Blog]&lt;br /&gt;
&lt;br /&gt;
[http://blogs.msdn.com/shawnfa/default.aspx Shawn Farkas' Blog]&lt;br /&gt;
&lt;br /&gt;
[http://blogs.msdn.com/ace_team/ Microsoft's ACE Team]&lt;br /&gt;
&lt;br /&gt;
[http://www.troyhunt.com/ Troy Hunt's Blog]&lt;br /&gt;
&lt;br /&gt;
[https://www.preemptive.com/blog App Protection Blog]&lt;br /&gt;
&lt;br /&gt;
===Advisories, Articles &amp;amp; Projects===&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/ee658105.aspx Security and Operational Guidance for .NET Applications]&lt;br /&gt;
&lt;br /&gt;
[http://msdn2.microsoft.com/en-us/library/yedba920.aspx ASP.NET Security Architecture]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/ms998404.aspx patterns &amp;amp; practices Security Engineering Index]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/ms998408.aspx patterns &amp;amp; practices Security Guidance for Applications Index]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/ms954725.aspx patterns &amp;amp; practices Security Guidance for .NET Framework 2.0]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/Ee817643(pandp.10).aspx Authentication in ASP.NET: .NET Security Guidance]&lt;br /&gt;
&lt;br /&gt;
[http://msdn2.microsoft.com/en-us/library/ms998404.aspx Security Engineering]&lt;br /&gt;
&lt;br /&gt;
[http://www.developer.com/design/article.php/3607471 Solutions to SOA Security]&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/WS-%2A Web Service Specifications]&lt;br /&gt;
&lt;br /&gt;
[http://wcfsecurityguide.codeplex.com/ Security Guidance for Windows Communication Foundation]&lt;br /&gt;
&lt;br /&gt;
[http://www.microsoft.com/technet/security/advisory/954462.mspx Microsoft Security Advisory (954462) (SQL Injection Advisory)]&lt;br /&gt;
&lt;br /&gt;
[https://www.microsoft.com/en-us/sdl Security Development Lifecycle]&lt;br /&gt;
&lt;br /&gt;
===Online References, Training===&lt;br /&gt;
&lt;br /&gt;
[http://msdn2.microsoft.com/en-us/practices/default.aspx Patterns and Practices]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/security/default.aspx MSDN Security Developer Center]&lt;br /&gt;
&lt;br /&gt;
[http://blogs.technet.com/feliciano_intini/pages/microsoft-blogs-and-web-resources-about-security.aspx Microsoft Security Resources]&lt;br /&gt;
&lt;br /&gt;
[http://pluralsight.com/training/Courses#security Pluralsight Security Course Catalog]&lt;br /&gt;
&lt;br /&gt;
[http://www.troyhunt.com/2010/05/owasp-top-10-for-net-developers-part-1.html OWASP Top 10 for .NET developers - Troy Hunt]&lt;br /&gt;
&lt;br /&gt;
[http://www.teammentor.net/teamMentor TeamMentor]&lt;br /&gt;
&lt;br /&gt;
[https://docs.microsoft.com/en-us/dotnet/standard/security/ Security in the .NET Framework]&lt;br /&gt;
&lt;br /&gt;
===Books and Publications===&lt;br /&gt;
&lt;br /&gt;
[http://www.microsoft.com/mspress/books/5957.aspx Writing Secure Code], Michael Howard and David LeBlanc&lt;br /&gt;
&lt;br /&gt;
[http://www.microsoft.com/downloads/details.aspx?familyid=2412c443-27f6-4aac-9883-f55ba5b01814&amp;amp;displaylang=en&amp;amp;Hash=4fZb2FzZ7%2bmaj0VqoUbFZzzw0WW5%2bxWjK3XBVit5eX%2b%2bB90vmLtZlAstlNg9cRu6Pg%2b50DNCMhGT6ADei7DgFg%3d%3d Microsoft Security Development Lifecycle 3.2]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/aa302415.aspx Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication], J.D. Meier, Alex Mackman, Michael Dunner, and Srinath Vasireddy&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/library/ms994921.aspx Improving Web Application Security: Threats and Countermeasures], J.D. Meier, Alex Mackman, Michael Dunner, Srinath Vasireddy, Ray Escamilla and Anandha Murukan&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-gb/security/aa473878.aspx Developer Highway Code], Microsoft Corp, United Kingdom&lt;br /&gt;
&lt;br /&gt;
[http://securitydriven.net/ Security Driven .NET], Stan Drapkin&lt;br /&gt;
&lt;br /&gt;
===Tools===&lt;br /&gt;
&lt;br /&gt;
[http://blogs.msdn.com/b/sdl/archive/2014/04/15/introducing-microsoft-threat-modeling-tool-2014.aspx Microsoft Threat Modeling Tool 2014]&lt;br /&gt;
&lt;br /&gt;
[http://msdn.microsoft.com/en-us/security/aa973814.aspx Anti-Cross Site Scripting]&lt;br /&gt;
&lt;br /&gt;
[http://learn.iis.net/page.aspx/473/using-urlscan URLScan]&lt;br /&gt;
&lt;br /&gt;
[http://support.microsoft.com/kb/954476 Microsoft Source Code Analyzer]&lt;br /&gt;
&lt;br /&gt;
[http://support.microsoft.com/kb/954476 MS Source Code Analyser for SQL Injection]&lt;br /&gt;
&lt;br /&gt;
[https://docs.microsoft.com/en-us/visualstudio/ide/dotfuscator/ Visual Studio .NET Obfuscator]&lt;/div&gt;</summary>
		<author><name>Gtorok</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Mobile_Top_10_2016-M2-Insecure_Data_Storage&amp;diff=240373</id>
		<title>Mobile Top 10 2016-M2-Insecure Data Storage</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Mobile_Top_10_2016-M2-Insecure_Data_Storage&amp;diff=240373"/>
				<updated>2018-05-02T17:06:59Z</updated>
		
		<summary type="html">&lt;p&gt;Gtorok: Added threat posed to an app's data running on a rooted or jailbroken device.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Mobile_Top_10_2016:TopTemplate&lt;br /&gt;
    |usenext=Mobile2016NextLink&lt;br /&gt;
    |next=M3-{{Mobile_Top_10_2016:ByTheNumbers&lt;br /&gt;
              |3&lt;br /&gt;
              |year=2016&lt;br /&gt;
              |language=en}}&lt;br /&gt;
    |useprev=Mobile2016PrevLink&lt;br /&gt;
    |prev=M1-{{Mobile_Top_10_2016:ByTheNumbers&lt;br /&gt;
              |1&lt;br /&gt;
              |year=2016&lt;br /&gt;
              |language=en}}&lt;br /&gt;
    |year=2016&lt;br /&gt;
    |language=en&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Mobile_Top_10_2016:SummaryTableHeaderBeginTemplate|year=2016|language=en}}&lt;br /&gt;
{{Mobile_Top_10:SummaryTableTemplate|exploitability=1|prevalence=2|detectability=2|impact=1|year=2016|language=en}}&lt;br /&gt;
{{Mobile_Top_10_2016:SummaryTableHeaderEndTemplate|year=2016}}&lt;br /&gt;
  &amp;lt;td {{Template:Mobile Top 10 2016:SummaryTableRowStyleTemplate|year=2016}}&amp;gt;Threats agents include the following: an adversary that has attained a lost/stolen mobile device; malware or another repackaged app acting on the adversary's behalf that executes on the mobile device.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td {{Template:Mobile Top 10 2016:SummaryTableRowStyleTemplate|year=2016}}&amp;gt;In the event that an adversary physically attains the mobile device, the adversary hooks up the mobile device to a computer with freely available software. These tools allow the adversary to see all third party application directories that often contain stored personally identifiable information (PII) or other sensitive information assets. An adversary may construct malware or modify a legitimate app to steal such information assets.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td colspan=2 {{Template:Mobile Top 10 2016:SummaryTableRowStyleTemplate|year=2016}}&amp;gt;Insecure data storage vulnerabilities occur when development teams assume that users or malware will not have access to a mobile device's filesystem and subsequent sensitive information in data-stores on the device. Filesystems are easily accessible. Organizations should expect a malicious user or malware to inspect sensitive data stores. Usage of poor encryption libraries is to be avoided. Rooting or jailbreaking a mobile device circumvents any encryption protections. When data is not protected properly, specialized tools are all that is needed to view application data.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td {{Template:Mobile Top 10 2016:SummaryTableRowStyleTemplate|year=2016}}&amp;gt;This can result in data loss, in the best case for one user, and in the worst case for many users. It may also result in the following technical impacts: extraction of the app's sensitive information via mobile malware, modified apps or forensic tools.&lt;br /&gt;
&lt;br /&gt;
The nature of the business impact is highly dependent upon the nature of the information stolen. Insecure data may result in the following business impacts:&lt;br /&gt;
&lt;br /&gt;
* Identity theft;&lt;br /&gt;
* Privacy violation;&lt;br /&gt;
* Fraud;&lt;br /&gt;
* Reputation damage;&lt;br /&gt;
* External policy violation (PCI); or&lt;br /&gt;
* Material loss.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
     &amp;lt;td {{Template:Mobile Top 10 2016:SummaryTableRowStyleTemplate|year=2016}}&amp;gt;Insecure data storage vulnerabilities typically lead to the following business risks for the organization that owns the risk app:&lt;br /&gt;
&lt;br /&gt;
* Identity Theft&lt;br /&gt;
* Fraud&lt;br /&gt;
* Reputation Damage&lt;br /&gt;
* External Policy Violation (PCI); or&lt;br /&gt;
* Material Loss.&lt;br /&gt;
     &lt;br /&gt;
&amp;lt;/td&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Mobile_Top_10:SubsectionTableBeginTemplate|type=main}} {{Mobile_Top_10_2016:SubsectionAdvancedTemplate|type={{Mobile_Top_10_2016:StyleTemplate}}|subsection=vulnerableTo|position=firstLeft|risk=2|year=2016|language=en}}&lt;br /&gt;
This category insecure data storage and unintended data leakage. Data stored insecurely includes, but is not limited to, the following:&lt;br /&gt;
&lt;br /&gt;
* SQL databases;&lt;br /&gt;
* Log files;&lt;br /&gt;
* XML data stores ou manifest files;&lt;br /&gt;
* Binary data stores;&lt;br /&gt;
* Cookie stores;&lt;br /&gt;
* SD card;&lt;br /&gt;
* Cloud synced.&lt;br /&gt;
&lt;br /&gt;
Unintended data leakage includes, but is not limited to, vulnerabilities from:&lt;br /&gt;
&lt;br /&gt;
* The OS;&lt;br /&gt;
* Frameworks;&lt;br /&gt;
* Compiler environment;&lt;br /&gt;
* New hardware.&lt;br /&gt;
* Rooted or Jailbroken devices&lt;br /&gt;
&lt;br /&gt;
This is obviously without a developer's knowledge. In mobile development specifically, this is most seen in undocumented, or under-documented, internal processes such as:&lt;br /&gt;
&lt;br /&gt;
* The way the OS caches data, images, key-presses, logging, and buffers;&lt;br /&gt;
* The way the development framework caches data, images, key-presses, logging, and buffers;&lt;br /&gt;
* The way or amount of data ad, analytic, social, or enablement frameworks cache data, images, key-presses, logging, and buffers.&lt;br /&gt;
&lt;br /&gt;
{{Mobile_Top_10_2016:SubsectionAdvancedTemplate|type={{Mobile_Top_10_2016:StyleTemplate}}|subsection=howPrevent|position=right|risk=2|year=2016|language=en}}&lt;br /&gt;
It is important to threat model your mobile app, OS, platforms and frameworks to understand the information assets the app processes and how the APIs handle those assets. It is crucial to see how they handle the following types of features :&lt;br /&gt;
&lt;br /&gt;
* URL caching (both request and response);&lt;br /&gt;
* Keyboard press caching;&lt;br /&gt;
* Copy/Paste buffer caching;&lt;br /&gt;
* Application backgrounding;&lt;br /&gt;
* Intermediate data&lt;br /&gt;
* Logging;&lt;br /&gt;
* HTML5 data storage;&lt;br /&gt;
* Browser cookie objects;&lt;br /&gt;
* Analytics data sent to 3rd parties.&lt;br /&gt;
&lt;br /&gt;
{{Mobile_Top_10_2016:SubsectionAdvancedTemplate|type={{Mobile_Top_10_2016:StyleTemplate}}|subsection=example|position=left|risk=2|year=2016|language=en}}&lt;br /&gt;
=== A Visual Example ===&lt;br /&gt;
&lt;br /&gt;
iGoat is a purposefully vulnerable mobile app for the security community to explore these types of vulnerabilities first hand. In the exercise below, we enter our credentials and log in to the fake bank app. Then, we navigate to the file system. Within the applications directory, we can see a database called “credentials.sqlite”. Exploring this database reveals that the application is storing our username and credentials (Jason:pleasedontstoremebro!) in plain text.&lt;br /&gt;
&lt;br /&gt;
[[Image:Screen%20Shot%202012-12-19%20at%206.34.23%20AM.png]] &lt;br /&gt;
[[Image:Screen%20Shot%202012-12-19%20at%206.44.51%20AM.png]] &lt;br /&gt;
[[Image:Screen%20Shot%202012-12-19%20at%2010.11.15%20AM.png]]&lt;br /&gt;
&lt;br /&gt;
{{Mobile_Top_10_2016:SubsectionAdvancedTemplate|type={{Mobile_Top_10_2016:StyleTemplate}}|subsection=references|position=right|risk=2|year=2016|language=en}}&lt;br /&gt;
{{Mobile_Top_10_2016:SubSubsectionOWASPReferencesTemplate}}&lt;br /&gt;
* [https://www.owasp.org/index.php/IOS_Developer_Cheat_Sheet OWASP ][https://www.owasp.org/index.php/IOS_Developer_Cheat_Sheet IOS Developer Cheat Sheet]&lt;br /&gt;
{{Mobile_Top_10_2016:SubSubsectionExternalReferencesTemplate}}&lt;br /&gt;
* [http://source.android.com/tech/security/ Google Androids Developer Security Topics 1]&lt;br /&gt;
* [http://developer.android.com/training/articles/security-tips.html Google Androids Developer Security Topics 2]&lt;br /&gt;
* [https://developer.apple.com/library/mac/ Apple's Introduction to Secure Coding]&lt;br /&gt;
* [http://h30499.www3.hp.com/t5/Application-Security-Fortify-on/Exploring-The-OWASP-Mobile-Top-10-M1-Insecure-Data-Storage/ba-p/5904609 Fortify On Demand Blog - Exploring The OWASP Mobile Top 10: Insecure Data Storage]&lt;/div&gt;</summary>
		<author><name>Gtorok</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Detect_integrity_violation_incidents_(code_modification_prevention)&amp;diff=239095</id>
		<title>Detect integrity violation incidents (code modification prevention)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Detect_integrity_violation_incidents_(code_modification_prevention)&amp;diff=239095"/>
				<updated>2018-03-28T18:59:26Z</updated>
		
		<summary type="html">&lt;p&gt;Gtorok: Added more information and a table to the context section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Principle}}&lt;br /&gt;
[[Category:OWASP Reverse Engineering and Code Modification Prevention Project]]&lt;br /&gt;
[[Category:Principle]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
= Context =&lt;br /&gt;
Mobile app developers must take into account a whole host of new risks that relate to hosting code in an uncontrolled environment. If you are hosting code in an untrustworthy environment, you are susceptible to the risk that an adversary will reverse engineer and modify your code via binary attacks &amp;lt;sup&amp;gt;&amp;amp;#91;[[#ReferenceItem1|1]]&amp;amp;#93;&amp;lt;/sup&amp;gt; &amp;lt;sup&amp;gt;&amp;amp;#91;[[#ReferenceItem2|2]]&amp;amp;#93;&amp;lt;/sup&amp;gt; &amp;lt;sup&amp;gt;&amp;amp;#91;[[#ReferenceItem3|3]]&amp;amp;#93;&amp;lt;/sup&amp;gt; &amp;lt;sup&amp;gt;&amp;amp;#91;[[#ReferenceItem4|4]]&amp;amp;#93;&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Whether a hacker is trying to pirate your app, steal your data, or alter the behavior of a critical piece of infrastructure software as part of a larger crime – inspecting and/or modifying an application can play an essential role. As part of a layered protection strategy, companies should have mechanisms in place that add anti-decompile, anti-debug, anti-tamper and anti-root controls directly into an application to protect, detect, and respond to attacks on the application's integrity.&lt;br /&gt;
Consider how reverse engineering and debugging application attacks can cross data, operational, and IP risk boundaries:&lt;br /&gt;
&amp;lt;table style=&amp;quot;width:100%&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Attack&amp;lt;/th&amp;gt;&lt;br /&gt;
    &amp;lt;th&amp;gt;Resulting Risk&amp;lt;/th&amp;gt; &lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Circumventing encryption used during data transmission or storage exposes otherwise secured data&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Unauthorized data access leads to data loss, loss of revenue, privacy breaches, regulatory non-compliance, and trade secret theft&amp;lt;/td&amp;gt; &lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Insert and modify data within your application&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Altering application to circumvent controls and voiding authorization and access controls to gain access to restricted information or gain additional access for free&amp;lt;/td&amp;gt; &lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;View critical function code, the values of dynamic keys and how sensitive information is saved to your file systems and databases&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Loss of highly sensitive data such as: digital keys, certificates, credentials, and proprietary algorithms&amp;lt;/td&amp;gt; &lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;Modify and release a copycat or malware infected version of your application&amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;A redistributed version of your application performs illicit actions that cause reputational damage and exposure&amp;lt;/td&amp;gt; &lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:MainProjectIcon.png|30px|link=https://www.owasp.org/index.php/OWASP_Reverse_Engineering_and_Code_Modification_Prevention_Project]] This content is part of a much bigger set of principles. See the [https://www.owasp.org/index.php/Architectural_Principles_That_Prevent_Code_Modification_or_Reverse_Engineering Architectural Principles That Prevent Code Modification or Reverse Engineering] project for more information.&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
Detecting integrity violation is important because otherwise the attacker has unlimited time to perfect an integrity attack. An integrity violation is defined as an insertion of code into the application.&lt;br /&gt;
As part of a layered protection strategy, companies should have mechanisms in place that add vulnerability masking, anti-debug and anti-tamper functionality directly into an application to protect, detect, and respond to attacks on the application's integrity.&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
For example, a Checksum control is responsible for detecting code changes between compile-time and runtime of the application. &lt;br /&gt;
&amp;lt;br&amp;gt;As another example, an anti-debug control is important not only because it is a hacker's tool of choice, but because it can be used to insert and modify data within your application.&amp;lt;sup&amp;gt;&amp;amp;#91;[[#ReferenceItem5|5]]&amp;amp;#93;&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= External References =&lt;br /&gt;
&amp;lt;span id=&amp;quot;ReferenceItem1&amp;quot;&amp;gt;[1] Arxan Research: [https://www.arxan.com/assets/1/7/State_of_Security_in_the_App_Economy_Report_Vol._2.pdf State of Security in the App Economy, Volume 2], November 2013:&lt;br /&gt;
:''“Adversaries have hacked 78 percent of the top 100 paid Android and iOS apps in 2013.”''&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;ReferenceItem2&amp;quot;&amp;gt;[2] HP Research: [http://www8.hp.com/us/en/hp-news/press-release.html?id=1528865#.UuwZFPZvDi5 HP Research Reveals Nine out of 10 Mobile Applications Vulnerable to Attack], 18 November 2013:&lt;br /&gt;
:''&amp;quot;86 percent of applications tested lacked binary hardening, leaving applications vulnerable to information disclosure, buffer overflows and poor performance. To ensure security throughout the life cycle of the application, it is essential to build in the best security practices from conception.&amp;quot;''&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;ReferenceItem3&amp;quot;&amp;gt;[3] North Carolina State University: [http://www.csc.ncsu.edu/faculty/jiang/pubs/OAKLAND12.pdf Dissecting Android Malware: Characterization and Evolution], 7 September 2011:&lt;br /&gt;
:''“Our results show that 86.0% of them (Android Malware) repackage legitimate apps to include malicious payloads; 36.7% contain platform-level exploits to escalate privilege; 93.0% exhibit the bot-like capability.”''&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;ReferenceItem4&amp;quot;&amp;gt;[4] InfoSecurity Magazine: [http://www.infosecurity-magazine.com/view/36376/two-thirds-of-personal-banking-apps-found-full-of-vulnerabilities/ Two Thirds of Personal Banking Apps Found Full of Vulnerabilities], January 3 2014:&lt;br /&gt;
:''“But one of his more worrying findings came from disassembling the apps themselves ... what he found was hardcoded development credentials within the code. An attacker could gain access to the development infrastructure of the bank and infest the application with malware causing a massive infection for all of the application’s users.”''&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;ReferenceItem5&amp;quot;&amp;gt;[5] PreEmptive and Deloitte Review: [https://www.preemptive.com/solutions/application-integrity-protection Application Integrity Protection], &lt;br /&gt;
:''“Whether a hacker is trying to pirate your app, steal your data, or alter the behavior of a critical piece of infrastructure software as part of a larger crime – inspecting and/or modifying an application can play an essential role...”''&amp;lt;/span&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gtorok</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Detect_integrity_violation_incidents_(code_modification_prevention)&amp;diff=239053</id>
		<title>Detect integrity violation incidents (code modification prevention)</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Detect_integrity_violation_incidents_(code_modification_prevention)&amp;diff=239053"/>
				<updated>2018-03-27T19:26:40Z</updated>
		
		<summary type="html">&lt;p&gt;Gtorok: Added another example and reference&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Principle}}&lt;br /&gt;
[[Category:OWASP Reverse Engineering and Code Modification Prevention Project]]&lt;br /&gt;
[[Category:Principle]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
= Context =&lt;br /&gt;
Mobile app developers must take into account a whole host of new risks that relate to hosting code in an uncontrolled environment. If you are hosting code in an untrustworthy environment, you are susceptible to the risk that an adversary will reverse engineer and modify your code via binary attacks &amp;lt;sup&amp;gt;&amp;amp;#91;[[#ReferenceItem1|1]]&amp;amp;#93;&amp;lt;/sup&amp;gt; &amp;lt;sup&amp;gt;&amp;amp;#91;[[#ReferenceItem2|2]]&amp;amp;#93;&amp;lt;/sup&amp;gt; &amp;lt;sup&amp;gt;&amp;amp;#91;[[#ReferenceItem3|3]]&amp;amp;#93;&amp;lt;/sup&amp;gt; &amp;lt;sup&amp;gt;&amp;amp;#91;[[#ReferenceItem4|4]]&amp;amp;#93;&amp;lt;/sup&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
[[File:MainProjectIcon.png|30px|link=https://www.owasp.org/index.php/OWASP_Reverse_Engineering_and_Code_Modification_Prevention_Project]] This content is part of a much bigger set of principles defined within the [https://www.owasp.org/index.php/Architectural_Principles_That_Prevent_Code_Modification_or_Reverse_Engineering Architectural Principles That Prevent Code Modification or Reverse Engineering] project.&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
Detecting integrity violation is important because otherwise the attacker has unlimited time to perfect an integrity attack. An integrity violation is defined as an insertion of code into the application.&lt;br /&gt;
As part of a layered protection strategy, companies should have mechanisms in place that add vulnerability masking, anti-debug and anti-tamper functionality directly into an application to protect, detect, and respond to attacks on the application's integrity.&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
For example, a Checksum control is responsible for detecting code changes between compile-time and runtime of the application. &lt;br /&gt;
&amp;lt;br&amp;gt;As another example, an anti-debug control is important not only because it is a hacker's tool of choice, but because it can be used to insert and modify data within your application.&amp;lt;sup&amp;gt;&amp;amp;#91;[[#ReferenceItem5|5]]&amp;amp;#93;&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= External References =&lt;br /&gt;
&amp;lt;span id=&amp;quot;ReferenceItem1&amp;quot;&amp;gt;[1] Arxan Research: [https://www.arxan.com/assets/1/7/State_of_Security_in_the_App_Economy_Report_Vol._2.pdf State of Security in the App Economy, Volume 2], November 2013:&lt;br /&gt;
:''“Adversaries have hacked 78 percent of the top 100 paid Android and iOS apps in 2013.”''&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;ReferenceItem2&amp;quot;&amp;gt;[2] HP Research: [http://www8.hp.com/us/en/hp-news/press-release.html?id=1528865#.UuwZFPZvDi5 HP Research Reveals Nine out of 10 Mobile Applications Vulnerable to Attack], 18 November 2013:&lt;br /&gt;
:''&amp;quot;86 percent of applications tested lacked binary hardening, leaving applications vulnerable to information disclosure, buffer overflows and poor performance. To ensure security throughout the life cycle of the application, it is essential to build in the best security practices from conception.&amp;quot;''&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;ReferenceItem3&amp;quot;&amp;gt;[3] North Carolina State University: [http://www.csc.ncsu.edu/faculty/jiang/pubs/OAKLAND12.pdf Dissecting Android Malware: Characterization and Evolution], 7 September 2011:&lt;br /&gt;
:''“Our results show that 86.0% of them (Android Malware) repackage legitimate apps to include malicious payloads; 36.7% contain platform-level exploits to escalate privilege; 93.0% exhibit the bot-like capability.”''&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;ReferenceItem4&amp;quot;&amp;gt;[4] InfoSecurity Magazine: [http://www.infosecurity-magazine.com/view/36376/two-thirds-of-personal-banking-apps-found-full-of-vulnerabilities/ Two Thirds of Personal Banking Apps Found Full of Vulnerabilities], January 3 2014:&lt;br /&gt;
:''“But one of his more worrying findings came from disassembling the apps themselves ... what he found was hardcoded development credentials within the code. An attacker could gain access to the development infrastructure of the bank and infest the application with malware causing a massive infection for all of the application’s users.”''&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;ReferenceItem5&amp;quot;&amp;gt;[5] PreEmptive and Deloitte Review: [https://www.preemptive.com/solutions/application-integrity-protection Application Integrity Protection], &lt;br /&gt;
:''“Whether a hacker is trying to pirate your app, steal your data, or alter the behavior of a critical piece of infrastructure software as part of a larger crime – inspecting and/or modifying an application can play an essential role...”''&amp;lt;/span&amp;gt;&lt;/div&gt;</summary>
		<author><name>Gtorok</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Application_Hardening_and_Shielding&amp;diff=238805</id>
		<title>Application Hardening and Shielding</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Application_Hardening_and_Shielding&amp;diff=238805"/>
				<updated>2018-03-21T19:43:31Z</updated>
		
		<summary type="html">&lt;p&gt;Gtorok: Combined definitions for app hardening and app sheilding&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Application Hardening and Shielding&lt;br /&gt;
&lt;br /&gt;
== App Hardening and Shielding ==&lt;br /&gt;
A set of technologies that typically modify an application’s binary code to make it more resistant to reverse-engineering, tampering, invasive monitoring and intrusion. Enterprises harden their applications to protect their software assets and the data touched by the application.&lt;br /&gt;
== Risks ==&lt;br /&gt;
For applications that contain unique IP or process sensitive data or functionality, the potential risks of NOT applying some form of hardening and/or shielding may include:&lt;br /&gt;
*Intellectual Property theft&lt;br /&gt;
*Piracy&lt;br /&gt;
*Vulnerability discovery&lt;br /&gt;
*Malware-based exploits&lt;br /&gt;
*Unauthorized data access and breaches &lt;br /&gt;
== Regulations ==&lt;br /&gt;
The growing emphasis on application hardening and shielding as a required application security layer is fueling regulatory and statutory changes including (but not limited to)&lt;br /&gt;
*&amp;lt;b&amp;gt;2016: Defend Trade Secret Act and EU Directive 943:&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;These coordinated updates to trade secret theft protection are notable in that reverse engineering is explicitly excluded from the definition of misappropriation (theft) – meaning that courts will not consider IP made accessible via reverse-engineering to be treated as a “secret” – and, as such, that IP could not be protected under these laws. This legislation created an entire new set of obfuscation use cases.&lt;br /&gt;
*&amp;lt;b&amp;gt;2017: DFARS and PCI Mobile:&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;In each of these two very different control frameworks, Least Privilege risk mitigation controls were updated to require active anti-debug &amp;amp; anti-root/jailbreak controls. &lt;br /&gt;
*&amp;lt;b&amp;gt;2017: 2018 PCI PIN Entry and GDPR:&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt; Both transactional security and personal privacy standards declare code security and data protection to be inseparable – security by design and by default. &lt;br /&gt;
== Industry Consensus ==&lt;br /&gt;
One hundred percent industry consensus around application protection and security is impossible to achieve. However, OWASP is trying to create quality go-to guidelines.  It recently released new protection guidelines around how mobile apps handle, store and protect sensitive information. For example, the&lt;br /&gt;
[https://www.owasp.org/images/6/61/MASVS_v0.9.4.pdf OWASP Mobile Application Security Verification Standard] under section V8: Resiliency Against Reverse Engineering Requirements among other things recommends that apps:&lt;br /&gt;
* Detect and respond to the presence of a jailbroken device&lt;br /&gt;
* Prevent or detect debugging attempts&lt;br /&gt;
* Include multiple defense mechanisms&lt;br /&gt;
* Leverage obfuscation and encryption&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
App hardening and shielding along with layered security measures are recognized as a critical component of overall IT compliance. Be familiar with applicable standards and regulations; and implement app development best practices to enhance security for all your apps that process or give access to sensitive data or functionality. &lt;br /&gt;
And, perhaps an obvious confirmation, but application hardening is meant to complement, not replace other security controls. See the [https://www.owasp.org/index.php/OWASP_Mobile_Security_Testing_Guide OWASP Mobile Security Testing Guide] for an comprehensive information on mobile application security.  &lt;br /&gt;
== Further Reading ==&lt;br /&gt;
* [https://www.pcisecuritystandards.org/documents/PCI_Mobile_Payment_Acceptance_Security_Guidelines_for_Developers_v2_0.pdf PCI Mobile Payment Acceptance Security Guidelines for Developers]&lt;br /&gt;
* [https://gdpr-info.eu/art-25-gdpr/ GDPR - Data protection by design and by default]&lt;br /&gt;
* [https://www.congress.gov/bill/114th-congress/senate-bill/1890/text Defend Trade Secrets Act of 2016]&lt;br /&gt;
* [https://www.gartner.com/smarterwithgartner/five-mobile-app-security-techniques-hackers-dont-want-you-to-use/ Five Mobile App Security Techniques Hackers Don’t Want You to Use]&lt;br /&gt;
* [https://dzone.com/articles/what-approach-to-application-hardening-is-right-fo Article:What Approach to Application Hardening is Right For You?]&lt;br /&gt;
* [https://www.preemptive.com/blog/article/986-technology-trust-issues-when-running-in-untrusted-environments-try-application-shielding/102-mobile-protection Article:Technology Trust Issues When Running in UNTRUSTED Environments? Try Application Shielding]&lt;/div&gt;</summary>
		<author><name>Gtorok</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Application_Hardening_and_Shielding&amp;diff=238632</id>
		<title>Application Hardening and Shielding</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Application_Hardening_and_Shielding&amp;diff=238632"/>
				<updated>2018-03-15T15:03:03Z</updated>
		
		<summary type="html">&lt;p&gt;Gtorok: Added an article on App Hardening and App Shielding&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Application Hardening and Shielding&lt;br /&gt;
== Application Hardening ==&lt;br /&gt;
Application hardening: a means of reducing risks stemming from reverse-engineering, tampering, and invasive monitoring. &lt;br /&gt;
== Application Shielding ==&lt;br /&gt;
Application shielding: a means to help prevent, detect and/or respond to potential or actual application-level intrusions.&lt;br /&gt;
== Risks ==&lt;br /&gt;
For applications that process or give access to sensitive data or functionality, the potential risks of NOT applying some form of hardening and/or shielding may include:&lt;br /&gt;
*Intellectual Property theft&lt;br /&gt;
*Piracy&lt;br /&gt;
*Vulnerability discovery&lt;br /&gt;
*Malware-based exploits&lt;br /&gt;
*Unauthorized data access and breaches. &lt;br /&gt;
== Regulations ==&lt;br /&gt;
The growing emphasis on application hardening and shielding as a required application security layer is fueling regulatory and statutory changes including (but not limited to)&lt;br /&gt;
*&amp;lt;b&amp;gt;2016: Defend Trade Secret Act and EU Directive 943:&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;These coordinated updates to trade secret theft protection are notable in that reverse engineering is explicitly excluded from the definition of misappropriation (theft) – meaning that courts will not consider IP made accessible via reverse-engineering to be treated as a “secret” – and, as such, that IP could not be protected under these laws. This legislation created an entire new set of obfuscation use cases.&lt;br /&gt;
*&amp;lt;b&amp;gt;2017: DFARS and PCI Mobile:&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;In each of these two very different control frameworks, Least Privilege risk mitigation controls were updated to require active anti-debug &amp;amp; anti-root/jailbreak controls. &lt;br /&gt;
*&amp;lt;b&amp;gt;2017: 2018 PCI PIN Entry and GDPR:&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt; Both transactional security and personal privacy standards declare code security and data protection to be inseparable – security by design and by default. &lt;br /&gt;
== Industry Consensus ==&lt;br /&gt;
One hundred percent industry consensus around application protection and security is impossible to achieve. However, OWASP is trying to create quality go-to guidelines.  It recently released new protection guidelines around how mobile apps handle, store and protect sensitive information. For example, the&lt;br /&gt;
[https://www.owasp.org/images/6/61/MASVS_v0.9.4.pdf OWASP Mobile Application Security Verification Standard] under section V8: Resiliency Against Reverse Engineering Requirements among other things recommends that apps:&lt;br /&gt;
* Detect and respond to the presence of a jailbroken device&lt;br /&gt;
* Prevent or detect debugging attempts&lt;br /&gt;
* Include multiple defense mechanisms&lt;br /&gt;
* Leverage obfuscation and encryption&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Application hardening along with layered security measures are recognized as a critical component of overall IT compliance. Be familiar with applicable standards and regulations; and implement app development best practices to enhance security for all your apps that process or give access to sensitive data or functionality. &lt;br /&gt;
And, perhaps an obvious confirmation, but application hardening is meant to complement, not replace other security controls. See the [https://www.owasp.org/index.php/OWASP_Mobile_Security_Testing_Guide OWASP Mobile Security Testing Guide] for an comprehensive information on mobile application security.  &lt;br /&gt;
== Further Reading ==&lt;br /&gt;
* [https://www.pcisecuritystandards.org/documents/PCI_Mobile_Payment_Acceptance_Security_Guidelines_for_Developers_v2_0.pdf PCI Mobile Payment Acceptance Security Guidelines for Developers]&lt;br /&gt;
* [https://gdpr-info.eu/art-25-gdpr/ GDPR - Data protection by design and by default]&lt;br /&gt;
* [https://www.congress.gov/bill/114th-congress/senate-bill/1890/text Defend Trade Secrets Act of 2016]&lt;br /&gt;
* [https://www.gartner.com/smarterwithgartner/five-mobile-app-security-techniques-hackers-dont-want-you-to-use/ Five Mobile App Security Techniques Hackers Don’t Want You to Use]&lt;br /&gt;
* [https://dzone.com/articles/what-approach-to-application-hardening-is-right-fo Article:What Approach to Application Hardening is Right For You?]&lt;br /&gt;
* [https://www.preemptive.com/blog/article/986-technology-trust-issues-when-running-in-untrusted-environments-try-application-shielding/102-mobile-protection Article:Technology Trust Issues When Running in UNTRUSTED Environments? Try Application Shielding]&lt;/div&gt;</summary>
		<author><name>Gtorok</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Application_Hardening_and_Shielding&amp;diff=238438</id>
		<title>Application Hardening and Shielding</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Application_Hardening_and_Shielding&amp;diff=238438"/>
				<updated>2018-03-08T21:44:55Z</updated>
		
		<summary type="html">&lt;p&gt;Gtorok: Initial creation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Application Hardening and Shielding&lt;br /&gt;
== Application Hardening ==&lt;br /&gt;
Application hardening: a means of reducing risks stemming from reverse-engineering, tampering, and invasive monitoring. &lt;br /&gt;
== Application Shielding ==&lt;br /&gt;
Application shielding: a means to help prevent, detect and/or respond to potential or actual application-level intrusions.&lt;br /&gt;
== Risks ==&lt;br /&gt;
For applications that process or give access to sensitive data or functionality, the potential risks of NOT applying some form of hardening and/or shielding may include:&lt;br /&gt;
*Intellectual Property theft&lt;br /&gt;
*Piracy&lt;br /&gt;
*Vulnerability discovery&lt;br /&gt;
*Malware-based exploits&lt;br /&gt;
*Unauthorized data access and breaches. &lt;br /&gt;
== Regulations ==&lt;br /&gt;
The growing emphasis on application hardening and shielding as a required application security layer is fueling regulatory and statutory changes including (but not limited to)&lt;br /&gt;
*&amp;lt;b&amp;gt;2016: Defend Trade Secret Act and EU Directive 943:&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;These coordinated updates to trade secret theft protection are notable in that reverse engineering is explicitly excluded from the definition of misappropriation (theft) – meaning that courts will not consider IP made accessible via reverse-engineering to be treated as a “secret” – and, as such, that IP could not be protected under these laws. This legislation created an entire new set of obfuscation use cases.&lt;br /&gt;
*&amp;lt;b&amp;gt;2017: DFARS and PCI Mobile:&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt;In each of these two very different control frameworks, Least Privilege risk mitigation controls were updated to require active anti-debug &amp;amp; anti-root/jailbreak controls. &lt;br /&gt;
*&amp;lt;b&amp;gt;2017: 2018 PCI PIN Entry and GDPR:&amp;lt;/b&amp;gt;&amp;lt;br&amp;gt; Both transactional security and personal privacy standards declare code security and data protection to be inseparable – security by design and by default. &lt;br /&gt;
== Industry Consensus ==&lt;br /&gt;
One hundred percent industry consensus around application protection and security is impossible to achieve. However, OWASP is trying to create quality go-to guidelines.  It recently released new protection guidelines around how mobile apps handle, store and protect sensitive information. For example, the&lt;br /&gt;
[https://www.owasp.org/images/6/61/MASVS_v0.9.4.pdf OWASP Mobile Application Security Verification Standard] under section V8: Resiliency Against Reverse Engineering Requirements among other things recommends that apps:&lt;br /&gt;
* Detect and respond to the presence of a jailbroken device&lt;br /&gt;
* Prevent or detect debugging attempts&lt;br /&gt;
* Include multiple defense mechanisms&lt;br /&gt;
* Leverage obfuscation and encryption&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
Application hardening along with layered security measures are recognized as a critical component of overall IT compliance. Be familiar with applicable standards and regulations; and implement app development best practices to enhance security for all your apps that process or give access to sensitive data or functionality. &lt;br /&gt;
And, perhaps an obvious confirmation, but application hardening is meant to complement, not replace other security controls. See the [https://www.owasp.org/index.php/OWASP_Mobile_Security_Testing_Guide OWASP Mobile Security Testing Guide] for an comprehensive information on mobile application security.  &lt;br /&gt;
== Further Reading ==&lt;br /&gt;
* [https://www.pcisecuritystandards.org/documents/PCI_Mobile_Payment_Acceptance_Security_Guidelines_for_Developers_v2_0.pdf PCI Mobile Payment Acceptance Security Guidelines for Developers]&lt;br /&gt;
* [https://gdpr-info.eu/art-25-gdpr/ GDPR - Data protection by design and by default]&lt;br /&gt;
* [https://www.congress.gov/bill/114th-congress/senate-bill/1890/text Defend Trade Secrets Act of 2016]&lt;br /&gt;
* [https://www.gartner.com/smarterwithgartner/five-mobile-app-security-techniques-hackers-dont-want-you-to-use/ Five Mobile App Security Techniques Hackers Don’t Want You to Use]&lt;/div&gt;</summary>
		<author><name>Gtorok</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Bytecode_obfuscation&amp;diff=238431</id>
		<title>Bytecode obfuscation</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Bytecode_obfuscation&amp;diff=238431"/>
				<updated>2018-03-08T14:06:18Z</updated>
		
		<summary type="html">&lt;p&gt;Gtorok: Removed &amp;quot;pls_review&amp;quot; tag because the page was completely re-written.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Status==&lt;br /&gt;
Completely Updated: 7 March 2018&amp;lt;br&amp;gt;&lt;br /&gt;
Released: 14/1/2008&lt;br /&gt;
==Author==&lt;br /&gt;
Pierre Parrend&lt;br /&gt;
&lt;br /&gt;
== Principles ==&lt;br /&gt;
&lt;br /&gt;
Java source code is typically compiled into Java bytecode -- the instruction set of the Java virtual machine. The compiled Java bytecode can be easily reversed engineered back into source code by a freely available decompilers. &lt;br /&gt;
Bytecode Obfuscation is the process of modifying Java bytecode (executable or library) so that it is much harder to read and understand for a hacker but remains fully functional. Almost all code can be reverse-engineered with enough skill, time and effort. However, for some platforms such as Java, Android, or.NET, free decompilers can easily reverse-engineer source code from an executable or library with no real time or effort. &lt;br /&gt;
Automated bytecode obfuscation makes reverse-engineering a program difficult and economically unfeasible. Other advantages could include helping to protect licensing mechanisms and unauthorized access, hiding vulnerabilities and shrinking the size of the executable.&lt;br /&gt;
&lt;br /&gt;
=== How to recover Source Code from Bytecode? ===&lt;br /&gt;
There are a number of freely available Java decompilers that can recreate source code from Java bytecode (executables or libraries). Popular decompilers include:&lt;br /&gt;
* [https://bytecodeviewer.com Bytecode Viewer] - A Java 8 Jar &amp;amp; Android APK Reverse Engineering Suite (Decompiler, Editor, Debugger &amp;amp; More) &lt;br /&gt;
* [http://www.benf.org/other/cfr/ CFR] - Another Java decompiler&lt;br /&gt;
* [http://jd.benow.ca/ JDGui] - Yet another fast Java decompiler&lt;br /&gt;
* [https://github.com/fesh0r/fernflower Fernflower] - An analytical decompiler for Java&lt;br /&gt;
&lt;br /&gt;
=== How to help prevent Java source code from being Reverse-Engineered? ===&lt;br /&gt;
Java bytecode obfuscation consists of multiple complementary techniques that can help create a layered defense against reverse engineering and tampering. Some typical examples of obfuscation techniques include:&lt;br /&gt;
* &amp;lt;b&amp;gt;Renaming&amp;lt;/b&amp;gt; to alter the name of methods and variables to make the decompiled source much harder for a human to understand. &lt;br /&gt;
* &amp;lt;b&amp;gt;Control Flow Obfuscation&amp;lt;/b&amp;gt;creates conditional, branching, and iterative constructs that produce valid executable logic, but yield non-deterministic semantic results when decompiled.&lt;br /&gt;
* &amp;lt;b&amp;gt;String Encryption&amp;lt;/b&amp;gt; hides strings in the executable and only restores their original value when needed&lt;br /&gt;
* &amp;lt;b&amp;gt;Instruction Pattern Transformation&amp;lt;/b&amp;gt; converts common instructions to other, less obvious constructs potential confusing decompliers.&lt;br /&gt;
* &amp;lt;b&amp;gt;Dummy Code Insertion&amp;lt;/b&amp;gt; inserts code that does not affect the program’s logic, but breaks decompilers or makes reverse-engineered code harder to analyze.&lt;br /&gt;
* &amp;lt;b&amp;gt;Unused Code and Metadata Removal&amp;lt;/b&amp;gt; prunes out debug, non-essential metadata and used code from applications to reduce the information available to an attacker.&lt;br /&gt;
* &amp;lt;b&amp;gt;Class file encryption&amp;lt;/b&amp;gt; requires the JVM to decrypt the java executable before running confusing decompilers. Unlike some of the other transforms, this one is easy to circumvent by modifing the local JVM to simply write the executable to disk in its unencrypted form. See: [http://www.javaworld.com/javaworld/javaqa/2003-05/01-qa-0509-jcrypt.html?page=2 Javaworld article]).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What obfuscation tools are available? ===&lt;br /&gt;
You can find popular tools for Java bytecode obfuscation below, or simply type 'java obfuscator' in your favorite search engine. &lt;br /&gt;
* [https://sourceforge.net/projects/proguard/ ProGuard Java Optimizer] is a very popular open source Java class file shrinker, optimizer, obfuscator, and preverifier.&lt;br /&gt;
* [https://www.preemptive.com/products/dasho/overview DashO Android &amp;amp; Java Obfuscator] a Java, Kotlin and Android application hardening and obfuscation tool that provides passive and active protection.&lt;br /&gt;
* [http://www.zelix.com/klassmaster/ KlassMaster Heavy Duty Protection], shrinks and obfuscates both code and string constants. It can also translate stack traces back to readable form if you save the obfuscation log.&lt;br /&gt;
* [http://sourceforge.net/projects/javaguard/ Javaguard], a simple obfuscator without a lot of documentation.&lt;br /&gt;
&lt;br /&gt;
== Using Proguard ==&lt;br /&gt;
The following section provides a short tutorial for using [http://proguard.sourceforge.net/ Proguard].&lt;br /&gt;
First, download the code under [http://sourceforge.net/project/showfiles.php?group_id=54750 following url ] and unzip it.&lt;br /&gt;
&lt;br /&gt;
For this tutorial, we use the [http://www.rzo.free.fr/applis/fr.inria.ares.sfelixutils-0.1.jar fr.inria.ares.sfelixutils-0.1.jar package].&lt;br /&gt;
&lt;br /&gt;
Go to the main directory of Proguard. To launch it, use following script and parameters:&lt;br /&gt;
&lt;br /&gt;
       java -jar lib/proguard.jar @config-genericFrame.pro&lt;br /&gt;
&lt;br /&gt;
config-genericFrame.pro is the option file&lt;br /&gt;
(do not forget to adapt the libraryjars parameter to your own system) :&lt;br /&gt;
&lt;br /&gt;
 -obfuscationdictionary ./examples/dictionaries/compact.txt&lt;br /&gt;
 -libraryjars /usr/java/j2sdk1.4.2_10/jre/lib/rt.jar&lt;br /&gt;
 -injars fr.inria.ares.sfelixutils-0.1.jar&lt;br /&gt;
 -outjar fr.inria.ares.sfelixutils-0.1-obs.jar&lt;br /&gt;
 -dontshrink&lt;br /&gt;
 -dontoptimize&lt;br /&gt;
 -keep public class proguard.ProGuard {&lt;br /&gt;
 public static void main(java.lang.String[]);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Remark that the 'keep' option is mandatory, we use this default class for not keep anything out.&lt;br /&gt;
&lt;br /&gt;
The example dictionary (here compact.txt) is given with the code.&lt;br /&gt;
&lt;br /&gt;
The output is stored in the package 'genericFrameOut.jar'.&lt;br /&gt;
&lt;br /&gt;
You can observe the modifications implied by obfuscation with following commands:&lt;br /&gt;
&lt;br /&gt;
 jar xvf genericFrameOut.jar&lt;br /&gt;
 cd genericFrame/pub/gui/&lt;br /&gt;
 jad c.class&lt;br /&gt;
 more c.jad more c.jad&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [https://www.guardsquare.com/en/proguard Proguard]&lt;br /&gt;
* [http://sourceforge.net/projects/javaguard/ Javaguard]&lt;br /&gt;
* [https://www.preemptive.com/obfuscation Elements of Java Obfuscation]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Obfuscation_(software) Software Obfuscation]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
[[Category:Control]]&lt;/div&gt;</summary>
		<author><name>Gtorok</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Bytecode_obfuscation&amp;diff=238428</id>
		<title>Bytecode obfuscation</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Bytecode_obfuscation&amp;diff=238428"/>
				<updated>2018-03-07T20:38:48Z</updated>
		
		<summary type="html">&lt;p&gt;Gtorok: Major rewrite - removed broken links and un-maintained tools. Updated description and added current decompilers and obfuscators.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{taggedDocument&lt;br /&gt;
| type=pls_review&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Status==&lt;br /&gt;
Released: 14/1/2008&amp;lt;br&amp;gt;&lt;br /&gt;
Updated: 7/3/2018&lt;br /&gt;
==Author==&lt;br /&gt;
Pierre Parrend&lt;br /&gt;
&lt;br /&gt;
== Principles ==&lt;br /&gt;
&lt;br /&gt;
Java source code is typically compiled into Java bytecode -- the instruction set of the Java virtual machine. The compiled Java bytecode can be easily reversed engineered back into source code by a freely available decompilers. &lt;br /&gt;
Bytecode Obfuscation is the process of modifying Java bytecode (executable or library) so that it is much harder to read and understand for a hacker but remains fully functional. Almost all code can be reverse-engineered with enough skill, time and effort. However, for some platforms such as Java, Android, or.NET, free decompilers can easily reverse-engineer source code from an executable or library with no real time or effort. &lt;br /&gt;
Automated bytecode obfuscation makes reverse-engineering a program difficult and economically unfeasible. Other advantages could include helping to protect licensing mechanisms and unauthorized access, hiding vulnerabilities and shrinking the size of the executable.&lt;br /&gt;
&lt;br /&gt;
=== How to recover Source Code from Bytecode? ===&lt;br /&gt;
There are a number of freely available Java decompilers that can recreate source code from Java bytecode (executables or libraries). Popular decompilers include:&lt;br /&gt;
* [https://bytecodeviewer.com Bytecode Viewer] - A Java 8 Jar &amp;amp; Android APK Reverse Engineering Suite (Decompiler, Editor, Debugger &amp;amp; More) &lt;br /&gt;
* [http://www.benf.org/other/cfr/ CFR] - Another Java decompiler&lt;br /&gt;
* [http://jd.benow.ca/ JDGui] - Yet another fast Java decompiler&lt;br /&gt;
* [https://github.com/fesh0r/fernflower Fernflower] - An analytical decompiler for Java&lt;br /&gt;
&lt;br /&gt;
=== How to help prevent Java source code from being Reverse-Engineered? ===&lt;br /&gt;
Java bytecode obfuscation consists of multiple complementary techniques that can help create a layered defense against reverse engineering and tampering. Some typical examples of obfuscation techniques include:&lt;br /&gt;
* &amp;lt;b&amp;gt;Renaming&amp;lt;/b&amp;gt; to alter the name of methods and variables to make the decompiled source much harder for a human to understand. &lt;br /&gt;
* &amp;lt;b&amp;gt;Control Flow Obfuscation&amp;lt;/b&amp;gt;creates conditional, branching, and iterative constructs that produce valid executable logic, but yield non-deterministic semantic results when decompiled.&lt;br /&gt;
* &amp;lt;b&amp;gt;String Encryption&amp;lt;/b&amp;gt; hides strings in the executable and only restores their original value when needed&lt;br /&gt;
* &amp;lt;b&amp;gt;Instruction Pattern Transformation&amp;lt;/b&amp;gt; converts common instructions to other, less obvious constructs potential confusing decompliers.&lt;br /&gt;
* &amp;lt;b&amp;gt;Dummy Code Insertion&amp;lt;/b&amp;gt; inserts code that does not affect the program’s logic, but breaks decompilers or makes reverse-engineered code harder to analyze.&lt;br /&gt;
* &amp;lt;b&amp;gt;Unused Code and Metadata Removal&amp;lt;/b&amp;gt; prunes out debug, non-essential metadata and used code from applications to reduce the information available to an attacker.&lt;br /&gt;
* &amp;lt;b&amp;gt;Class file encryption&amp;lt;/b&amp;gt; requires the JVM to decrypt the java executable before running confusing decompilers. Unlike some of the other transforms, this one is easy to circumvent by modifing the local JVM to simply write the executable to disk in its unencrypted form. See: [http://www.javaworld.com/javaworld/javaqa/2003-05/01-qa-0509-jcrypt.html?page=2 Javaworld article]).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== What obfuscation tools are available? ===&lt;br /&gt;
You can find popular tools for Java bytecode obfuscation below, or simply type 'java obfuscator' in your favorite search engine. &lt;br /&gt;
* [https://sourceforge.net/projects/proguard/ ProGuard Java Optimizer] is a very popular open source Java class file shrinker, optimizer, obfuscator, and preverifier.&lt;br /&gt;
* [https://www.preemptive.com/products/dasho/overview DashO Android &amp;amp; Java Obfuscator] a Java, Kotlin and Android application hardening and obfuscation tool that provides passive and active protection.&lt;br /&gt;
* [http://www.zelix.com/klassmaster/ KlassMaster Heavy Duty Protection], shrinks and obfuscates both code and string constants. It can also translate stack traces back to readable form if you save the obfuscation log.&lt;br /&gt;
* [http://sourceforge.net/projects/javaguard/ Javaguard], a simple obfuscator without a lot of documentation.&lt;br /&gt;
&lt;br /&gt;
== Using Proguard ==&lt;br /&gt;
The following section provides a short tutorial for using [http://proguard.sourceforge.net/ Proguard].&lt;br /&gt;
First, download the code under [http://sourceforge.net/project/showfiles.php?group_id=54750 following url ] and unzip it.&lt;br /&gt;
&lt;br /&gt;
For this tutorial, we use the [http://www.rzo.free.fr/applis/fr.inria.ares.sfelixutils-0.1.jar fr.inria.ares.sfelixutils-0.1.jar package].&lt;br /&gt;
&lt;br /&gt;
Go to the main directory of Proguard. To launch it, use following script and parameters:&lt;br /&gt;
&lt;br /&gt;
       java -jar lib/proguard.jar @config-genericFrame.pro&lt;br /&gt;
&lt;br /&gt;
config-genericFrame.pro is the option file&lt;br /&gt;
(do not forget to adapt the libraryjars parameter to your own system) :&lt;br /&gt;
&lt;br /&gt;
 -obfuscationdictionary ./examples/dictionaries/compact.txt&lt;br /&gt;
 -libraryjars /usr/java/j2sdk1.4.2_10/jre/lib/rt.jar&lt;br /&gt;
 -injars fr.inria.ares.sfelixutils-0.1.jar&lt;br /&gt;
 -outjar fr.inria.ares.sfelixutils-0.1-obs.jar&lt;br /&gt;
 -dontshrink&lt;br /&gt;
 -dontoptimize&lt;br /&gt;
 -keep public class proguard.ProGuard {&lt;br /&gt;
 public static void main(java.lang.String[]);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Remark that the 'keep' option is mandatory, we use this default class for not keep anything out.&lt;br /&gt;
&lt;br /&gt;
The example dictionary (here compact.txt) is given with the code.&lt;br /&gt;
&lt;br /&gt;
The output is stored in the package 'genericFrameOut.jar'.&lt;br /&gt;
&lt;br /&gt;
You can observe the modifications implied by obfuscation with following commands:&lt;br /&gt;
&lt;br /&gt;
 jar xvf genericFrameOut.jar&lt;br /&gt;
 cd genericFrame/pub/gui/&lt;br /&gt;
 jad c.class&lt;br /&gt;
 more c.jad more c.jad&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [https://www.guardsquare.com/en/proguard Proguard]&lt;br /&gt;
* [http://sourceforge.net/projects/javaguard/ Javaguard]&lt;br /&gt;
* [https://www.preemptive.com/obfuscation Elements of Java Obfuscation]&lt;br /&gt;
* [https://en.wikipedia.org/wiki/Obfuscation_(software) Software Obfuscation]&lt;br /&gt;
[[Category:Java]]&lt;br /&gt;
[[Category:How To]]&lt;br /&gt;
[[Category:Control]]&lt;/div&gt;</summary>
		<author><name>Gtorok</name></author>	</entry>

	</feed>