password

How to reset a user password on AD without meeting complexity requirements

Open “Active Directory Users and Computers” tool

right click on your “domain” and then click “Properties”

Then click on “Attribute Editor” tab

Scroll down to “PWDPROPERTIES”, click to select the row and the click on “Edit” button

set the value to 0 and click “Apply”

now you can use non complex password to edit or create a new one.

After doing your needs, remember to reset the “PWDPROPERTIES” back to 1

Crack password on an Excel VBA Project

Please backup your files first!

Open the file(s) that contain your locked VBA Projects

Create a new xlsm file and store this code in Module1

code credited to Siwtom (nick name), a Vietnamese developer

Option Explicit
Private Const PAGE_EXECUTE_READWRITE = &H40
Private Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" _
            (Destination As Long, Source As Long, ByVal Length As Long)
Private Declare Function VirtualProtect Lib "kernel32" (lpAddress As Long, _
    ByVal dwSize As Long, ByVal flNewProtect As Long, lpflOldProtect As Long) As Long
Private Declare Function GetModuleHandleA Lib "kernel32" (ByVal lpModuleName As String) As Long

Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, _
            ByVal lpProcName As String) As Long

Private Declare Function DialogBoxParam Lib "user32" Alias "DialogBoxParamA" (ByVal hInstance As Long, _
            ByVal pTemplateName As Long, ByVal hWndParent As Long, _
            ByVal lpDialogFunc As Long, ByVal dwInitParam As Long) As Integer

    Dim HookBytes(0 To 5) As Byte
    Dim OriginBytes(0 To 5) As Byte
    Dim pFunc As Long
    Dim Flag As Boolean

    Private Function GetPtr(ByVal Value As Long) As Long
        GetPtr = Value
    End Function

    Public Sub RecoverBytes()
        If Flag Then MoveMemory ByVal pFunc, ByVal VarPtr(OriginBytes(0)), 6
    End Sub

    Public Function Hook() As Boolean
        Dim TmpBytes(0 To 5) As Byte
        Dim p As Long
        Dim OriginProtect As Long

        Hook = False

        pFunc = GetProcAddress(GetModuleHandleA("user32.dll"), "DialogBoxParamA")


        If VirtualProtect(ByVal pFunc, 6, PAGE_EXECUTE_READWRITE, OriginProtect) <> 0 Then

            MoveMemory ByVal VarPtr(TmpBytes(0)), ByVal pFunc, 6
            If TmpBytes(0) <> &H68 Then

                MoveMemory ByVal VarPtr(OriginBytes(0)), ByVal pFunc, 6

                p = GetPtr(AddressOf MyDialogBoxParam)

                HookBytes(0) = &H68
                MoveMemory ByVal VarPtr(HookBytes(1)), ByVal VarPtr(p), 4
                HookBytes(5) = &HC3

                MoveMemory ByVal pFunc, ByVal VarPtr(HookBytes(0)), 6
                Flag = True
                Hook = True
            End If
        End If
    End Function

    Private Function MyDialogBoxParam(ByVal hInstance As Long, _
            ByVal pTemplateName As Long, ByVal hWndParent As Long, _
            ByVal lpDialogFunc As Long, ByVal dwInitParam As Long) As Integer
        If pTemplateName = 4070 Then
            MyDialogBoxParam = 1
        Else
            RecoverBytes
            MyDialogBoxParam = DialogBoxParam(hInstance, pTemplateName, _
                               hWndParent, lpDialogFunc, dwInitParam)
            Hook
        End If
    End Function

Paste this code under the above code in Module1 and run it

    Sub unprotected()
        If Hook Then
            MsgBox "VBA Project is unprotected!", vbInformation, "*****"
        End If
    End Sub

Come back to your VBA Projects and enjoy.

Accesso SSH senza password

In una ipotetica LAN nella sottorete 192.168.0.0/24 la macchina da cui vogliamo effettuare l’accesso senza password ha l’indirizzo ip 192.168.0.2, mentre quella su cui vogliamo loggarci senza password ha 192.168.0.3.

Sulla macchina da cui vogliamo connetterci senza digitare la password (192.168.0.2), digitiamo il seguente comando per generare la chiave RSA:

[root@192.168.0.2 ]# ssh-keygen -b 2048 -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
f7:ec:0d:c8:f4:df:7a:6c:2b:1d:a1:59:ee:c7:ae:a0 
root@192.168.0.2

Poi copiamo la chiave che abbiamo generato nella macchina di destinazione

[root@192.168.0.2 ]# scp /root/.ssh/id_rsa.pub root@192.168.0.3:.

Sulla macchina su cui vogliamo autenticarci senza utilizzare la password digitiamo il seguente comando:

[root@192.168.0.3 ]#cat /root/id_rsa.pub >> /root/.ssh/authorized_keys

Finito, adesso dalla macchina 192.168.0.2 potremo loggarci sulla 192.168.0.3 senza digitare alcuna password, ma non viceversa.

Questa tecnica può essere usata per gestire le connessioni tramite rsync appoggiandosi al protocollo OpenSSH o per sfruttare comandi tipo scp per muovere file da un pc/server ad un altro anche tramite script automatici.

[root@192.168.0.2 ~]# ssh root@192.168.0.3
Last login: Thu Jul 19 15:20:29 2007 from 192.168.0.2
[root@192.168.0.3 ~]#