Minor optimization for portal globals replacement.

This commit is contained in:
Matias Barcenas 2017-08-15 19:57:04 -05:00
parent 9463b90896
commit fe2308ab77
1 changed files with 3 additions and 8 deletions

View File

@ -175,12 +175,7 @@ function captive_portal_set_site() {
cp -r "$FLUXIONPath/attacks/Captive Portal/sites/$sitePath.portal" \ cp -r "$FLUXIONPath/attacks/Captive Portal/sites/$sitePath.portal" \
"$FLUXIONWorkspacePath/captive_portal" "$FLUXIONWorkspacePath/captive_portal"
find "$FLUXIONWorkspacePath/captive_portal/" -type f -exec \ find "$FLUXIONWorkspacePath/captive_portal/" -type f -exec sed -i -e 's/$APTargetSSID/'"${APTargetSSID//\//\\\/}"'/g; s/$APTargetMAC/'"${APTargetMAC//\//\\\/}"'/g; s/$APTargetChannel/'"${APTargetChannel//\//\\\/}"'/g' {} \;;;
sed -i -e 's/$APTargetSSID/'"$APTargetSSID"'/g' {} \;
find "$FLUXIONWorkspacePath/captive_portal/" -type f -exec \
sed -i -e 's/$APTargetMAC/'"$APTargetMAC"'/g' {} \;
find "$FLUXIONWorkspacePath/captive_portal/" -type f -exec \
sed -i -e 's/$APTargetChannel/'"$APTargetChannel"'/g' {} \;;;
esac esac
} }
@ -206,11 +201,11 @@ function captive_portal_set_attack() {
# Add the PHP authenticator scripts, used to verify # Add the PHP authenticator scripts, used to verify
# password attempts from users using the web interface. # password attempts from users using the web interface.
local authenticatorFiles=("authenticator.php" "check.php" "update.php") local authenticatorFiles=("authenticator.php" "check.php" "update.php")
local FLUXIONWorkspacePathEscaped=$(echo "$FLUXIONWorkspacePath" | sed -e 's/\//\\\//g')
for authenticatorFile in "${authenticatorFiles[@]}"; do for authenticatorFile in "${authenticatorFiles[@]}"; do
cp "$FLUXIONPath/attacks/Captive Portal/lib/$authenticatorFile" \ cp "$FLUXIONPath/attacks/Captive Portal/lib/$authenticatorFile" \
"$FLUXIONWorkspacePath/captive_portal/$authenticatorFile" "$FLUXIONWorkspacePath/captive_portal/$authenticatorFile"
sed -i -e 's/\$FLUXIONWorkspacePath/'"$FLUXIONWorkspacePathEscaped"'/g' \ sed -i -e 's/\$FLUXIONWorkspacePath/'"${FLUXIONWorkspacePath//\//\\\/}"'/g' \
"$FLUXIONWorkspacePath/captive_portal/$authenticatorFile" "$FLUXIONWorkspacePath/captive_portal/$authenticatorFile"
chmod u+x "$FLUXIONWorkspacePath/captive_portal/$authenticatorFile" chmod u+x "$FLUXIONWorkspacePath/captive_portal/$authenticatorFile"
done done