SyntaxHighlighter

Showing posts with label Common Problems. Show all posts
Showing posts with label Common Problems. Show all posts

Tuesday, 5 July 2011

Forgotten your Windows Password?

If you have forgotten your Windows password, be it a simple login password or the local administrator password for a Windows Server then there are a few approaches you can take, listed in order or difficulty/time-taken:

1. Guess the password
2. Use an alternative administrative account to reset the password
3. Try to crack the password
4. Try to clear the password
5. Enable a hidden administrative account and then reset the password

1. Guess the password, or guess the password of another user with administrator privileges some common passwords can be found here http://www.whatsmypass.com/the-top-500-worst-passwords-of-all-time
Of course try some themes which may mean something the person who owns the account.

2. In any version of Windows, if you have another account that is an administrator and you know the password then you can log-in with that account and use this method to reset any passwords.  In Windows XP the administrator account is rarely used and often has a blank password.  Access it by going in to safemode - press F8 just before the "Starting Windows" splash screen shows.  Once you have logged on as administrator you can go to Start > Run: control userpasswords2
Select the user and then the "Reset Password" button.

3. Try to crack the password with Ophcrack http://ophcrack.sourceforge.net/.  Password cracking will work in most cases for XP and a lot of cases for Vista.  However, if you look through the tables page on the website you'll see that using this technique is virtual impossible for a password longer than 8 characters that includes upper and lower case letters, numbers and symbols.
Write the Ophcrack iso to a cd/dvd and reboot the computer from the CD.
If Ophcrack fails to run first time then it could be that it failed to mount the Windows partition.  So you will need to figure out which partition it is.  I did this with trial and error like so:   (Open a terminal window)
   a) mkdir /mnt/cdrive
   b) mount /dev/sda1 /mnt/cdrive
   c) ls /mnt/cdrive
In step c) you are looking out for a directory listing the same as your Windows C drive, the presence of a Windows directory is an obvious giveaway.  If /dev/sda1 does not hold your C drive then try /dev/sda2, then try /dev/sda3.  On older systems, i.e. with PATA (IDE) rather than SATA drives then you might find it is /dev/hda1 etc.
Once you have located and mounted your windows partition. Then you need to re-run the cracking utility:
   d) /home/tux/launch.sh
If you get permission denied errors then you should run the command starting with sudo, e.g. sudo mount /dev/sda1 /mnt/cdrive

4. Try to clear the password with chntpw
This method has worked for me on XP, 2003 and Vista installs and I have no reason to believe that it wouldn't work on Windows 7 or Server 2008.  The caveat is that servers tend to have RAID disks and so you will need a Linux distro with RAID drivers, such as Ubuntu server.
   a) mount the drive (see Method 3)
   b) sudo apt-get install chntpw  (at this step it failed, make sure you're connected to the Internet, in some cases you may need to first run sudo apt-get update)
   c) cd /mnt/cdrive/Windows/System32/config
   d) chntpw -u Administrator SAM
   e) select option 1 to clear the password, choose "y" to write the hive file, then reboot.
In Vista, the built-in administrator account is disabled by default and perhaps it is someone else's account which you need to clear the password on so choose chntpw -u "Joe Bloggs" SAM.
The last time I tried this it failed to clear the password.  So that's why I've written method 5. 

5. Enable a disabled administrative account with chntpw then reset the password from that account.  Note: if there is another administrator account in Windows which you do know the password for then you should use method 2.
You begin this one exactly the same as method 4 except at step e).
   a) mount the drive (see Method 3)
   b) sudo apt-get install chntpw 
   c) cd /mnt/cdrive/Windows/System32/config
   d) chntpw -u Administrator SAM
   e) select option 4 to unlock and enable, choose "y" to write the hive file, then reboot.
   f) Log on to Windows using the Administrator account, then proceed as in Method 2.
   g) Log-off Administrator and Log-on to the User who now has a new password.
   h) Finally hide the Administrator account again start a command prompt, in Vista or 7 type cmd into the start menu then right-click on cmd.exe and choose "run as administrator"
   i) type: net user administrator /active:no

Wednesday, 22 June 2011

Does your computer start-up too slowly?

Does your computer start up too slowly?
This could be down to a number of things but there are a few standard places to check:
  1. Amount of RAM in the computer – is there enough?
  2. Amount of free hard-disk space – is there more than 10% free?
  3. Is the Anti-Virus set to run upon startup – if so disable that option.
  4. Size of the user profile (my documents and desktop) – primarily a problem for domain users.
  5. Number of programmes loading at startup – the fewer the better.


