diff --git a/AUTHORS.md b/AUTHORS.md index 241bef9..ad8df7f 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -11,6 +11,7 @@ patches or pull requests, in chronological order of their first contribution: - Wayne Jensen ([wjjensen](https://github.com/wjjensen)) - Rory McNamara ([psychomario](https://github.com/psychomario)) - Alexander Neumann ([fd0](https://github.com/fd0)) +- Adam Jacob Muller ([AdamJacobMuller](https://github.com/AdamJacobMuller)) Many more individuals have contributed by reporting bugs or feature requests. See [issue tracker on Github][1], `NEWS.md` and `git log` for details. diff --git a/NEWS.md b/NEWS.md index cf082fc..77e54af 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,8 @@ ### SSLsplit develop +- Added separate src/dst host and port format specifiers %S, %p, %D and %q + to -F (pull req #74 by @AdamJacobMuller). - Filenames generated by -S and -F %d and %s changed from [host]:port to host,port format and using underscore instead of colon in IPv6 addresses in order to be NTFS clean (issue #69). diff --git a/log.c b/log.c index 3591a76..97d0d2e 100644 --- a/log.c +++ b/log.c @@ -386,6 +386,14 @@ log_content_format_pathspec(const char *logspec, elem = addrbuf; elem_len = strlen(addrbuf); break; + case 'D': + elem = dsthost; + elem_len = strlen(dsthost); + break; + case 'p': + elem = dstport; + elem_len = strlen(dstport); + break; case 's': if (snprintf(addrbuf, sizeof(addrbuf), "%s,%s", srchost, srcport) < 0) { @@ -395,6 +403,14 @@ log_content_format_pathspec(const char *logspec, elem = addrbuf; elem_len = strlen(addrbuf); break; + case 'S': + elem = srchost; + elem_len = strlen(srchost); + break; + case 'q': + elem = srcport; + elem_len = strlen(srcport); + break; case 'x': if (exec_path) { char *match = exec_path; diff --git a/main.c b/main.c index e4a0423..50ecff3 100644 --- a/main.c +++ b/main.c @@ -154,7 +154,11 @@ main_usage(void) " -F pathspec content log: full data to sep files with %% subst (excl. -L/-S):\n" " %%T - initial connection time as an ISO 8601 UTC timestamp\n" " %%d - destination host and port\n" +" %%D - destination host\n" +" %%p - destination port\n" " %%s - source host and port\n" +" %%S - source host\n" +" %%q - source port\n" #ifdef HAVE_LOCAL_PROCINFO " %%x - base name of local process (requires -i)\n" " %%X - full path to local process (requires -i)\n" diff --git a/sslsplit.1 b/sslsplit.1 index fe9d5e6..821604c 100644 --- a/sslsplit.1 +++ b/sslsplit.1 @@ -394,10 +394,22 @@ The initial connection time as an ISO 8601 UTC timestamp. The destination host and port, separated by a comma, IPv6 addresses using underscore instead of colon. .TP +.I %D +The destination host, IPv6 addresses using underscore instead of colon. +.TP +.I %p +The destination port. +.TP .I %s The source host and port, separated by a comma, IPv6 addresses using underscore instead of colon. .TP +.I %S +The source host, IPv6 addresses using underscore instead of colon. +.TP +.I %q +The source port. +.TP .I %x The name of the local process. Requires \fB-i\fP to be used. @@ -685,7 +697,8 @@ SSLsplit was written by Daniel Roethlisberger . The following individuals have contributed code or documentation, in chronological order of their first contribution: -Steve Wills, Landon Fuller, Wayne Jensen, Rory McNamara and Alexander Neumann. +Steve Wills, Landon Fuller, Wayne Jensen, Rory McNamara, Alexander Neumann and +Adam Jacob Muller. .SH BUGS Use Github for submission of bug reports or patches: .LP