forked from HawksRepos/PTS-Team
-
Notifications
You must be signed in to change notification settings - Fork 55
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
MrDoobPG
authored and
MrDoobPG
committed
Sep 11, 2019
1 parent
275cc71
commit a8b96a1
Showing
1 changed file
with
40 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,40 @@ | ||
#!/bin/bash | ||
##usercheck | ||
if [ $(grep "1000" /etc/passwd | cut -d: -f1 | awk '{print $1}') ]; then | ||
usermod -aG sudo $(grep "1000" /etc/passwd | cut -d: -f1 | awk '{print $1}') | ||
sudo usermod -s /bin/bash $(grep "1000" /etc/passwd | cut -d: -f1 | awk '{print $1}') | ||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | ||
echo "" | ||
echo " ✅ PASSED ! We found the user UID " $(grep "1000" /etc/passwd | cut -d: -f1 | awk '{print $1}') | ||
echo "" | ||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | ||
else | ||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | ||
echo " ⌛ INFO ! " | ||
echo " ⌛ INFO ! Only lowercase and dont empty parts" | ||
echo " ⌛ INFO ! Enter a password (8+ chars)" | ||
echo " ⌛ INFO ! " | ||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | ||
echo "" | ||
read -p "Enter username : " username | ||
read -s -p "Enter password : " password | ||
echo "" | ||
egrep "^$username" /etc/passwd >/dev/null | ||
pass=$(perl -e 'print crypt($ARGV[0], "password")' $password) | ||
useradd -m -p $pass $username | ||
usermod -aG sudo $username | ||
sudo usermod -s /bin/bash $username | ||
echo "" | ||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | ||
echo " ✅ PASSED ! User has been added to system!" | ||
echo " ✅ PASSED ! Your Username : " $username | ||
echo " ✅ PASSED ! Your Password : " $password | ||
echo " ✅ PASSED ! " | ||
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | ||
fi | ||
tee <<-EOF | ||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
😂 What a Lame name: $(grep "1000" /etc/passwd | cut -d: -f1 | awk '{print $1}') | ||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
EOF | ||
exit 0 |