KeyofBlueS / airgeddon-plugins

Enhanced functions and new features for airgeddon!
GNU General Public License v3.0
95 stars 14 forks source link

Bug in enabling full character passwords #22

Closed QianSong1 closed 6 months ago

QianSong1 commented 6 months ago

What is your plugin?

custom_portals.sh

What is your plugin version?

Latest version

What is your airgeddon version?

11.21

What is the expected behavior?

won't accidentally delete anything extra, check.htm

Describe the issue and the steps to reproduce it

image Add 18d;20d; to this variable in a loop; Such a string. But every time it is executed, it will be added, and when I operate it every time, it will become 18d; 20d; 18d; 20d;and so on.

There isn't much bug with this, but when I choose different custom_portals, this command

➜ grep  -Fn 'password=${password//[*&\/?<>]}' check.htm
18:     password=${password//[*&\/?<>]}
20:     password=${password//[*&\/?<>]}
➜ grep  -Fn 'password=${password//[*&\/?<>]}' check.htm
17:     password=${password//[*&\/?<>]}
19:     password=${password//[*&\/?<>]}

image image So the value of ${line_to delete_argument}becomes 18d; 20d; 18d; 20d; 18d; 20d; 17d; 19d Haha, this will delete too many things, making check.htm invalid

KeyofBlueS commented 6 months ago

Unfortunately, I can't test to reproduce your issue right now, but you could try adding a line at line 318 with unset lines_to_delete_argument:

    if [[ "${custom_portals_full_password}" = "true" ]]; then
        echo
        language_strings "${language}" "custom_portals_text_11" "red"
        if grep -Fq 'password=${password//[*&\/?<>]}' "${tmpdir}${webdir}${checkfile}"; then
----------------->  unset lines_to_delete_argument
            lines_to_delete="$(grep -Fn 'password=${password//[*&\/?<>]}' "${tmpdir}${webdir}${checkfile}" | awk -F':' '{print $1}')"
            for line_to_delete in ${lines_to_delete}; do
                lines_to_delete_argument="${lines_to_delete_argument}${line_to_delete}d;"
            done
            sed -i "${lines_to_delete_argument}" "${tmpdir}${webdir}${checkfile}"
        fi
        unset custom_portals_full_password
    fi

Let me know if it works please. Thanks.

QianSong1 commented 6 months ago

Added her at line 318. unset lines_to_delete_argument Now, it's working normally,

KeyofBlueS commented 6 months ago

Thanks :ok_hand: