Jump to content

Command Line Parameter Help


 Share

Recommended Posts

Hi , 

i need to know about what is exactly commandline parameter 

following questions :

how to get the values which was assigned in command line parameter....

i have to decode a password of ex employee , he is no more in my office but i have got the EXE and decoded , but unable to understand about the command line , 

 

please find the script adn tell me what will be the reference values of command line  and how to decode if it was phrase.....

 

 

 

 

If $cmdline[0] = 4 Then
    $neid = $cmdline[1]
    $neip = $cmdline[2]
    $userid = $cmdline[3]
    $password = $cmdline[4]
    BlockInput(1)
    Local $sfldr1 = "C:\Users\" & @UserName & "\hit3"
    If DirGetSize($sfldr1) <> -1 Then
    Else
        DirCreate($sfldr1)
    EndIf
    Local $sfile = $sfldr1 & "\hit_devices.ini"
    If FileExists($sfile) Then
        FileDelete($sfile)
    EndIf
    WinWaitActive("HIT-W-R-3.3.0c(0)", "", 60)
    Sleep(1000)
    If WinExists("Welcome to Hit 3") Then
        Send("{TAB 3}")
        Sleep(1500)
        Send("{SPACE}")
        WinClose("Welcome to Hit 3")
    EndIf
    Send("^{d}")
    Sleep(1500)
    $winhandle1 = WinGetHandle("Create new device ini file")
    ControlClick($winhandle1, "", "[CLASS:Button; INSTANCE:2]")
    $winhandle2 = WinGetHandle("Device settings")
    ControlClick($winhandle2, "", "[CLASS:QWidget; INSTANCE:10]")
    ControlClick($winhandle2, "", "[CLASS:QWidget; INSTANCE:10]")
    Sleep(1000)
    Send("{TAB 2}")
    Sleep(1000)
    Send("{SPACE}")
    Sleep(1000)
    Send("hit_devices.ini")
    Sleep(1000)
    Send("+{TAB 6}")
    Sleep(1000)
    Send("{SPACE}")
    Sleep(1000)
    Send($sfldr1)
    Sleep(2500)
    Send("{ENTER}")
    Sleep(1500)
    Send("+{TAB 2}")
    Sleep(1000)
    Send("{ENTER}")
    Sleep(1000)
    Send("{TAB 5}")
    Sleep(1000)
    Send("{SPACE}")
    Sleep(1000)
    $winhandle3 = WinGetHandle("Edit new device details")
    Send("{TAB}")
    Send($neip)
    Sleep(500)
    Send("{TAB 2}")
    Sleep(500)
    Send("{DOWN 4}")
    Sleep(1000)
    Send("+{TAB 8}")
    Sleep(1000)
    Send($neid)
    Send("^{TAB 2}")
    Sleep(1000)
    Send("{TAB 2}")
    Send($userid)
    Send("{TAB}")
    Send($password)
    Sleep(1000)
    Send("{TAB 9}")
    Sleep(500)
    Send("^{TAB 2}")
    Sleep(500)
    Send("+{TAB 5}")
    Sleep(500)
    Send("{DOWN}")
    Sleep(500)
    Send("{SPACE}")
    Sleep(500)
    Send("+{TAB 3}")
    Sleep(500)
    Send("{SPACE}")
    Sleep(1000)
    Send("{TAB 4}")
    ControlClick($winhandle2, "", "[CLASS:QWidget; INSTANCE:10]")
    ControlClick($winhandle2, "", "[CLASS:QWidget; INSTANCE:10]")
    Sleep(1000)
    Send("{TAB 10}")
    Sleep(1000)
    Send("{SPACE}")
    Sleep(4000)
    BlockInput(0)
    Sleep(1000)
    Exit (0)
Else
    MsgBox(0, "Error", "Invalid number of argument(s).  Contact System Administrator.", 5000)
    BlockInput(0)
    Exit (0)
EndIf

Please help me out...

Link to comment
Share on other sites

Read it all a couple of times, not easy to understand.

So you want to know the parameters for the cmd line, it seems more or less obvious..

$neid = $cmdline[1]    Some ID

