mirror of https://github.com/tp4a/teleport
add a testssh tool.
parent
04309f8fbf
commit
92da225dc4
|
@ -30,8 +30,12 @@
|
||||||
<file url="file://$PROJECT_DIR$/server/tp_core/core/ts_web_rpc.cpp" charset="GBK" />
|
<file url="file://$PROJECT_DIR$/server/tp_core/core/ts_web_rpc.cpp" charset="GBK" />
|
||||||
<file url="file://$PROJECT_DIR$/server/tp_core/core/ts_web_rpc.h" charset="GBK" />
|
<file url="file://$PROJECT_DIR$/server/tp_core/core/ts_web_rpc.h" charset="GBK" />
|
||||||
<file url="file://$PROJECT_DIR$/server/tp_core/protocol/rdp/librdp/core/config.h" charset="GBK" />
|
<file url="file://$PROJECT_DIR$/server/tp_core/protocol/rdp/librdp/core/config.h" charset="GBK" />
|
||||||
|
<file url="file://$PROJECT_DIR$/server/tp_core/protocol/rdp/librdp/rdp/x224.cpp" charset="GBK" />
|
||||||
|
<file url="file://$PROJECT_DIR$/server/tp_core/protocol/rdp/membuf.cpp" charset="GBK" />
|
||||||
|
<file url="file://$PROJECT_DIR$/server/tp_core/protocol/rdp/membuf.h" charset="GBK" />
|
||||||
<file url="file://$PROJECT_DIR$/server/tp_core/protocol/rdp/rdp_conn.cpp" charset="GBK" />
|
<file url="file://$PROJECT_DIR$/server/tp_core/protocol/rdp/rdp_conn.cpp" charset="GBK" />
|
||||||
<file url="file://$PROJECT_DIR$/server/tp_core/protocol/rdp/rdp_conn.h" charset="GBK" />
|
<file url="file://$PROJECT_DIR$/server/tp_core/protocol/rdp/rdp_conn.h" charset="GBK" />
|
||||||
|
<file url="file://$PROJECT_DIR$/server/tp_core/protocol/rdp/rdp_package.h" charset="GBK" />
|
||||||
<file url="file://$PROJECT_DIR$/server/tp_core/protocol/rdp/rdp_proxy.cpp" charset="GBK" />
|
<file url="file://$PROJECT_DIR$/server/tp_core/protocol/rdp/rdp_proxy.cpp" charset="GBK" />
|
||||||
<file url="file://$PROJECT_DIR$/server/tp_core/protocol/rdp/rdp_session.cpp" charset="GBK" />
|
<file url="file://$PROJECT_DIR$/server/tp_core/protocol/rdp/rdp_session.cpp" charset="GBK" />
|
||||||
<file url="file://$PROJECT_DIR$/server/tp_core/protocol/rdp/rdp_session.h" charset="GBK" />
|
<file url="file://$PROJECT_DIR$/server/tp_core/protocol/rdp/rdp_session.h" charset="GBK" />
|
||||||
|
|
|
@ -36,7 +36,7 @@ endif()
|
||||||
add_subdirectory(server/tp_core/core)
|
add_subdirectory(server/tp_core/core)
|
||||||
add_subdirectory(server/tp_core/protocol/ssh)
|
add_subdirectory(server/tp_core/protocol/ssh)
|
||||||
add_subdirectory(server/tp_core/protocol/telnet)
|
add_subdirectory(server/tp_core/protocol/telnet)
|
||||||
#add_subdirectory(server/testssh/testssh)
|
add_subdirectory(server/tp_core/testssh)
|
||||||
|
|
||||||
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/server/tp_core/protocol/rdp")
|
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/server/tp_core/protocol/rdp")
|
||||||
add_subdirectory(server/tp_core/protocol/rdp)
|
add_subdirectory(server/tp_core/protocol/rdp)
|
||||||
|
|
|
@ -6,3 +6,12 @@
|
||||||
|
|
||||||
// TODO: reference any additional headers you need in STDAFX.H
|
// TODO: reference any additional headers you need in STDAFX.H
|
||||||
// and not in this file
|
// and not in this file
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
# pragma comment(lib, "debug/ssh.lib")
|
||||||
|
#else
|
||||||
|
# pragma comment(lib, "release/ssh.lib")
|
||||||
|
#endif
|
||||||
|
#pragma comment(lib, "libeay32.lib")
|
||||||
|
#pragma comment(lib, "ws2_32.lib")
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,10 @@
|
||||||
// testssh.cpp : Defines the entry point for the console application.
|
// testssh.cpp : Defines the entry point for the console application.
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "stdafx.h"
|
//#include "stdafx.h"
|
||||||
|
|
||||||
#include <libssh/libssh.h>
|
#include <libssh/libssh.h>
|
||||||
|
#include <ex.h>
|
||||||
#ifdef _DEBUG
|
|
||||||
# pragma comment(lib, "debug/ssh.lib")
|
|
||||||
#else
|
|
||||||
# pragma comment(lib, "release/ssh.lib")
|
|
||||||
#endif
|
|
||||||
#pragma comment(lib, "libeay32.lib")
|
|
||||||
#pragma comment(lib, "ws2_32.lib")
|
|
||||||
|
|
||||||
|
|
||||||
void show_usage() {
|
void show_usage() {
|
||||||
printf("Usage:\n");
|
printf("Usage:\n");
|
||||||
|
@ -103,8 +95,8 @@ int main(int argc, char** argv)
|
||||||
retry_count += 1;
|
retry_count += 1;
|
||||||
if (retry_count >= 5)
|
if (retry_count >= 5)
|
||||||
break;
|
break;
|
||||||
//ex_sleep_ms(500);
|
ex_sleep_ms(500);
|
||||||
Sleep(500);
|
// Sleep(500);
|
||||||
rc = ssh_userauth_kbdint(sess, nullptr, nullptr);
|
rc = ssh_userauth_kbdint(sess, nullptr, nullptr);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -144,7 +136,8 @@ int main(int argc, char** argv)
|
||||||
retry_count += 1;
|
retry_count += 1;
|
||||||
if (retry_count >= 3)
|
if (retry_count >= 3)
|
||||||
break;
|
break;
|
||||||
Sleep(100);
|
ex_sleep_ms(100);
|
||||||
|
// Sleep(100);
|
||||||
rc = ssh_userauth_password(sess, nullptr, password);
|
rc = ssh_userauth_password(sess, nullptr, password);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue