Skip to content

Commit

Permalink
Rollback time structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Frankccv committed Nov 22, 2023
1 parent dbb3a19 commit d45a09b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
Binary file added Attack_NGAP.pcap
Binary file not shown.
8 changes: 4 additions & 4 deletions mmt-probe.conf
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ socket-output {

# Indicates where the traffic data will be dumped to pcap files
dump-pcap {
enable = true # set to true/false to enable/disable dumping packet
enable = false # set to true/false to enable/disable dumping packet
# output-dir = "/opt/mmt/probe/" # Location where files will be located
output-dir = "/home/frank/Documents/pcap" # Location where files will be located
protocols = {"ip"} # List of protocols appearing in a packet which will be dumped
Expand All @@ -161,7 +161,7 @@ security {
# then x*16 security threads will be used .
# If set to zero this means that the security analysis will be done by the threads of the probe .

exclude-rules = "44,111,103,105" # Range of rules to be excluded from the verification
exclude-rules = "44,111" # Range of rules to be excluded from the verification

rules-mask = "" # Mapping of rules to the security threads:
# Format: rules-mask = (thread-index:rule-range);
Expand Down Expand Up @@ -286,8 +286,8 @@ session-timeout {

# Indicates session based reporting
session-report {
enable = true
output-channel = {kafka, file} # see security.output-channel for more detailed information
enable = false
output-channel = { file} # see security.output-channel for more detailed information

# enable/disable specific reports for specific protocol applications
ftp = false
Expand Down
14 changes: 8 additions & 6 deletions src/modules/security/security.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,22 +270,24 @@ static void _print_security_verdict(
const char *exec_trace = mmt_convert_execution_trace_to_json_string( trace, rule );

int i;
struct timeval ts;
gettimeofday(&ts, NULL);
struct timeval ts1;


gettimeofday(&ts1, NULL);
struct tm *timeinfo;
time_t rawtime = ts.tv_sec;
time_t rawtime = ts1.tv_sec;
timeinfo = localtime(&rawtime);

// Format the time as a string
char buffer[25]; // Adjust the size as needed
strftime(buffer, sizeof(buffer), "%H:%M:%S", timeinfo);

// Append the milliseconds component
sprintf(buffer + strlen(buffer), ":%03ld", ts.tv_usec / 1000);
sprintf(buffer + strlen(buffer), ":%03ld", ts1.tv_usec / 1000);
printf("Timestamp detection %s\n",buffer);



struct timeval ts;
mmt_sec_decode_timeval(timestamp, &ts );
char message[ MAX_LENGTH_REPORT_MESSAGE ];
int offset = 0;
STRING_BUILDER_WITH_SEPARATOR( offset, message, sizeof( message ), ",",
Expand Down

0 comments on commit d45a09b

Please sign in to comment.