$neip = $cmdline[2]     Some IP

$userid = $cmdline[3]     A User ID

$password = $cmdline[4] A Password

What else do you need?

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

16 hours ago, careca said:

Read it all a couple of times, not easy to understand.

So you want to know the parameters for the cmd line, it seems more or less obvious..

$neid = $cmdline[1]    Some ID

$neip = $cmdline[2]     Some IP

$userid = $cmdline[3]     A User ID

$password = $cmdline[4] A Password

What else do you need?

Hi

i can understand that $cmdline[1] , 2 , 3 and 4 refers a var ,

 

but i want to know what these values refers... i mean what will be the values and where i can find in the script

 

example $cmdline[1] refers $neid ... but what is the value of $neid..... is it A or B or C or ....... X ?

which i need to find , and also where i can find.. since im very much confused about the Cmdline parameters so i cant understand.. 

 

please help me out...

Link to comment
Share on other sites

I've no idea, all 4 are used in send..

What happens if you run the exe in cmd line and with a help cmd or something?

like:

someapp.exe /?

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Link to comment
Share on other sites

Okay, let's try and stop confusing one another, shall we?:lol: CyBoRgWaR, as I understand your question, you just want to know what values your former employee used at the command line when starting this script, right? The script receives username and password at the command line, which it then parses to some other programme through Send commands later on.

Well. bad news,:P because once the process itself is no longer running, the command line parameters are (usually) no longer retrievable either, which makes perfect sense, because you wouldn't want somebody else to be able to retrieve your secret password by storing it in your start-up script or an ini file. So that's probably why this script was designed this way in the first place, so the password was only ever going to exist transiently as a command line parameter, and not physically stored anywhere.

Link to comment
Share on other sites

4 hours ago, RTFC said:

Okay, let's try and stop confusing one another, shall we?:lol: CyBoRgWaR, as I understand your question, you just want to know what values your former employee used at the command line when starting this script, right? The script receives username and password at the command line, which it then parses to some other programme through Send commands later on.

Well. bad news,:P because once the process itself is no longer running, the command line parameters are (usually) no longer retrievable either, which makes perfect sense, because you wouldn't want somebody else to be able to retrieve your secret password by storing it in your start-up script or an ini file. So that's probably why this script was designed this way in the first place, so the password was only ever going to exist transiently as a command line parameter, and not physically stored anywhere.

great explaination  ... thanks a lot , 

 

i have 2 more questions , 

well if i want to do a same script like that , example i want to create a $username and $password , so where can i mention that in script so that i can get a script as similar as the one which i posted..

need some examples plz plz..

second one , it that any way i can get the values of $username and $password ???????

Link to comment
Share on other sites

  • Moderators

You need to actually read the material on $CmdLine in the help file; you would find most of your own answers. If you do a search on Command Line Parameters, you will find an explanation of how to incorporate these into your script. In the case of the script in your OP, $neid is the first parameter, $neip is the second, $userid is third, and $password if last. So if you create a similar script, when you compile it to an executable you would run it like this:

<ExecutableName> /neid /neip /userid /password

Example: C:\MyExe.exe /neid1 /neip1 /JLogan3o13 /MyPassword2016!

Again, all spelled out for you in the help file.

Edit: As for decompiling an executable to retrieve the script, or the username and password, both subjects are off limits on this forum. Please familiarize yourself with the forum rules.

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

1 hour ago, JLogan3o13 said:

You need to actually read the material on $CmdLine in the help file; you would find most of your own answers. If you do a search on Command Line Parameters, you will find an explanation of how to incorporate these into your script. In the case of the script in your OP, $neid is the first parameter, $neip is the second, $userid is third, and $password if last. So if you create a similar script, when you compile it to an executable you would run it like this:

<ExecutableName> /neid /neip /userid /password

Example: C:\MyExe.exe /neid1 /neip1 /JLogan3o13 /MyPassword2016!

Again, all spelled out for you in the help file.

Edit: As for decompiling an executable to retrieve the script, or the username and password, both subjects are off limits on this forum. Please familiarize yourself with the forum rules.

Hi ,

This is what im expected....  you are awesome bro... thanks......

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...