Cyb3rWard0g / Invoke-ATTACKAPI

A PowerShell script to interact with the MITRE ATT&CK Framework via its own API
MIT License
365 stars 82 forks source link

The request was aborted: Could not create SSL/TLS secure channel. #3

Closed ghost closed 5 years ago

ghost commented 5 years ago

Hey Roberto,

Have you see this error before? I'm running PS v5.1. Cheers

PS C:\Users\user01\Downloads\Invoke-ATTACKAPI-master> Import-Module .\Invoke-ATTACKAPI.ps1

  /$$$$$$  /$$$$$$$$ /$$$$$$$$ /$$$      /$$$$$$  /$$   /$$        /$$$$$$  /$$$$$$$  /$$$$$$
 /$$__  $$|__  $$__/|__  $$__//$$ $$    /$$__  $$| $$  /$$/       /$$__  $$| $$__  $$|_  $$_/
| $$  \ $$   | $$      | $$  |  $$$    | $$  \__/| $$ /$$/       | $$  \ $$| $$  \ $$  | $$
| $$$$$$$$   | $$      | $$   /$$ $$/$$| $$      | $$$$$/        | $$$$$$$$| $$$$$$$/  | $$
| $$__  $$   | $$      | $$  | $$  $$_/| $$      | $$  $$        | $$__  $$| $$____/   | $$
| $$  | $$   | $$      | $$  | $$\  $$ | $$    $$| $$\  $$       | $$  | $$| $$        | $$
| $$  | $$   | $$      | $$  |  $$$$/$$|  $$$$$$/| $$ \  $$      | $$  | $$| $$       /$$$$$$
|__/  |__/   |__/      |__/   \____/\_/ \______/ |__/  \__/      |__/  |__/|__/      |______/ V.0.9[BETA]

            Adversarial Tactics, Techniques & Common Knowledge API

[*] Author: Roberto Rodriguez @Cyb3rWard0g

[++] Pulling MITRE ATT&CK Data

[+++] Collecting Tactic

VERBOSE: GET https://attack.mitre.org/api.php?action=ask&format=json&query=[[Category:Tactic]]|?Has+description%23-ia|?Citation+reference|limit=9999 with 0-byte payload
irm : The request was aborted: Could not create SSL/TLS secure channel.
At C:\Users\user01\Downloads\Invoke-ATTACKAPI-master\Invoke-ATTACKAPI.ps1:1073 char:26
+                 $reply = irm $LookUpRequestURL -Verbose
+                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

