-
-
Save AnshumanSrivastavaGit/eba0400e4c91362ca99f7f934edebbd1 to your computer and use it in GitHub Desktop.
Revisions
-
m8sec revised this gist
Jul 12, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,7 @@ # Author: m8r0wn # Description: Uses the Linux net commands to lookup a user in Active Directory # This is the Linux equivalent of: net user [Username] /domain # Usage: ./aduser_lookup.sh [username] [password] [DC-Server] [Lookup-User] if [ ! $1 ]; @@ -10,7 +11,7 @@ then exit 0 fi #Get info about single user in AD printf "\nAD User Lookup:\n" printf '%s\n' '-----------------------' printf "user edit fullname '$4'"| net rpc shell -U "$1"%"$2" -S $3|tail -n +2 -
m8sec revised this gist
Jun 8, 2018 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,8 @@ #!/usr/bin/env bash # Author: m8r0wn # Description: Uses the Linux net commands to lookup a user in Active Directory # Usage: ./aduser_lookup.sh [username] [password] [DC-Server] [Lookup-User] if [ ! $1 ]; then -
m8sec revised this gist
Jun 8, 2018 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ #!/usr/bin/env bash #Author: m8r0wn #Description: Uses the Linux net commands to lookup a user in Active Directory -
m8sec revised this gist
Jun 8, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #!/usr/bin/env bash #Author: m8r0wn #Description: Uses the Linux net commands to lookup a user in Active Directory if [ ! $1 ]; then -
m8sec created this gist
Jun 8, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ #!/usr/bin/env bash #Author: m8r0wn #Description: Lookup AD domain user info on Linux if [ ! $1 ]; then printf "[-] Usage: $0 Username Password DC_Server username_to_lookup\n" exit 0 fi #Get info about single user in ad printf "\nAD User Lookup:\n" printf '%s\n' '-----------------------' printf "user edit fullname '$4'"| net rpc shell -U "$1"%"$2" -S $3|tail -n +2 printf "user edit homedir '$4'" | net rpc shell -U "$1"%"$2" -S $3|tail -n +2 printf "user edit homedrive '$4'" | net rpc shell -U "$1"%"$2" -S $3|tail -n +2 printf "user edit logonscript '$4'" | net rpc shell -U "$1"%"$2" -S $3|tail -n +2 printf "user edit profilepath '$4'" | net rpc shell -U "$1"%"$2" -S $3|tail -n +2 printf "user edit description '$4'" | net rpc shell -U "$1"%"$2" -S $3|tail -n +2 printf "user edit disabled '$4'" | net rpc shell -U "$1"%"$2" -S $3|tail -n +2 output="$(printf "user edit autolock '$4'" | net rpc shell -U "$1"%"$2" -S $3|tail -n +2)" printf "${output} (Currently locked out)\n" #find users with password not set to change or no expiration output="$(printf "user edit pwnotreq '$4'" | net rpc shell -U "$1"%"$2" -S $3|tail -n +2)" printf "${output} (Password not required)\n" output="$(printf "user edit pwnoexp '$4'" | net rpc shell -U "$1"%"$2" -S $3|tail -n +2)" printf "${output} (Password never expire?)\n" printf "\nGroup Memberships:\n" printf '%s\n' '-----------------------' printf "user info '$4'" | net rpc shell -U "$1"%"$2" -S $3|tail -n +2 printf "\n"