• XSS.stack #1 – первый литературный журнал от юзеров форума

Automatic login through SendMessage

1stetcgoldmedal

floppy-диск
Пользователь
Регистрация
11.04.2020
Сообщения
2
Реакции
0
C#:
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows.Forms;

public class Program
{
    //include FindWindowEx
    [DllImport("user32.dll")]
    public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);


    [DllImport("user32.dll")]
    public static extern int SendMessage(IntPtr hWnd, int uMsg, int wParam, int lParam);

    //include SendMessage
    [DllImport("user32.dll")]
    public static extern int SendMessage(IntPtr hWnd, int uMsg, int wParam, string lParam);
    
    [DllImport("user32.dll")]
    public static extern IntPtr SendMessage(IntPtr hWnd, int uMsg, IntPtr wParam, IntPtr lParam);

    //this is a constant indicating the window that we want to send a text message
    const int WM_SETTEXT = 0X000C;
    const int WM_KEYDOWN = 0x0100;
    const int WM_KEYUP = 0x0101;
    static void Main(string[] args)
    {
        //getting notepad's process | at least one instance of notepad must be running
        Process notepadProccess = Process.GetProcessesByName("Codns3")[0];

        //getting notepad's textbox handle from the main window's handle
        //the textbox is called 'Edit'
        IntPtr notepadTextbox = FindWindowEx(notepadProccess.MainWindowHandle, IntPtr.Zero, "Edit", null);//창핸들

        SendMessage(notepadTextbox, WM_SETTEXT, 0, "MYID");
    }
}
Each time you start a specific selection radio form followed by
You must enter your nickname & password & a specific decimal integer.
Nicknames and passwords are automatically saved, but you have to re-enter a specific decimal number every time you reboot your computer, and you have to go through a specific radio form when you first start.
Dumb system. I want to do this automatically when the computer is turned on.
By registering in the startup program.
The progress so far has been completed until entering my specific ID in the text box.
I need to add "Tab" & "Enter" & "Up Arrow" in the future.
Can you help me with this?

Video for understood : https://streamable.com/4bxt0u
 


Напишите ответ...
  • Вставить:
Прикрепить файлы
Верх