Skip to content

Commit 8cd58aa

Browse files
authored
Merge pull request #255 from microsoft/add-iwr-as-flow-source
PS: Add more flow sources
2 parents 3101cc8 + d198877 commit 8cd58aa

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

powershell/ql/lib/semmle/code/powershell/frameworks/Microsoft.PowerShell.model.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ extensions:
66
- ["microsoft.powershell.utility!", "Method[read-host].ReturnValue", "stdin"]
77
- ["microsoft.powershell.utility!", "Method[select-xml].ReturnValue[path]", "file"]
88
- ["microsoft.powershell.utility!", "Method[format-hex].ReturnValue[path]", "file"]
9+
- ["microsoft.powershell.utility!", "Method[invoke-webrequest].ReturnValue", "remote"]
10+
- ["microsoft.powershell.utility!", "Method[iwr].ReturnValue", "remote"]
11+
- ["microsoft.powershell.utility!", "Method[wget].ReturnValue", "remote"]
12+
- ["microsoft.powershell.utility!", "Method[curl].ReturnValue", "remote"]
13+
- ["microsoft.powershell.utility!", "Method[invoke-restmethod].ReturnValue", "remote"]
14+
- ["microsoft.powershell.utility!", "Method[irm].ReturnValue", "remote"]
915

1016
- addsTo:
1117
pack: microsoft/powershell-all

powershell/ql/test/library-tests/frameworks/microsoft_powershell/test.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ $xmlQuery = "/Users/User"
55
$path = "C:/Users/MyData.xml"
66
$xmldata = Select-Xml -Path $path -XPath $xmlQuery # $ type="file stream"
77

8-
$hexdata = Format-Hex -Path $path -Count 48 # $ type="file stream"
8+
$hexdata = Format-Hex -Path $path -Count 48 # $ type="file stream"
9+
10+
$remote_data1 = Iwr https://example.com/install.ps1 # $ type="remote flow source"
11+
$remote_data2 = Invoke-RestMethod -Uri https://blogs.msdn.microsoft.com/powershell/feed/ # $ type="remote flow source"

0 commit comments

Comments
 (0)