The number of programmes loading at startup can yield a quick fix for older computers, and that’s where I’m focussing in Today’s blog, but I would not recommend jumping straight in and changing it as any changes here are likely to change the way some programmes work.  Once the other options have been ruled out and you (or the user) are aware of the effect, then you can go ahead and make the change.  But how will you make that change?

In Person
If you have sufficient knowledge to make the change and the computer is in front of you then by all means make the changes by running msconfig or the ever useful ccleaner.  Hide any Microsoft items and then usually you can disable most of the other items safely.  It’s probably worthwhile leaving the AntiVirus running though!  Offending items can be present in both “Startup Programs” and “Services”.

Using Remote Control
You could have a qualified IT Professional (such as at The PC Support Group), carry this out for you using their remote control technology.  Remote control technology enables an IT Professional to control your computer over the Internet without being physically present.  You, the user, need to stop whatever you’re doing and give them perhaps 30 minutes to carry out the above.  From the IT Professional’s perspective, this is a fairly common request .  Looking for bottlenecks can be done fairly quickly but then getting a list of startup items and investigating which ones to disable and which ones to leave can be quite time consuming and may inconvenience the user if they’re left waiting while this is done.  That’s where scripts come to the rescue.

KaseyaTM Scripts
KaseyaTM is by no means the only way of automating part of this speed-up but it forms the basis for The PC Support Group managed service, and scripting is just one part of it’s functionality.  When one of our customers says that their computer is starting up slowly then we can draw on this scripting engine to help.  First the usual bottlenecks, as listed above, are checked via the “system audit” function.  Then a list of startup items is retrieved – this allows The PC Support Group to confirm what to disable and what to leave.  We have two scripts to do this:
  • Export services
  • Export startupitems
These scripts are run, then the files retrieved (e.g. C:\exportserviceslist.txt) and reviewed.  Finally the cleanup script is customized to disable the necessary startup items.  The XML should be edited directly in an editor like Notepad++ and the relevant services/programs just copied & pasted over.  This script is then imported back into Kaseya again and scheduled to run on the user’s computer. 
This makes the work totally invisible to the user so that they can continue to work on their computer while we work on it in the background.  More productivity for them and more productivity for us J

NB: The inspiration for the script came from http://www.on-sitetechsupport.com/category/kaseya-scripts/  In the future the script could be modified to make it generic so that it includes all programmes likely to be encountered and skips those not relevant to that computer. The PC Support Group accepts no responsibility for the use of these scripts.

Export Services Script
 <?xml version="1.0" encoding="utf-8"?>  
 <ScriptExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.kaseya.com/vsa/2008/12/Scripting">  
  <Procedure name="ListServicesExport" treePres="3" id="35789810">  
   <Body description="Export list of services to a file then upload the file to the KServer.">  
    <If description="Export list of services to a file then upload the file to the KServer.">  
     <Condition name="True" />  
     <Then>  
      <Statement name="ExecuteShellCommand" continueOnFail="false">  
       <Parameter xsi:type="StringParameter" name="Command" value="sc query &gt;&gt; c:\ServicesList.txt" />  
       <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="User" />  
       <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />  
      </Statement>  
      <Statement name="GetFile" continueOnFail="false">  
       <Parameter xsi:type="StringParameter" name="RemoteFileName" value="c:\ServicesList.txt" />  
       <Parameter xsi:type="StringParameter" name="KServerFileName" value="ServicesList.txt" />  
       <Parameter xsi:type="EnumParameter" name="Action" value="OverwriteSendAlert" />  
      </Statement>  
     </Then>  
    </If>  
   </Body>  
  </Procedure>  
 </ScriptExport>  

Export Startup Items Script
 <?xml version="1.0" encoding="utf-8"?>  
 <ScriptExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.kaseya.com/vsa/2008/12/Scripting">  
  <Procedure name="ListStartupAppsExport" treePres="3" id="71790046">  
   <Body description="Exports the registry keys relating to Startup tasks and then Uploads the file using &amp;#34;Get File&amp;#34;&#xD;&#xA;See Scripts --&gt; Get File --&gt; Machine, in order to retrieve uploaded file.">  
    <If description="Exports the registry keys relating to Startup tasks and then Uploads the file using &amp;#34;Get File&amp;#34;&#xD;&#xA;See Scripts --&gt; Get File --&gt; Machine, in order to retrieve uploaded file.">  
     <Condition name="True" />  
     <Then>  
      <Statement name="ExecuteShellCommand" continueOnFail="false">  
       <Parameter xsi:type="StringParameter" name="Command" value="regedit /E c:\StartupTaskList.txt &quot;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\&quot;" />  
       <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="User" />  
       <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />  
      </Statement>  
      <Statement name="GetFile" continueOnFail="false">  
       <Parameter xsi:type="StringParameter" name="RemoteFileName" value="c:\StartupTaskList.txt" />  
       <Parameter xsi:type="StringParameter" name="KServerFileName" value="StartupTaskList.txt" />  
       <Parameter xsi:type="EnumParameter" name="Action" value="OverwriteSendAlert" />  
      </Statement>  
     </Then>  
    </If>  
   </Body>  
  </Procedure>  
 </ScriptExport>  

