13.error Handling and Logging
13.error Handling and Logging
Search ...
mr.=,.
r ---- .
..... ',..,. •
Error Hartdhng arid
Log ging
c:J
Logging
13.1. lnlroduclion
Labs
Search ...
r=::1
~
13. Error Handling
and Logg1ng
t==J
i=::113. Error Handling
and Logg1ng
• =:~-=---
=:.-:=:::. 13.1 . lntroduction
~
~Labs
Search ...
3
Error Handling and
Log ging
"' r=l
c=J 13. Error Handling and
Loggmg
~
~Labs
Search ...
5
Error Handling and
Log ging
"' r=l
c=J 13. Error Handling and
Loggmg
Search ...
6
Error Handling and
Log ging
"' r=l
c=J 13. Error Handling and
Loggmg
r=::1
~
13. Error Handling
and Logg1ng
• =:~-=---
=:.-:=:::. .
13.1 lntroduction
~
~Labs
Search ...
r=l
"' c=J 13. Error Handling and
Loggmg
r=::1
~
13. Error Handling
and Logg1ng
r=:::'l
• ~j
13.2. What tne
Problem ls
Search ...
platform in use.
EJ
13.3. HowCan 1 See
• lf 1 Am Vulnerable To
This?
Logging defines how traces of errors or other r::=::1 13.4. How Can 1 Fix
·~ This?
Search ...
· 1-·.~..=-:·
For example, when the .NET padding Oracle
.._.:113.2. What tne
Problem ls
oracle-vulnerability/
·~
r:::::1 13.4. HowCan 1 Fix
This?
Search ...
Tools such as sqlmap will sometimes be I~-: - _ "".:. .-] 13.1 lntrocuction
„
~ Problemls
132 Whatlhe
Netvolution referer header SQL injection vulnerability E:!!I Problem ls
{11:02:00] {INFO] testing 'AND boolean-based blind - WHEREor HAVING clause' r:::=:l
~
13.2. Whal tne
Problemls
parsed error message(s) showed that the back-end DBMS could be Microsoft SQL Server.
Do you want to skip test pay/oads specific for other DBMSes? [Y/n] Y
EJ
[11:02:16] {INFO] testing 'Microsoft SQL Server/Sybase AND error-bosed 13.3. How Can 1 See
• lf 1 Am Vulnerable To
- WHEREor HAV/NG clause' This?
http://census-labs.com/news/2011/10/03/netvolution-referer-SQLi/
·~
r:::::1 13.4. HowCan 1 Fix
This?
Search ...
EJ
13.3. How Can 1 See
• lf 1 Am Vulnerable To
This?
·~
r:::::1 13.4. HowCan 1 Fix
This?
Search ...
~
elea rnSecu rity © 2013 1 ~ -•. ~ 1 13.5. Further Reading
OUTLINE
Search ...
13.3.2. Platform
Error Messages
.~~--
r:.::::J 13.3.3. Applicalion
Error Messages
Search ...
15 Error Handling and Logging > How can 1 see if 1 am vulnerable to this?
· 1-·.~..=-:·
..-.:113.2. What the
Problem ls
"true": i=:J
~
13.2 Whatthe
Problemls
EJ .
likelihood of failure 13.3. HowCan 1 See
,.. II 1 Am Vulnerable To
try { This?
II
133.1.Business
library_call(); //The library throws an exception: throw new Logrc Fla~vs Due To
nnproper Error H ...
Exception('Unexpected .. ');
Search ...
16 Error Handling and Logging > How can 1 see if 1 am vulnerable to this?
· 1-·.::.;:::;=..=-:·
, __:113.2.Problem
What the
ls
i=:J
~
13.2 Whatthe
Problemls
The platform ~
~
13.2. What tne
Problemls
configuration files
EJ
13.3. HowCan 1 See
,.. II 1 Am Vulnerable To
This?
• I :-:.-----·--113.3.3. Applicalion
Error Messages
Search ...
17 Error Handling and Logging > How can 1 see if 1 am vulnerable to this?
· 1-·.::.;:::;=..=-:·
, __:113.2.Problem
What the
ls
~ 13.2 Whatthe
~ Problemls
i=:J
~
13.2 Whatthe
Problemls
. 13 3 2. Platforrn
Error Messages
•
• I :-:.-----·--113.3.3. Applicalion
Error Messages
Search ...
is Error Handling and Logging > How can 1 see if 1 am vulnerable to this?
13.3.1 Business
Log1c Flaws Due To
lmproper Error H ...
L:"l
t===1 13.3.2. Platform
Error Messages
combined with dynamic analysis whenever r:::::'"1 13.4. How Can 1 Fix
possible.
·~ This?
~
~ 13.5. Further Reading
Search ...
19 Error Handling and Logging > How can 1 see if 1 am vulnerable to this?
13.3.1 Business
Log1c Flaws Due To
lmproper Error H ...
„
"The username you provided does not exist" User enumeration
i==!
--·· 1333
Apphcanor.
User enumeration, information leakage that might Error Messages
"This record can only be viewed by the following
be leveraged to attack such users in order to
users: ..... II
~
11 Reveals the underlying operating system being a
"Saving file in /home/www/payroll/ ...
Unix derivative and location of files ~
~ 13.5. Further Reading
"The SQL query is: SELECT column1, column2 ... " Full SQL query, tables and columns revealed
Search ...
20 Error Handling and Logging > How can 1 see if 1 am vulnerable to this?
13.3.1 Business
Log1c Flaws Due To
lmproper Error H ...
L:"l
t===1 13.3.2. Platform
Error Messages
track a security incident, then there will likely be a r:::::l 13.3.4. Logging
problem. ~
~ 13.3.4. Logging
~
Search ...
21 Error Handling and Logging > How can 1 see if 1 am vulnerable to this?
13.3.1 Business
Log1c Flaws Due To
lmproper Error H ...
L:"l
t===1 13.3.2. Platform
Error Messages
-
number, in order to try to view what they should
• l::..::..,,--'--'·113.3.4 Loggmg
~ 13.3.4. Logging
Search ...
22 Error Handling and Logging > How can 1 see if 1 am vulnerable to this? ~~I Error Messages
• l;;:_-:;_-'--'·113.3.4 Logging
Testing of logging issues should try to answer
questions such as: IEJ 1334 Loggmg
lii!il 13 3 4. Logg1ng
·~
r:::::1 13.4. This?
How Can 1 Fix
ana tne attacl<er is· root can tne logs oe· trustea?
~ 13.5. Further Reading
~
Search ...
24 Error Handling and Logging > How can 1 see if 1 am vulnerable to this? ~~I Error Messages
• l;;:_-:;_-'--'·113.3.4 Logging
breach-detection-than-they-should-be/article/299103/
~ 13.5. Further Reading
~
~
~ 13.5. Further Reading
Search ...
zs Error Handling and Logging > How can 1 see if 1 am vulnerable to this? ~-~I Error Messages
• l;;:_-:;_-'--'·113.3.4 Logging
OWASP guidelines to test for this issue can be 1~~~;,-"':;-l 13.3.4. Logg1ng
found here:
1 ;;:.:_&m_: 113.3 4 Logg1ng
~
~ 13.5. Further Reading
Search ...
• l;;:_-:;_""'-'·113.3.4 Logging
For example, if you look at the following code 1 ;;:.:_&m_: 113.3 4 Logg1ng
•
to "false": ~
~
13.4.1.Fail
Securely
~ 13.4.2. Platform
~ Error Messages
Search ...
28 Error Handling and Logging > How can 1 fix this? ~-~I Error Messages
• l;;:_-:;_""'-'·113.3.4 Logging
·~
r:::::1 13.4. Th1s?
HowCan 1 Fix
~ 134.1 Fal
~ Securely
l!!!l!i
~
13 4 2. Platförm
Error Messages
~ 13.4.2. Platform
~ Error Messages
Search ...
Never display lnstead, log errors and fail 1-::. -· 113.3 4. Loggmg
or error messages
on the screen For example in php.ini: 134.1 Fal
Securely
=~I 13 4 2. Ptatforrn
Error Messages
I 1
~ 13 4 2. Plalform
~ Error Messages
display_startup_errors - Off
~ 13.4.2. Platform
display_errors =Off ~ Error Messages
html_errors =Off
error_log = /path/to/error_log c=.J
~ 13.4.2. Platform
Error Messages
~ 13.4.2. Platform
~ Error Messages
Search ...
31 Error Handling and Logging > How can 1 fix this? 15 "1
production
during development, ensuring
that the mechanism to swap files from ~
~
13.4.2. Prattorm
Error Messages
~ 13.4.2. Platform
~ Error Messages
r:--J
[==i
13.4.3. Application
Error Messages
Search ...
32 Error Handling and Logging > How can 1 fix this? 15 "1
r--"1
~
13.4.3. Applicalion
Error Messages
Search ...
33 Error Handling and Logging > How can 1 fix this? 1..--z:r=-113.3 4 Logg1ng
EI 13.3 4. Loggmg
·~
r:::::::1 13.4. How Can 1 Fix
Th1s?
134.1 Fal
Securely
13 4 2. Ptatforrn
Error Messages
13.4.2 Ptatforrn
Error Messages
13.4.2 Platform
Error Messages
.. 13 4 3. Appticatron
Error Messages
•
13.4.3. Application
Error Messages
elea rnSecu rity © 2013
OUTLINE
Search ...
~ 13.4.2 Platform
Error Messages
a
~
. 13 4.3. Apphcallon
Error Messages
•
B
r:=1
13.4.3. Application
Error Messages
13.4.3. Application
t==j- Error Messages
When in doubt err on the side a/ ''/ess verbose'' r.:=i 13.4.3. Apphcation
~ 13.4.3. Application
Error Messages
~
B 13.4.3. Applicalion
Error Messages
B 13.4.3. Application
Error Messages
Search ...
~ 13.4.2 Platform
Error Messages
a
~
B 13.4.3. Apphcalion
Error Messages
.• 13 4 3. Apphcallon
Error Messages
•
r:=1
t==j-
13.4.3. Application
Error Messages
Making application errors more help/ul /or you r.:=i 13.4.3. Apphcation
B 13.4.3. Applicalion
Error Messages
B 13.4.3. Application
Error Messages
Search ...
t:==J
~ 13.4.3. Apphcalion
Error Messages
t:=.J
~ 13.4.3. Apphcation
Error Messages
l::=J
~ 13.4.3. Application
Error Messages
t:==J
~ 13.4.3. Applicalion
Error Messages
~ 13.4.3. Application
~ Error Messages
Search ...
II
The SQL query failed! - Query: SELECT columnl, t:==J
~ 134.3.Apphcalion
Error Messages
II
An unexpected error has occurred please . 13 4 3. Apphcation
Error Messages
•
indicate the following reference for assistance: ~ 13.4.3. Application
t.::=:j Error Messages
12345611
t:==J
~ 13.4.3. Applicalion
Error Messages
~ 13.4.3. Application
~ Error Messages
Search ...
and on top of all that, you have a great tool at your i=:i
t=::'.::.J 13.4.3 Applcalion
.. 13 4 3 Apphcallon
the line. •
Error Messages
t:==J
~ 13.4.3. Applicalion
Error Messages
~ 13.4.3. Application
~ Error Messages
Search ...
B
r:-1
13.4 3. Apphcahon
Error Messages
B
r:=:1
13.4.3. Apphcation
Error Messages
13.4.3. Apphcat1on
c=J- Error Messages
error messages
13.4.3. Apphcahon
~ Error Messages
13 4.3. Apphcahon
-
- Error Messages
.
II
13 4 3 Apphcallon
Error Messages
13.4.3. Apphcation
Error Messages
13.4.3. Application
elea rnSecu rity © 2013 Error Messages
OUTLINE
Search ...
~ 13.4.3. Application
~ Error Messages
Search ...
~ 13.4.3. Apphcallon
~ Error Messages
~ 134.3.Apphcallon
~ Error Messages
~ 134.3.Apphcallon
L:j Error Messages
~ 13.4 3. Apphcallon
~ Error Messages
problems. •
Error Messages
EJ 13.4.4. Logging
EJ 13.4.4. Logging
13.4.4. Logging
~
Search ...
13.4.3. Apphcallon
~ Error Messages
13 4.3. Apphcallon
-- Error Messages
B
r:-1
13 4.3. Apphcallon
Error Messages
13.4 3. Apphcallon
this problem: -
13.4.3 Appl cauon
- Error Messages
EJ 13.4.4 Loggmg
• 13 4 4. Logg1ng
13.4.4. Logging
Search ...
13.4.3. Apphcallon
~ Error Messages
13 4.3. Apphcallon
-- Error Messages
B
r:-1
13 4.3. Apphcallon
Error Messages
13.4 3. Apphcallon
Error Messages
~
EJ 13.4.4 Loggmg
EJ 13.4 4 Logg1ng
ii 13 4 4. Loggmg
Search ...
47 Error Handling and Logging > How can 1 fix this? r. ~ 13 4.3. Apphcahon
~ Error Messages
El 13 4 4. Loggmg
EJ 13.4.4. Logg1ng
1~ _ -113.4.4 Loggmg
The goal here is to ensure that as close to 100% of the lii 13 4 4. Logg1ng
security incidents are correctly logged by the application. 1 :::52::.: -113.4.4. Logging
This will depend on the platform but the business logic I;;,,- -.=:;::_113.4.4. Logging
~ 13.4.4. Logging
Search ...
48 Error Handling and Logging > How can 1 fix this? r. ~ 13 4.3. Apphcahon
~ Error Messages
El 13 4 4. Loggmg
EJ 13.4.4. Logg1ng
1~ _ -113.4.4 Loggmg
exceptions" simplify logging? Can (all or part of) access I;;,,- -.=:;::_113.4.4. Logging
~ 13.4.4. Logging
Search ...
so Error Handling and Logging > How can 1 fix this? r. ~ 13 4.3. Apphcahon
~ Error Messages
El 13 4 4. Loggmg
EJ 13.4.4. Logg1ng
1~ _ -113.4.4 Loggmg
The reason for this is that, if the web server is I;;,,- -.=:;::_113.4 4 Logg1ng
~ 13.4.4. Logging
Search ...
sa Error Handling and Logging > How can 1 fix this? r. ~ 13 4.3. Apphcahon
~ Error Messages
El 13 4 4. Loggmg
EJ 13.4.4. Logg1ng
1~ _ -113.4.4 Loggmg
liii 13 4 4. Loggmg
~ 13.4.4. Logging
~
Search ...
sa Error Handling and Logging > How can 1 fix this? r. ~ 13 4.3. Apphcahon
~ Error Messages
El 13 4 4. Loggmg
EJ 13.4.4. Logg1ng
1~ _ -113.4.4 Loggmg
liii 13 4 4. Loggmg
~ 13.4.4. Logging
~
Search ...
sz Error Handling and Logging > How can 1 fix this? r. ~ 13 4.3.Apphcahon
~ Error Messages
El 13 4 4. Loggmg
EJ 13.4.4. Logg1ng
1~ _ -113.4.4 Loggmg
detection duration (i.e. 210 days on average). Compliance I;;,,- -.=:;::_113.4 4 Logg1ng
Search ...
•
Logging policy: data
Log file retention policy !:::.:::::::..: -113.4.4 Loggmg
protection, interception and
example
Freedom of Information
1;;,,. ·.=:;::_113.4 4 Logg1ng
~
eu l::.=.:.,,,-;;,:~113.4.4 Loggmg
Apache Log filesWindows log
~ 115 Logging
,~
retention policy
•• I"'· .. ~"" 113 4.4 Logg1ng
------------, ~ 13 4 4. Loggmg
!
~t
•
Windows log retention policy Windows Logging
~ 13.5. Further Readmq
• 13 5. Further Read1ng
Search ...
.Labs
Search ...
~ 13.44 Logg1ng
~ 13.4.4 Loggmg
Error Handling
and I;;,,- -.=:;::_113.4 4 Logg1ng
1=---?':::.1134 4. Loggmg
~~ ·,
~. 13 5. Further Readinq
~Labs