Skip to content

Logging

Robert Merget edited this page Sep 30, 2024 · 13 revisions

Per default, info logging is enabled in TLS-Attacker. You can turn off logging by starting the TLS-Attacker client with the following parameter:

-quiet

If you want full DEBUG output you can start TLS-Attacker with the debug flag:

-debug

TLS-Attacker also provides the ability to log all executed Workflows in a folder or file. You can access this feature with the client and server example application from commandline:

-workflow_output [folder/file]

or for all other applications by changing the workflowOutput value in the config file. For further references see check the Wiki page about the Config.

-config saveConfig.xml
<Config>
    <workflowOutput>someFolder/</workflowOutput>
</Config>

If you want more detailed control over the logging behavior of TLS-Attacker you can start TLS-Attacker with a log4j2.xml config:

java -Dlog4j.configurationFile=path/to/log4j2.xml -jar TLS-Client.jar -connect google.com 

Your log4j configuration file may look like this:

<Configuration status="WARN">
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
			<ExtendedPatternLayout pattern="%highlight{%d{HH:mm:ss}{GMT+0} [%t] %-5level: %c{1} - %msg%n%throwable}"/>
        </Console>
        <Console name="Info" target="SYSTEM_OUT">
			<ExtendedPatternLayout pattern="%highlight{%d{HH:mm:ss}{GMT+0} [%t] %-5level: %c{1}} - %msg%n%highlight{%throwable}"/>
        </Console>
        <Console name="Direct" target="SYSTEM_OUT">
			<ExtendedPatternLayout pattern="%msg%n"/>
        </Console>
    </Appenders>
    <Loggers>
	<Logger name="DirectLogger" level="ALL">
		<AppenderRef ref="Direct"/>
	</Logger>
	<Logger name="com.openpojo.log.LoggerFactory" level="Off">
		<AppenderRef ref="Direct"/>	
	</Logger>
        <Logger name="de.rub.nds.tlsattacker.core.protocol.parser" level="DEBUG"/>
        <Root level="INFO">
            <AppenderRef ref="DEBUG"/>
        </Root>
    </Loggers>
</Configuration>

This example sets the parser logger to the DEBUG level, which shows you how TLS-Attacker parsed incoming messages.

Clone this wiki locally