Remove Startup Items Script
 <?xml version="1.0" encoding="utf-8"?>  
 <ScriptExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.kaseya.com/vsa/2008/12/Scripting">  
  <Procedure name="removeStartupTasks" treePres="3" id="1505946189">  
   <Body description="Removes applications from the Registry RUN key. Removes services not required on startup.">  
    <If description="Removes applications from the Registry RUN key. Removes services not required on startup.">  
     <Condition name="True" />  
     <Then>  
      <Statement description="" name="DeleteRegistryValue" continueOnFail="true">  
       <Parameter xsi:type="StringParameter" name="Path" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\ISUSPM Startup" />  
      </Statement>  
      <Statement description="" name="DeleteRegistryValue" continueOnFail="true">  
       <Parameter xsi:type="StringParameter" name="Path" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\ISUSScheduler" />  
      </Statement>  
      <Statement description="" name="DeleteRegistryValue" continueOnFail="true">  
       <Parameter xsi:type="StringParameter" name="Path" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\MSKDetectorExe" />  
      </Statement>  
      <Statement description="" name="DeleteRegistryValue" continueOnFail="true">  
       <Parameter xsi:type="StringParameter" name="Path" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\YBrowser" />  
      </Statement>  
      <Statement description="" name="DeleteRegistryValue" continueOnFail="true">  
       <Parameter xsi:type="StringParameter" name="Path" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Adobe Photo Downloader" />  
      </Statement>  
      <Statement description="" name="DeleteRegistryValue" continueOnFail="true">  
       <Parameter xsi:type="StringParameter" name="Path" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\LogMeIn GUI" />  
      </Statement>  
      <Statement description="" name="DeleteRegistryValue" continueOnFail="true">  
       <Parameter xsi:type="StringParameter" name="Path" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\iTunesHelper" />  
      </Statement>  
      <Statement description="" name="DeleteRegistryValue" continueOnFail="true">  
       <Parameter xsi:type="StringParameter" name="Path" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\SunJavaUpdateSched" />  
      </Statement>  
      <Statement description="" name="DeleteRegistryValue" continueOnFail="true">  
       <Parameter xsi:type="StringParameter" name="Path" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Adobe Reader Speed Launcher" />  
      </Statement>  
      <Statement description="" name="DeleteRegistryValue" continueOnFail="true">  
       <Parameter xsi:type="StringParameter" name="Path" value="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Adobe ARM" />  
      </Statement>  
      <Statement description="" name="ExecuteShellCommand" continueOnFail="true">  
       <Parameter xsi:type="StringParameter" name="Command" value="sc stop JavaQuickStarterService &amp;&amp; sc config JavaQuickStarterService start= demand &gt;&gt;&gt;&gt; c:\scriptlog.txt" />  
       <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="User" />  
       <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />  
      </Statement>  
      <Statement description="" name="ExecuteShellCommand" continueOnFail="true">  
       <Parameter xsi:type="StringParameter" name="Command" value="sc stop OrangeMobileBroadband_Service &amp;&amp; sc config OrangeMobileBroadband_Service start= demand &gt;&gt;&gt;&gt; c:\scriptlog.txt" />  
       <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="User" />  
       <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />  
      </Statement>  
      <Statement description="" name="ExecuteShellCommand" continueOnFail="true">  
       <Parameter xsi:type="StringParameter" name="Command" value="sc stop WTGService &amp;&amp; sc config WTGService start= demand &gt;&gt;&gt;&gt; c:\scriptlog.txt" />  
       <Parameter xsi:type="EnumParameter" name="ExecuteAccount" value="User" />  
       <Parameter xsi:type="BooleanParameter" name="Is64Bit" value="False" />  
      </Statement>  
      <Statement description="" name="GetFile" continueOnFail="false">  
       <Parameter xsi:type="StringParameter" name="RemoteFileName" value="c:\scriptlog.txt" />  
       <Parameter xsi:type="StringParameter" name="KServerFileName" value="scriptlog.txt" />  
       <Parameter xsi:type="EnumParameter" name="Action" value="OverwriteNoAlert" />  
      </Statement>  
     </Then>  
    </If>  
   </Body>  
  </Procedure>  
 </ScriptExport>