gm : You must specify an object for the Get-Member cmdlet.
At C:\Users\user01\Downloads\Invoke-ATTACKAPI-master\Invoke-ATTACKAPI.ps1:1074 char:53
+                 $results = (($reply.query.results | gm) | ?{$_.Member ...
+                                                     ~~
    + CategoryInfo          : CloseError: (:) [Get-Member], InvalidOperationException
    + FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand

[+++] Collecting Technique

VERBOSE: GET
https://attack.mitre.org/api.php?action=ask&format=json&query=[[Category:Technique]]|?Has+CAPEC+ID|?Has+ID|?Has+analytic+details%23-ia|?Has+contributor|?Has+data+source|?Has+displ
ay+name|?Has+link+text|?Has+mitigation%23-ia|?Has+platform|?Has+tactic|?Has+technical+description%23-ia|?Has+technique+name|?Requires+permissions|?Requires+system|?Bypasses+defens
e|?Citation+reference|limit=9999 with 0-byte payload
irm : The request was aborted: Could not create SSL/TLS secure channel.
At C:\Users\user01\Downloads\Invoke-ATTACKAPI-master\Invoke-ATTACKAPI.ps1:1073 char:26
+                 $reply = irm $LookUpRequestURL -Verbose
+                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

gm : You must specify an object for the Get-Member cmdlet.
At C:\Users\user01\Downloads\Invoke-ATTACKAPI-master\Invoke-ATTACKAPI.ps1:1074 char:53
+                 $results = (($reply.query.results | gm) | ?{$_.Member ...
+                                                     ~~
    + CategoryInfo          : CloseError: (:) [Get-Member], InvalidOperationException
    + FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand

[+++] Collecting Group

VERBOSE: GET
https://attack.mitre.org/api.php?action=ask&format=json&query=[[Category:Group]]|?Has+ID|?Has+alias|?Has+description%23-ia|?Has+display+name|?Has+link+text|?Has+technique|?Uses+so
ftware|?Citation+reference|?Has+URL|limit=9999 with 0-byte payload
irm : The request was aborted: Could not create SSL/TLS secure channel.
At C:\Users\user01\Downloads\Invoke-ATTACKAPI-master\Invoke-ATTACKAPI.ps1:1073 char:26
+                 $reply = irm $LookUpRequestURL -Verbose
+                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

gm : You must specify an object for the Get-Member cmdlet.
At C:\Users\user01\Downloads\Invoke-ATTACKAPI-master\Invoke-ATTACKAPI.ps1:1074 char:53
+                 $results = (($reply.query.results | gm) | ?{$_.Member ...
+                                                     ~~
    + CategoryInfo          : CloseError: (:) [Get-Member], InvalidOperationException
    + FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand

[+++] Collecting Software

VERBOSE: GET
https://attack.mitre.org/api.php?action=ask&format=json&query=[[Category:Software]]|?Has+ID|?Has+alias|?Has+description%23-ia|?Has+display+name|?Has+link+text|?Has+software+type|?
Has+technique|?Citation+reference|limit=9999 with 0-byte payload
irm : The request was aborted: Could not create SSL/TLS secure channel.
At C:\Users\user01\Downloads\Invoke-ATTACKAPI-master\Invoke-ATTACKAPI.ps1:1073 char:26
+                 $reply = irm $LookUpRequestURL -Verbose
+                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

gm : You must specify an object for the Get-Member cmdlet.
At C:\Users\user01\Downloads\Invoke-ATTACKAPI-master\Invoke-ATTACKAPI.ps1:1074 char:53
+                 $results = (($reply.query.results | gm) | ?{$_.Member ...
+                                                     ~~
    + CategoryInfo          : CloseError: (:) [Get-Member], InvalidOperationException
    + FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand

[+++] Collecting Reference

VERBOSE: GET
https://attack.mitre.org/api.php?action=ask&format=json&query=[[Citation+text::+]]|?Citation+key|?Citation+text|?Has+title|?Has+authors|?Retrieved+on|?Has+URL|limit=9999 with
0-byte payload
irm : The request was aborted: Could not create SSL/TLS secure channel.
At C:\Users\user01\Downloads\Invoke-ATTACKAPI-master\Invoke-ATTACKAPI.ps1:1073 char:26
+                 $reply = irm $LookUpRequestURL -Verbose
+                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

gm : You must specify an object for the Get-Member cmdlet.
At C:\Users\user01\Downloads\Invoke-ATTACKAPI-master\Invoke-ATTACKAPI.ps1:1074 char:53
+                 $results = (($reply.query.results | gm) | ?{$_.Member ...
+                                                     ~~
    + CategoryInfo          : CloseError: (:) [Get-Member], InvalidOperationException
    + FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand

[+++] Collecting Techniques subobjects

VERBOSE: GET https://attack.mitre.org/api.php?action=ask&format=json&query=[[Has+technique+object::+]]|?Has+technique+description%23-ia|?Has+technique+object|limit=9999 with
0-byte payload
irm : The request was aborted: Could not create SSL/TLS secure channel.
At C:\Users\user01\Downloads\Invoke-ATTACKAPI-master\Invoke-ATTACKAPI.ps1:1073 char:26
+                 $reply = irm $LookUpRequestURL -Verbose
+                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

gm : You must specify an object for the Get-Member cmdlet.
At C:\Users\user01\Downloads\Invoke-ATTACKAPI-master\Invoke-ATTACKAPI.ps1:1074 char:53
+                 $results = (($reply.query.results | gm) | ?{$_.Member ...
+                                                     ~~
    + CategoryInfo          : CloseError: (:) [Get-Member], InvalidOperationException
    + FullyQualifiedErrorId : NoObjectInGetMember,Microsoft.PowerShell.Commands.GetMemberCommand
duzvik commented 5 years ago

Just add this code

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

before this line : https://github.com/Cyb3rWard0g/Invoke-ATTACKAPI/blob/8043676e5a52a5e0d80a58007ade0a564f48c1d9/Invoke-ATTACKAPI.ps1#L1073