public async Task <IActionResult> Putmiscellaneous([FromRoute] int id, [FromBody] miscellaneous miscellaneous) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != miscellaneous.id) { return(BadRequest()); } _context.Entry(miscellaneous).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!miscellaneousExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public List <miscellaneous> ParseMiscellaneous(string logContent) { List <miscellaneous> miscs = new List <miscellaneous>(); var ma = Regex.Match(logContent, @"Adobe Malware Classifier.+\n(?:.\[\+\] (?<VAL>.+)\r\n)+"); foreach (Capture item2 in ma.Groups["VAL"].Captures) { miscellaneous m = new miscellaneous(); m.type = "Adobe Malware Classifier"; m.description = item2.Value; miscs.Add(m); } ma = Regex.Match(logContent, @"Anomalies/Flags.+\n(?:.\[\+\] (?<VAL>.+)\r\n)+"); foreach (Capture item2 in ma.Groups["VAL"].Captures) { miscellaneous m = new miscellaneous(); m.type = "Anomalies/Flags"; m.description = item2.Value; miscs.Add(m); } ma = Regex.Match(logContent, @"Anti-VM.+\n(?:.\[\+\] (?<VAL>.+)\r\n)+"); foreach (Capture item2 in ma.Groups["VAL"].Captures) { miscellaneous m = new miscellaneous(); m.type = "Anti-VM"; m.description = item2.Value; miscs.Add(m); } ma = Regex.Match(logContent, @"Anti-Dbg.+\n(?:.\[\+\] (?<VAL>.+)\r\n)+"); foreach (Capture item2 in ma.Groups["VAL"].Captures) { miscellaneous m = new miscellaneous(); m.type = "Anti-Dbg"; m.description = item2.Value; miscs.Add(m); } ma = Regex.Match(logContent, @"Embedded File\(s\).+\n(?:.\[\+\] (?<VAL>.+)\r\n)+"); foreach (Capture item2 in ma.Groups["VAL"].Captures) { miscellaneous m = new miscellaneous(); m.type = "Embedded File"; m.description = item2.Value; miscs.Add(m); } ma = Regex.Match(logContent, @"URLs.+\n(?:.\[\+\] (?<VAL>.+)\r\n)+"); foreach (Capture item2 in ma.Groups["VAL"].Captures) { miscellaneous m = new miscellaneous(); m.type = "URLs"; m.description = item2.Value; miscs.Add(m); } return(miscs); }
public async Task <IActionResult> Postmiscellaneous([FromBody] miscellaneous miscellaneous) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.miscellaneous.Add(miscellaneous); await _context.SaveChangesAsync(); return(CreatedAtAction("Getmiscellaneous", new { id = miscellaneous.id }, miscellaneous)); }