-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Harri Klingsten
committed
Sep 8, 2023
1 parent
0bef4b7
commit 1512d9c
Showing
12 changed files
with
86 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 3 additions & 31 deletions
34
src/SecTools/PainKiller.PowerCommands.Bootstrap/whats_new.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,5 @@ | ||
# What is new? | ||
|
||
## Version 1.0.2.1 | ||
**Released 2023-07-24** | ||
- ```ReadLineService``` now has two static events by the ```OpenShortCutPressed``` Occurs when user press [`Ctrl + O`], ```SaveShortCutPressed``` Occurs when user press [`Ctrl + S`]. | ||
- ```DialogService.ListDialog``` now returns a ```Dictionary<int, string>``` instead of ```List<string>``` so string value and index is returned for each selected item. | ||
- ```ChecksumManager``` now exposing it´t functions for calculating MDF checksum. | ||
- ```DialogService``` standard dialogs has some minor improvements. | ||
- ```PowerCommandsManager.RunCustomCode``` now has a parameter ```RunFlowManager runFlow```. | ||
- Adjusted creation of commands using ```powercommand new --command Name``` so that the new command class now has the correct namespace. (removed PainKiller.PowerCommands.) | ||
## Version 1.0.2.0 | ||
**Released 2023-07-01** | ||
- Toolbar functionality moved to own ```ToolbarService``` and reworked it completely, not using timers anymore that caused problems, so it is now a more stable feature (but still a bit experimental). | ||
- Added PasswordPromptDialog to the ```DialogService```. | ||
- New List feature, display a list which selectable items. | ||
- ```DirCommand``` is now a Core command instead of a Demo command. | ||
- It is now possible to move the cursor up and down with ```CTRL``` + (```⬆️``` or ⬇️). | ||
## Version 1.0.1.0 | ||
**Released 2023-06-20** | ||
### Toolbar styled Commands | ||
- Added new base command class ```CommandWithToolbarBase``` that opens upp for a new way of designing your commands with a displayed toolbar in the bottom right corner. Can either be display suggestions or be set programmatically listening and reacting on to the cmd line input. | ||
- Added the constant for array splitter to the ```ConfigurationGlobals```, and refactored all code to use it, makes it easier to swap that if necessary. | ||
- Adjusted the run process so that RunCompleted is always triggered, when running async or when a exception is thrown. | ||
## Version 1.0.0.1 | ||
**Released 2023-06-12** | ||
### Capability to Run PowerCommand with a service account and using secrets | ||
If you want to run your PowerCommands application as a Windows scheduled task started by a service accounts that is not allowed to login on the machine, you need to do a couple of steps. | ||
|
||
- You need to copy the PainKiller directory from your %User%\AppData\Roaming to the corresponding one for the service account. | ||
- Copy the environment variable _encryptionManager and create the same as a system environment variable. EncryptionService will look for the system environment variable if the user environment variable is not there. | ||
- For your stored secrets you will need to to do the same thing and change target: User to target: Machine in the **PowerCommandsConfiguration.yaml** file. | ||
### Improved logging | ||
Every log post now includes the current user running the PowerCommand application, the Log commands has been re-designed to use suggestions instead of options where more appropriate. | ||
## Version 0.6.0.1 | ||
**Released 2023-09-08** | ||
- ```EpssCommand``` new command to retrive Exploit Prediction Score using the https://api.first.org/data/v1/epss API. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Cdxgen/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=dependencytrack/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Epss/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Sbom/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System.Net.Http.Json; | ||
using SecToolsCommands.DomainObjects; | ||
|
||
namespace SecToolsCommands.Commands; | ||
|
||
[PowerCommandDesign( description: "Show the EPSS score for a given CVE vulnerability.", | ||
arguments: "!<CVE>", | ||
example: "epss CVE-2022-27225")] | ||
public class EpssCommand : CommandBase<PowerCommandsConfiguration> | ||
{ | ||
public EpssCommand(string identifier, PowerCommandsConfiguration configuration) : base(identifier, configuration) { } | ||
|
||
public override RunResult Run() | ||
{ | ||
var cve = Input.SingleArgument; | ||
var url = $"{Configuration.Epss.ApiUrl}{cve}"; | ||
var httpClient = new HttpClient(); | ||
var result = httpClient.GetFromJsonAsync<ExploitPrediction>(url).Result; | ||
if (result == null || result.data.Length == 0) return Ok($"{url} returned no result"); | ||
WriteCodeExample("EPSS: ",result.data.OrderByDescending(d => d.date).First().GetPercent()); | ||
return Ok(); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/SecTools/SecToolsCommands/Configuration/EpssConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace SecToolsCommands.Configuration; | ||
|
||
public class EpssConfiguration | ||
{ | ||
public string ApiUrl { get; set; } = "https://api.first.org/data/v1/epss?cve="; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/SecTools/SecToolsCommands/DomainObjects/ExploitPrediction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace SecToolsCommands.DomainObjects; | ||
|
||
public class ExploitPrediction | ||
{ | ||
public string status { get; set; } | ||
public int statuscode { get; set; } | ||
public string version { get; set; } | ||
public string access { get; set; } | ||
public int total { get; set; } | ||
public int offset { get; set; } | ||
public int limit { get; set; } | ||
public ExploitPredictionScore[] data { get; set; } | ||
} |
12 changes: 12 additions & 0 deletions
12
src/SecTools/SecToolsCommands/DomainObjects/ExploitPredictionScore.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Globalization; | ||
|
||
namespace SecToolsCommands.DomainObjects; | ||
|
||
public class ExploitPredictionScore | ||
{ | ||
public string cve { get; set; } | ||
public string epss { get; set; } | ||
public string percentile { get; set; } | ||
public string date { get; set; } | ||
public string GetPercent() => double.TryParse(percentile, NumberStyles.Float, CultureInfo.InvariantCulture, out var value) ? $"{value * 100:0.00}%" : "-"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters