Jump to content
Sign in to follow this  
socratessa

Alternative input

Recommended Posts

socratessa

Hello all,

I want to make an input field where the keypresses you make are captured and handled directly without using enter or tab.

I saw an example here i believe some time ago but i cant find it anymore.

The purpose for this is to make an alternative password input field that doesnt rely on the hide with dots parameter.

There are a lot of programs around that convert those astrixs into a readable text fast.

So what i like to do is when you hit a key is: capture the key store it into a $var and replace the typed key with an asterix

So when somebody uses an astrix password revealer the text that shows up are real asterixs or nothing at all

I dont need a complete solution on it but give me a hint on how it maybe could work.


Dont cry tomorrow about what you should have done yesterday. Just do it now.

Share this post


Link to post
Share on other sites
Andreik

Hello all,

I want to make an input field where the keypresses you make are captured and handled directly without using enter or tab.

I saw an example here i believe some time ago but i cant find it anymore.

The purpose for this is to make an alternative password input field that doesnt rely on the hide with dots parameter.

There are a lot of programs around that convert those astrixs into a readable text fast.

So what i like to do is when you hit a key is: capture the key store it into a $var and replace the typed key with an asterix

So when somebody uses an astrix password revealer the text that shows up are real asterixs or nothing at all

I dont need a complete solution on it but give me a hint on how it maybe could work.

You need something like this?

Global $INPUT

AdlibEnable("Verify",100)

$GUI = GUICreate("Write password",100,30,-1,-1,0x16C80000,0x00000181)
$INPUT = GUICtrlCreateInput("",5,5,90,20,0x20)
GUISetState(@SW_SHOW,$GUI)

While 1
    $MSG = GUIGetMsg()
    If $MSG = -3 Then
        AdlibDisable()
        Exit
    EndIf
    Sleep(20)
WEnd

Func Verify()
    If GUICtrlRead($INPUT) = "password" Then 
        MsgBox(0,"AutoIt","Correct password")
        Exit
    EndIf
EndFunc
Edited by Andreik

When the words fail... music speaks

Share this post


Link to post
Share on other sites
socratessa

You need something like this?

Global $INPUT

AdlibEnable("Verify",100)

$GUI = GUICreate("Write password",100,30,-1,-1,0x16C80000,0x00000181)
$INPUT = GUICtrlCreateInput("",5,5,90,20,0x20)
GUISetState(@SW_SHOW,$GUI)

While 1
    $MSG = GUIGetMsg()
    If $MSG = -3 Then
        AdlibDisable()
        Exit
    EndIf
    Sleep(20)
WEnd

Func Verify()
    If GUICtrlRead($INPUT) = "password" Then 
        MsgBox(0,"AutoIt","Correct password")
        Exit
    EndIf
EndFunc
No thats not what i ment this is just a simple input field with $es_password style and whatever you type in here can be easily reverted back with programs like astrix logger from nirsoft.

edit:

i think i found my solution here posted by MrCreator with his keypressed solution

http://www.autoitscript.com/forum/index.ph...mp;#entry396147

Edited by socratessa

Dont cry tomorrow about what you should have done yesterday. Just do it now.

Share this post


Link to post
Share on other sites
scriptjunkie

Maybe you could explain what you are trying to do exactly. I personally don't understand the reason behind this idea. The person typing the password would know what he is typing so why would he use a program to convert the asterix to the letters you are typing?? These programs are only useful if you have saved password that you typed earlier (like on a web site password form, or password to login to a chat messenger).

Share this post


Link to post
Share on other sites
oMBRa

search for _WinAPI_SetWindowsHookEx in the help file

Edited by oMBra

Share this post


Link to post
Share on other sites
FaT3oYCG

hi socratessa, i made this key logger about half an hour ago to check up what my family are doing on their accounts, here is the code.

<snipped by SmOke_N>

EDIT:

it would be easy to modify it to your needs.

Edited by SmOke_N

Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right.

Share this post


Link to post
Share on other sites
Andreik

You can not post a keylogger, especially as used in bad purposes.


When the words fail... music speaks

Share this post


Link to post
Share on other sites
socratessa

Maybe you could explain what you are trying to do exactly. I personally don't understand the reason behind this idea. The person typing the password would know what he is typing so why would he use a program to convert the asterix to the letters you are typing?? These programs are only useful if you have saved password that you typed earlier (like on a web site password form, or password to login to a chat messenger).

when the inputfield is filled and you leave youre pc unlocked its easy for somebody to get the password with the tools i mentioned. There are several solutions for this

- clear the field after it is filled

- put garbage in it after it is filled

- dont fill the password field at all when typing (best solution i think)

There is one thing that isnt covered and thats is typing, go away from youre keyboard without entering.

So i want to fill in garbage or spaces right after the char is typed.

Or best solution use unix style login dont show any typed char at all

Call me paranoid but who wouldnt be as a network administrator working for a bank.

Since the application i am building give access to the whole network i cant risk any chance of peaking eyes on the password.

the link i found

http://www.autoitscript.com/forum/index.ph...mp;#entry396147

already mentioned in my previous topic will help me enough i think.

@oMBra t4t will investigate that as well


Dont cry tomorrow about what you should have done yesterday. Just do it now.

Share this post


Link to post
Share on other sites
ProgAndy

Well, you can convert http://www.codeproject.com/KB/edit/SecEditEx.aspx

or do this:

#include <WinAPI.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <EditConstants.au3>
Global $HiddenPW, $ShouldShowTyped=False
#region - GUI Create
GUICreate('Get Password',200,100)
$PW = GUICtrlCreateInput("",10,10,20,20,$ES_PASSWORD)
$Clear = GUICtrlCreateButton("&Clear",30,10,40,20)
$Typed = GUICtrlCreateLabel("0",70,10,20,20)
$ShowTyped = GUICtrlCreateCheckbox("ShowTyped",90,10,100,20)
$Submit = GUICtrlCreateButton("ENTER",10,40,100,30,0x0001);$BS_DEFPUSHBUTTON
GUISetState()
#endregion
GUIRegisterMsg($WM_COMMAND,"MY_WM_COMMAND")
#region - GUI SelectLoop
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $Clear
            GUICtrlSetData($Typed,0)
            GUICtrlSetData($PW,"")
            $HiddenPW = ""
        Case $msg = $ShowTyped
            Switch BitAND(GUICtrlRead($ShowTyped),$GUI_CHECKED)=$GUI_CHECKED
                Case True
                    GUICtrlSetData($Typed,StringLen($HiddenPW))
                    $ShouldShowTyped = True
                Case False
                    GUICtrlSetData($Typed,0)
                    $ShouldShowTyped = False
            EndSwitch
        Case $msg = $Submit
            If $HiddenPW = "" Then
                MsgBox(0, '', "[[NO PASSWORD]]")
            Else
                MsgBox(0, '', $HiddenPW)
            EndIf
    EndSelect
WEnd
#endregion
Func MY_WM_COMMAND($hWnd,$uMsg,$wParam,$lParam)
    If _WinAPI_HiWord($wParam) = $EN_UPDATE And _WinAPI_LoWord($wParam)=$PW Then
        $HiddenPW &= GUICtrlRead($PW)
        GUICtrlSetData($PW,"")
        If $ShouldShowTyped Then GUICtrlSetData($Typed,StringLen($HiddenPW))
    EndIf
EndFunc

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites
socratessa

This is definitly what i want :mellow:

But one last question shouldnt i use "Return $GUI_RUNDEFMSG" to continue with the original message queue


Dont cry tomorrow about what you should have done yesterday. Just do it now.

Share this post


Link to post
Share on other sites
ProgAndy

you have 2 options:

1) use no return in the Func

or 2) user Return $GUI_RUNDEFMSG :mellow:

By default after finishing the user function the AutoIt internal message handler will be proceed.

That won't be if your Return a value (See WM_COMMAND in example) or if you use the keyword 'Return' without any value.


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×