Package eu.tneitzel.rmg.io
Class Logger
- java.lang.Object
-
- eu.tneitzel.rmg.io.Logger
-
public class Logger extends Object
The Logger class exposes static methods that can be used to create colored output. Additionally, most of the methods add a '[+]' or '[-]' prefix. The Logger class also handles a unified indent that can be increased or decreased by invoking classes. This saves invoking classes from handle indentation manually. It is probably not the prettiest approach, but it works quite nice :D- Author:
- Tobias Neitzel (@qtc_de)
-
-
Field Summary
Fields Modifier and Type Field Description static intindentcurrent indent of the loggerstatic intprintCounthow many lines have already be printedstatic booleanstderrwhether stderr is enabledstatic booleanstdoutwhether stdout is enabled
-
Constructor Summary
Constructors Constructor Description Logger()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringblue(String msg)Format the specified string in blue.static voiddecreaseIndent()static voiddisable()static voiddisableColor()static voiddisableIfNotVerbose()static voiddisableStderr()static voiddisableStdout()static voidenable()static voidenableStderr()static voidenableStdout()static voideprint(String msg)static voideprintln(String msg)static voideprintlnBlue(String msg)static voideprintlnMixedBlue(String first, String second)static voideprintlnMixedBlue(String first, String second, String third)static voideprintlnMixedBlueFirst(String first, String second)static voideprintlnMixedBlueFirst(String first, String second, String third)static voideprintlnMixedYellow(String first, String second)static voideprintlnMixedYellow(String first, String second, String third)static voideprintlnMixedYellowFirst(String first, String second)static voideprintlnMixedYellowFirst(String first, String second, String third)static voideprintlnPlain(String msg)static voideprintlnPlainBlue(String msg)static voideprintlnPlainMixedBlue(String first, String second)static voideprintlnPlainMixedBlue(String first, String second, String third)static voideprintlnPlainMixedBlueFirst(String first, String second)static voideprintlnPlainMixedBlueFirst(String first, String second, String third)static voideprintlnPlainYellow(String msg)static voideprintlnYellow(String msg)static voideprintMixedBlue(String first, String second)static voideprintMixedBlue(String first, String second, String third)static voideprintMixedBlueFirst(String first, String second)static voideprintMixedBlueFirst(String first, String second, String third)static voideprintMixedYellow(String first, String second)static voideprintMixedYellow(String first, String second, String third)static voideprintMixedYellowFirst(String first, String second)static voideprintMixedYellowFirst(String first, String second, String third)static voideprintPlainMixedYellowFirst(String first, String second)static StringgetIndent()static Stringgreen(String msg)Format the specified string in green.static voidincreaseIndent()static voidlineBreak()static StringpadRight(String s, int n)static voidprint(String msg)static voidprintCodebaseAttackIntro(String endpointName, String callName, String className)static voidprintGadgetCallIntro(String endpointName)static voidprintInfoBox()static voidprintln(String msg)static voidprintlnBlue(String msg)static voidprintlnMixedBlue(String first, String second)static voidprintlnMixedBlue(String first, String second, String third)static voidprintlnMixedBlueFirst(String first, String second)static voidprintlnMixedBlueFirst(String first, String second, String third)static voidprintlnMixedGreen(String first, String second)static voidprintlnMixedPurple(String first, String second)static voidprintlnMixedRed(String first, String second)static voidprintlnMixedYellow(String first, String second)static voidprintlnMixedYellow(String first, String second, String third)static voidprintlnMixedYellowFirst(String first, String second)static voidprintlnMixedYellowFirst(String first, String second, String third)static voidprintlnPlain(String msg)static voidprintlnPlainBlue(String msg)static voidprintlnPlainGreen(String msg)static voidprintlnPlainMixedBlue(String first, String second)static voidprintlnPlainMixedBlue(String first, String second, String third)static voidprintlnPlainMixedBlueFirst(String first, String second)static voidprintlnPlainMixedBlueFirst(String first, String second, String third)static voidprintlnPlainMixedGreen(String first, String second)static voidprintlnPlainMixedPurple(String first, String second)static voidprintlnPlainMixedRed(String first, String second)static voidprintlnPlainMixedYellow(String first, String second)static voidprintlnPlainMixedYellow(String first, String second, String third)static voidprintlnPlainMixedYellowFirst(String first, String second)static voidprintlnPlainMixedYellowFirst(String first, String second, String third)static voidprintlnPlainYellow(String msg)static voidprintlnYellow(String msg)static voidprintMixedBlue(String first, String second)static voidprintMixedBlue(String first, String second, String third)static voidprintMixedBlueFirst(String first, String second)static voidprintMixedBlueFirst(String first, String second, String third)static voidprintMixedYellow(String first, String second)static voidprintMixedYellow(String first, String second, String third)static voidprintMixedYellowFirst(String first, String second)static voidprintMixedYellowFirst(String first, String second, String third)static voidprintPlain(String msg)static voidprintPlainBlue(String msg)static voidprintPlainGreen(String msg)static voidprintPlainMixedBlue(String first, String second)static voidprintPlainMixedBlueFirst(String first, String second, String third)static voidprintPlainMixedGreen(String first, String second)static voidprintPlainMixedPurple(String first, String second)static voidprintPlainMixedRed(String first, String second)static voidprintPlainMixedYellowFirst(String first, String second)static voidprintPlainYellow(String msg)static Stringpurple(String msg)Format the specified string in purple.static Stringred(String msg)Format the specified string in red.static voidstatusDefault()static voidstatusNonDefault()static voidstatusOk()static voidstatusOutdated()static voidstatusUndecided(String statusType)static voidstatusVulnerable()static Stringyellow(String msg)Format the specified string in yellow.
-
-
-
Method Detail
-
disable
public static void disable()
-
disableStdout
public static void disableStdout()
-
disableStderr
public static void disableStderr()
-
disableIfNotVerbose
public static void disableIfNotVerbose()
-
enable
public static void enable()
-
enableStdout
public static void enableStdout()
-
enableStderr
public static void enableStderr()
-
blue
public static String blue(String msg)
Format the specified string in blue.- Parameters:
msg- message to format- Returns:
- formatted message
-
yellow
public static String yellow(String msg)
Format the specified string in yellow.- Parameters:
msg- message to format- Returns:
- formatted message
-
red
public static String red(String msg)
Format the specified string in red.- Parameters:
msg- message to format- Returns:
- formatted message
-
purple
public static String purple(String msg)
Format the specified string in purple.- Parameters:
msg- message to format- Returns:
- formatted message
-
green
public static String green(String msg)
Format the specified string in green.- Parameters:
msg- message to format- Returns:
- formatted message
-
lineBreak
public static void lineBreak()
-
print
public static void print(String msg)
- Parameters:
msg- the message to log
-
printPlain
public static void printPlain(String msg)
- Parameters:
msg- the message to log
-
println
public static void println(String msg)
- Parameters:
msg- the message to log
-
printlnPlain
public static void printlnPlain(String msg)
- Parameters:
msg- the message to log
-
eprint
public static void eprint(String msg)
- Parameters:
msg- the message to log
-
eprintln
public static void eprintln(String msg)
- Parameters:
msg- the message to log
-
eprintlnPlain
public static void eprintlnPlain(String msg)
- Parameters:
msg- the message to log
-
printlnBlue
public static void printlnBlue(String msg)
- Parameters:
msg- the message to log
-
eprintlnBlue
public static void eprintlnBlue(String msg)
- Parameters:
msg- the message to log
-
printlnYellow
public static void printlnYellow(String msg)
- Parameters:
msg- the message to log
-
eprintlnYellow
public static void eprintlnYellow(String msg)
- Parameters:
msg- the message to log
-
printlnPlainBlue
public static void printlnPlainBlue(String msg)
- Parameters:
msg- the message to log
-
printPlainBlue
public static void printPlainBlue(String msg)
- Parameters:
msg- the message to log
-
printPlainGreen
public static void printPlainGreen(String msg)
- Parameters:
msg- the message to log
-
printlnPlainGreen
public static void printlnPlainGreen(String msg)
- Parameters:
msg- the message to log
-
eprintlnPlainBlue
public static void eprintlnPlainBlue(String msg)
- Parameters:
msg- the message to log
-
printlnPlainYellow
public static void printlnPlainYellow(String msg)
- Parameters:
msg- the message to log
-
printPlainYellow
public static void printPlainYellow(String msg)
- Parameters:
msg- the message to log
-
eprintlnPlainYellow
public static void eprintlnPlainYellow(String msg)
- Parameters:
msg- the message to log
-
printlnMixedRed
public static void printlnMixedRed(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printlnPlainMixedRed
public static void printlnPlainMixedRed(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printPlainMixedRed
public static void printPlainMixedRed(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printlnMixedGreen
public static void printlnMixedGreen(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printlnPlainMixedGreen
public static void printlnPlainMixedGreen(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printPlainMixedGreen
public static void printPlainMixedGreen(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printlnMixedPurple
public static void printlnMixedPurple(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printlnPlainMixedPurple
public static void printlnPlainMixedPurple(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printPlainMixedPurple
public static void printPlainMixedPurple(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printlnMixedBlue
public static void printlnMixedBlue(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printlnMixedBlue
public static void printlnMixedBlue(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
printlnMixedYellow
public static void printlnMixedYellow(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printlnMixedYellow
public static void printlnMixedYellow(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
printlnPlainMixedYellow
public static void printlnPlainMixedYellow(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printlnPlainMixedYellow
public static void printlnPlainMixedYellow(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
printPlainMixedYellowFirst
public static void printPlainMixedYellowFirst(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
eprintPlainMixedYellowFirst
public static void eprintPlainMixedYellowFirst(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printlnPlainMixedYellowFirst
public static void printlnPlainMixedYellowFirst(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printlnPlainMixedYellowFirst
public static void printlnPlainMixedYellowFirst(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
printlnPlainMixedBlue
public static void printlnPlainMixedBlue(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
eprintlnPlainMixedBlue
public static void eprintlnPlainMixedBlue(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printlnPlainMixedBlue
public static void printlnPlainMixedBlue(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
eprintlnPlainMixedBlue
public static void eprintlnPlainMixedBlue(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
printPlainMixedBlue
public static void printPlainMixedBlue(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printPlainMixedBlueFirst
public static void printPlainMixedBlueFirst(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
eprintlnMixedBlue
public static void eprintlnMixedBlue(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
eprintlnMixedBlue
public static void eprintlnMixedBlue(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
eprintlnMixedYellow
public static void eprintlnMixedYellow(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
eprintlnMixedYellow
public static void eprintlnMixedYellow(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
printlnMixedBlueFirst
public static void printlnMixedBlueFirst(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printlnMixedBlueFirst
public static void printlnMixedBlueFirst(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
printlnPlainMixedBlueFirst
public static void printlnPlainMixedBlueFirst(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
eprintlnPlainMixedBlueFirst
public static void eprintlnPlainMixedBlueFirst(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
eprintlnPlainMixedBlueFirst
public static void eprintlnPlainMixedBlueFirst(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
printlnPlainMixedBlueFirst
public static void printlnPlainMixedBlueFirst(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
printlnMixedYellowFirst
public static void printlnMixedYellowFirst(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printlnMixedYellowFirst
public static void printlnMixedYellowFirst(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
eprintlnMixedBlueFirst
public static void eprintlnMixedBlueFirst(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
eprintlnMixedBlueFirst
public static void eprintlnMixedBlueFirst(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
eprintlnMixedYellowFirst
public static void eprintlnMixedYellowFirst(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
eprintlnMixedYellowFirst
public static void eprintlnMixedYellowFirst(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
printMixedBlue
public static void printMixedBlue(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printMixedBlue
public static void printMixedBlue(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
printMixedYellow
public static void printMixedYellow(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printMixedYellow
public static void printMixedYellow(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
eprintMixedBlue
public static void eprintMixedBlue(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
eprintMixedBlue
public static void eprintMixedBlue(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
eprintMixedYellow
public static void eprintMixedYellow(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
eprintMixedYellow
public static void eprintMixedYellow(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
printMixedBlueFirst
public static void printMixedBlueFirst(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printMixedBlueFirst
public static void printMixedBlueFirst(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
printMixedYellowFirst
public static void printMixedYellowFirst(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
printMixedYellowFirst
public static void printMixedYellowFirst(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
eprintMixedBlueFirst
public static void eprintMixedBlueFirst(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
eprintMixedBlueFirst
public static void eprintMixedBlueFirst(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
eprintMixedYellowFirst
public static void eprintMixedYellowFirst(String first, String second)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to log
-
eprintMixedYellowFirst
public static void eprintMixedYellowFirst(String first, String second, String third)
- Parameters:
first- the first part of the message to logsecond- the second part of the message to logthird- the third part of the message to log
-
printInfoBox
public static void printInfoBox()
-
statusVulnerable
public static void statusVulnerable()
-
statusOk
public static void statusOk()
-
statusOutdated
public static void statusOutdated()
-
statusDefault
public static void statusDefault()
-
statusNonDefault
public static void statusNonDefault()
-
statusUndecided
public static void statusUndecided(String statusType)
- Parameters:
statusType- the thing that was checked (e.g. vulnerability, configuration, ...)
-
increaseIndent
public static void increaseIndent()
-
decreaseIndent
public static void decreaseIndent()
-
getIndent
public static String getIndent()
- Returns:
- the current Logger indent
-
disableColor
public static void disableColor()
-
printCodebaseAttackIntro
public static void printCodebaseAttackIntro(String endpointName, String callName, String className)
- Parameters:
endpointName- remote endpoint that is attackedcallName- the name or signature of the call that was usedclassName- the class name used for the codebase attack
-
printGadgetCallIntro
public static void printGadgetCallIntro(String endpointName)
- Parameters:
endpointName- remote endpoint that is attacked
-
-