spudw2k Posted March 26, 2009 Share Posted March 26, 2009 (edited) At my job we get scanned frequently for vulnerabilities, and it is considered a vulnerability to have an account with a password that never expires. We have service accounts that we rely on being automated and we can't get ourselves into the business of changing service password on a reg basis; so what I have here is a way to trick the domain into believing an accounts password has not expired (we dubbed it tickling around here). Basically how it works is an Active Directory domain has a property for expired passwords (last time pwd was set). When the property becomes a 0 that means the password has expired and must be changed. Upon changing the password this property gets set to the time of change. I'm not sure if this is documented, but if you set this property to -1 (if it is set to 0), it sets the current date/time as the last pwd changed time. If you set the property to -1 and the property is not 0, then nothing happens. So, we created an OU just for these service accounts and I made a script to do the rest. Here's my implementation. #RequireAdmin #AutoIt3Wrapper_Change2CUI=y $objRootDSE = ObjGet("LDAP://RootDSE") $strDNSDomain = $objRootDSE.Get("DefaultNamingContext") $strContainer = "OU=Service.Accounts,OU=Domain Users," & $strDNSDomain $objOU = ObjGet("LDAP://" & $strContainer ) For $objUser in $objOU If $objUser.class = "user" Then $objUsr = ObjGet("LDAP://" & $objUser.name & "," & $strContainer) ConsoleWrite($objUsr.sAMAccountName & @CRLF) $objUsr.Put("PwdLastSet", 0) $objUsr.SetInfo $objUsr.Put("PwdLastSet", -1) $objUsr.SetInfo EndIf NextHere's one that works for Local Accounts. #AutoIt3Wrapper_Change2CUI=y $objOU = ObjGet("WinNT://" & @ComputerName & "/Administrators") For $objUser in $objOU.Members ConsoleWrite($objUser.name & @CRLF) $objUsr = ObjGet("WinNT://" & @ComputerName & "/" & $objUser.name) If IsObj($objUsr) Then $objUsr.Put("PasswordExpired",1) $objUsr.SetInfo $objUsr.Put("PasswordExpired",0) $objUsr.SetInfo EndIf Next edit: added check for user in LDAP method. Edited January 8, 2014 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
gseller Posted March 26, 2009 Share Posted March 26, 2009 Awesome!! I have done some work on trying to make a web watch keep alive at my work. We use a site minder on our intranet and I would love to get it to keep alive the session once opened for at least 8 hrs for our day. I have sadly been unsuccessful. I will share the code I have if anyone needs it just pm me. Link to comment Share on other sites More sharing options...
spudw2k Posted March 26, 2009 Author Share Posted March 26, 2009 Awesome!! I have done some work on trying to make a web watch keep alive at my work. We use a site minder on our intranet and I would love to get it to keep alive the session once opened for at least 8 hrs for our day. I have sadly been unsuccessful. I will share the code I have if anyone needs it just pm me.Interesting. I don't see how this is related, but hey...it's a public forum Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Developers Jos Posted March 26, 2009 Developers Share Posted March 26, 2009 Just curious: Is there any reason you set the PwdLastSet to 0 (Don't Expire) before setting it to 1 (Set last password change to today) Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
spudw2k Posted March 26, 2009 Author Share Posted March 26, 2009 (edited) Just curious: Is there any reason you set the PwdLastSet to 0 (Don't Expire) before setting it to 1 (Set last password change to today)Jos0 means expired, not don't expire.If it's not 0 to begin with then -1 does nothing. Edited March 26, 2009 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Developers Jos Posted March 26, 2009 Developers Share Posted March 26, 2009 0 means expired, not don't expire.You're right... Thats what I meant to say... If it's not 0 to begin with then -1 does nothing.Never tried it thats why I was curious. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
spudw2k Posted March 26, 2009 Author Share Posted March 26, 2009 (edited) Never tried it thats why I was curious.Yea, I thought this was interesting too. Here's the webpage that inspired me. Last post.edit: was perusing my old posts and found that the link above no longer shows the thread content I referenced. Oh well Edited May 1, 2013 by spudw2k Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now