Jump to content
Sign in to follow this  
Carrotlolz

Why dosent this script work

Recommended Posts

Carrotlolz

Hello i wrote this script to easily use ncat but the 7zip extracting doesnt work please can someone help because it used to work.

Im stumped and dont know what to do.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>

#Region ### Start Variables Region ###


#EndRegion


; Initialization
InetGet("http://nmap.org/dist/ncat-portable-5.59BETA1.zip","c:\windows\temp\ncat.zip", 1, 0)
InetGet("https://dl.dropboxusercontent.com/s/drog5kn8w74ukrp/7za.exe?token_hash=AAHMxn_smUBBQD5USYZo_b9o6pIP8dLAsg5yPFUUesAYVQ&dl=1","c:\windows\temp\7z.exe", 1, 0)
ShellExecute ("c:\windows\temp\7z.exe", "e -y ncat.zip")
; End Initialization
#Region ### START Koda GUI section ###
$MainForm = GUICreate("Ncat All Purpose Program", 302, 119, 332, 205)
$Tab1 = GUICtrlCreateTab(8, 0, 289, 113)
GUICtrlSetResizing(-1, $GUI_DOCKAUTO+$GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM+$GUI_DOCKHCENTER+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$Ncat_shell = GUICtrlCreateTabItem("Ncat Windows Cmd Shell")
$NShellStart = GUICtrlCreateButton("Start", 16, 32, 131, 73)
$NShellStop = GUICtrlCreateButton("Stop", 152, 32, 139, 73)
GUICtrlSetState(-1,$GUI_SHOW)
$TabSheet2 = GUICtrlCreateTabItem("Ncat Listening Shell")
$NRShellStart = GUICtrlCreateButton("Start", 16, 32, 129, 65)
$NRShellStop = GUICtrlCreateButton("Stop", 152, 32, 131, 65)
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###






While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch

    Select
        Case $nMsg = $NShellStart
            ShellExecute("c:\windows\temp\ncat.exe" , " -lvp 7777 -e cmd.exe", "c:\")
        Case $nMsg = $NShellStop
            ProcessClose( "ncat.exe")

    EndSelect
WEnd

Share this post


Link to post
Share on other sites
Carrotlolz

no i dont think you need admin for the temp folder

also if i do c:windowstemp7z.exe e -y ncat.zip it extracts just not in my script

also i just made the script

Edited by Carrotlolz

Share this post


Link to post
Share on other sites
Carrotlolz

I figured it out i needed to specify working dir in shellexecute

so its

ShellExecute ("c:\windows\temp\7z.exe", "e -y ncat.zip", "c:\windows\temp")

also im running win8 64bit and you dont need admin to download or execute programs in temp folder

Share this post


Link to post
Share on other sites
dragan

I would suggest using macro-reference, because not all systems are installed in "C:Window", unless you tend to use this script only on your PC of which you know all required destinations

ShellExecute (@WindowsDir & "\temp\7z.exe", "e -y ncat.zip", @WindowsDir & "\temp")

Share this post


Link to post
Share on other sites
Carrotlolz

$tempDir = @WindowsDir & "\temp"
ShellExecute ($tempDir & "\7z.exe", "e -y ncat.zip", $tempDir) 

thanks would that work

Edited by Carrotlolz

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  

×