Skip to content

Commit

Permalink
Added Proxy Support
Browse files Browse the repository at this point in the history
  • Loading branch information
rvrsh3ll committed Oct 20, 2022
1 parent 94b3d5d commit 2dc7bc2
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion Find-Fruit.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,21 @@ HTTP Status Codes: 100 - Informational * 200 - Success * 300 - Redirection * 400
param (
[Parameter(Mandatory = $True)]
[String]$Rhosts,
[Parameter(Mandatory=$False)]
[Int]$Port,
[Parameter(Mandatory=$False)]
[String]$Path,
[Parameter(Mandatory=$False)]
[Int]$Timeout = 110,
[Parameter(Mandatory=$False)]
[Switch]$UseSSL,
[Parameter(Mandatory=$False)]
[ValidateRange(1, 100)]
[Int]$Threads
[Int]$Threads,
[Parameter(Mandatory=$False)]
[String]$WebProxy,
[Parameter(Mandatory=$False)]
[String]$ProxyPort
)

begin {
Expand Down Expand Up @@ -347,6 +356,8 @@ param (
try {
$WebRequest = [System.Net.WebRequest]::Create($URI)
$WebRequest.Headers.Add('UserAgent', $UserAgent)
$ProxyAddress = New-Object System.Net.WebProxy("http://$($WebProxy):$($ProxyPort)",$true)
$WebRequest.Proxy = $ProxyAddress
$WebResponse = $WebRequest.Timeout = $Timeout
$WebResponse = $WebRequest.GetResponse()
$WebStatus = $WebResponse.StatusCode
Expand Down Expand Up @@ -386,6 +397,8 @@ param (
'Path' = $Path
'Timeout' = $Timeout
'UserAgent' = $UserAgent
'WebProxy' = $WebProxy
'ProxyPort' = $ProxyPort
}

# kick off the threaded script block + arguments
Expand Down Expand Up @@ -445,10 +458,14 @@ HTTP Status Codes: 100 - Informational * 200 - Success * 300 - Redirection * 400
param (
[Parameter(Mandatory = $false)]
[String]$Dictionary,
[Parameter(Mandatory=$False)]
[Int]$Timeout = 110,
[Parameter(Mandatory=$False)]
[ValidateRange(1, 100)]
[Int]$Threads,
[Parameter(Mandatory=$False)]
[Switch]$FoundOnly,
[Parameter(Mandatory=$False)]
[String]$UrlList
)

Expand Down Expand Up @@ -486,6 +503,8 @@ param (
try
{
$WebRequest = [System.Net.WebRequest]::Create($URI)
$ProxyAddress = New-Object System.Net.WebProxy("http://$($WebProxy):$($ProxyPort)",$true)
$WebRequest.Proxy = $ProxyAddress
$WebResponse = $WebRequest.Timeout = $Timeout
$WebResponse = $WebRequest.GetResponse()
$WebStatus = $WebResponse.StatusCode
Expand Down Expand Up @@ -539,6 +558,8 @@ param (
'Timeout' = $Timeout
'FoundOnly' = $FoundOnly
'ComputerName' = $hostlist
'WebProxy' = $WebProxy
'ProxyPort' = $ProxyPort


}
Expand Down

0 comments on commit 2dc7bc2

Please sign in to comment.