FAQ/Preventing-information-leaks.md
... ...
@@ -0,0 +1,34 @@
1
+#How Do I Prevent Information Leaks?
2
+
3
+[[_TOC_]]
4
+
5
+##Description
6
+
7
+Revealing system data or debugging information helps an adversary learn about the system and form a plan of attack. An information leak occurs when system data or debugging information leaves the program through an output stream or logging function.
8
+
9
+More information regarding information leakage can be found at: https://www.owasp.org/index.php/Information_Leakage
10
+
11
+Adding the below code to the rs.aspx page will help you control what a user is able to see. The “Prohibited” quotes is where you put the literal information displayed to the end user.
12
+
13
+<script runat="server">
14
+private bool SystemInfoPresents(ControlCollection controls)
15
+ {
16
+ foreach (Control c in controls)
17
+ if (c.GetType().FullName == "AdHoc.Controls.SystemInfoControl")
18
+ return true;
19
+ foreach (Control c in controls)
20
+ if (SystemInfoPresents(c.Controls))
21
+ return true;
22
+ return false;
23
+ }
24
+
25
+ protected override void OnLoad(EventArgs e)
26
+ {
27
+ base.OnLoad(e);
28
+ if (SystemInfoPresents(Controls)) {
29
+ //What you place here changes the response on the rs.aspx page in the browser
30
+ Controls.Clear();
31
+ Controls.Add(new LiteralControl("Prohibited"));
32
+ }
33
+ }
34
+ </script>
... ...
\ No newline at end of file