Jump to content

Windows 7 Easy Setup Script


sober

Recommended Posts

@ECHO OFF

WinSendKeys -t 200 -w connections {Tab} {Tab} {Tab} {Tab} {ALTDOWN} {NUMPAD1} {NUMPAD1} {NUMPAD9} {ALTUP} {Tab} {Tab} {Tab} {Right} {Right} {Right} {Right} {Right} {Enter} {Down} {Down} {Enter} {Tab} {Tab} {Tab} {Tab} {Tab} {Right} {Tab} {SPACE} {Tab} {Down} {Down} {Down} {Down} {Down} {Down} {Tab} {SPACE} {Tab} {Tab} {Tab} {Enter} {ALTDOWN} {F4} {ALTUP}

WinSendKeys -t 200 -w Properties {Tab} {Tab} {Tab} {Tab} {Tab} {Right} {Tab} {SPACE} {Tab} {Down} {Down} {Down} {Down} {Down} {Down} {Tab} {SPACE} {Tab} {Tab} {Tab} {Enter} {ALTDOWN} {F4} {ALTUP}

ok first release of what is for now the finalized version there are two batch files, one to configure, one is for troubleshooting.

i utilize 7zip portable and winsendkeys, download link to those in readme, download to script at bottom of post

ok so first off readme:

v.1.1 win7easy for wifi pineapple

script uses 7 zip portable http://portableapps....7-zip_portable/

and winsendkeys by ath http://ath.dcmembers...winsendkeys.php

updated to only need one batch file,one sets up connections, second is for troubleshooting.

this file will set up your wireless network to share internet to your pineapple, and also configure your ethernet

to connect to the pineapple correctly, it utalizes 7zip and winsendkeys, but removes them at end by default.

what you need to do:

folder needs to be unzipped to downloads or desktop

you must specify the 7zip path as c:\7zip

known issues:

Control Panel\Network and Internet\Network Connections can not be full screen, it changes the keystrokes needed to setup wireless internet connection sharing, and breaks the script.

ics can not already be configured on wireless properties if it is winsendkeys will break

if you have any questions feel free to contact me, sober@hak5forums

configure pineapple connection.bat


@ECHO OFF

ECHO wifi pineapple quickstart brought to you by sober
pause




ECHO configuring lan
pause
set varip=172.16.42.42

set varsm=255.255.255.0

set vardns=8.8.8.8

pause
ECHO configuring local area connection
pause
netsh int ip set address name = "Local Area Connection" source = static addr = %varip% mask = %varsm%


netsh int ip set dns name = "Local Area Connection" source = static addr = %vardns%

pause

ECHO we need to install 7zip portable to c:\7zip


ECHO checking desktop and downloads for 7zip portable, remember to save to c:\7zip
c:\users\%username%\Desktop\win7easy\7-ZipPortable_9.20_Rev_2.paf.exe
c:\users\%username%\Downloads\win7easy\7-ZipPortable_9.20_Rev_2.paf.exe



cd c:\7zip\App\7-Zip
ECHO finding and extracting win send keys

7z e c:\users\%username%\Downloads\win7easy\WinSendKeys.zip
7z e c:\users\%username%\Desktop\win7easy\WinSendKeys.zip



ECHO launching adapters
cd C:\Windows\System32
ncpa.cpl
ECHO launching WinSendKeys
cd c:\7zip\App\7-Zip

call c:\users\%username%\Downloads\win7easy\wsk.bat
call c:\users\%username%\Desktop\win7easy\wsk.bat

REM silently remove 7zip/winkeys
cls
ECHO removing 7zip and winkeys
cd c:\
rmdir /Q /S c:\7zip
[/CODE]

wsk.bat

[CODE]
@ECHO OFF

WinSendKeys -t 200 -w connections {Tab} {Tab} {Tab} {Tab} {ALTDOWN} {NUMPAD1} {NUMPAD1} {NUMPAD9} {ALTUP} {Tab} {Tab} {Tab} {Right} {Right} {Right} {Right} {Right} {Enter} {Down} {Down} {Enter} {Tab} {Tab} {Tab} {Tab} {Tab} {Right} {Tab} {SPACE} {Tab} {Down} {Down} {Down} {Down} {Down} {Down} {Tab} {SPACE} {Tab} {Tab} {Tab} {Enter} {ALTDOWN} {F4} {ALTUP}


WinSendKeys -t 200 -w Properties {Tab} {Tab} {Tab} {Tab} {Tab} {Right} {Tab} {SPACE} {Tab} {Down} {Down} {Down} {Down} {Down} {Down} {Tab} {SPACE} {Tab} {Tab} {Tab} {Enter} {ALTDOWN} {F4} {ALTUP}
[/CODE]

test pineapple connection.bat

[CODE]
@ECHO OFF
ECHO releasing ip
ipconfig /release
pause
ECHO renewing ip
ipconfig /renew
pause
ECHO attempting 30 pings on pineapple, it may take longer before pineapple gui starts, (up to 5~mins) but it should be able to ping pineapple by last few pings, assuming it can ping pineapple you are configured correctly, may need to cycle power, or use reset button on bottom of pineapple if having issues, especially if the pineapple isnt new.
ping -n 20 172.16.42.1
ECHO happy hunting

start http://172.16.42.1/pineapple

ECHO username: root password: pineapplesareyummy
[/CODE]

download link:

http://www.mediafire.com/download.php?gtm5vh9upm78pf3

Edited by sober
Link to comment
Share on other sites

sidenote if anyone can find an easy way to launch the ics service let me know, i looked for well over an hour, and all i was able to do was enable/disable the service as a whole, not fully configure it on a single adapter.

Link to comment
Share on other sites

I'm not sure how to do it, but powershell might be a better option for you to use instead of batch files.

i looked into powershell, as well as scripting changes to the registry, but i still am unable to find what im looking for 100% script able. ;( will look into powershell more though. Have never actually tried to use it before.

Link to comment
Share on other sites

i have looked into net sh for quite awhile hoping to find some more functionality.

the third link should indeed be helpful, unfortunately my c++ is not amazing, but i can get by, will make it a project for a day im not working. hopefully these three links will allow me to piece together the puzzle, and possibly leave us with a script to even let users declare their own interfaces (lan/wlan)

http://msdn.microsof...d815252(v=vs.85).aspx

http://msdn.microsof...a364726(v=vs.85).aspx

http://msdn.microsof...a364730(v=vs.85).aspx

and of course the last step in full automation is going to take 90% of the time yet again :D

Edited by sober
Link to comment
Share on other sites

I'm pretty sure I've read somewhere you can't actually enable ICS on windows from the command line. At least not with any of the programs/commands that come with windows.

that is the problem i have been having, there are ways to "enable" the service, but actual configuration doesn't seem possible, which is why i hope to explore the icf/ics api to hopefully make the process more script able, but currently i think the script is rather straight forward, but i want this to eventually be something worthy of being added as the windows quick connect script.

also to dark, i will definitely experiment with the bridging my understanding is it does not by itself enable internet connection on extra devices, and either way ics needs to be enable to truly share it out, then again, seeing as the pineapple is a router, it should be filtering all traffic thru a single connection.

after looking into the guide closer my mind is fighting itself it looks like bridging only connects two networks, it doesn't allow network 1 to utalize the bandwidth or public ip of interface two, and without being able to use the public internet facing ip it shouldnt supply the clients on the pineapple access to the internet from the computer, in any case i will try it in morning, just got home for work, and thanks for all the input thus far.

and worst comes to worse i will find a way to force it to work :)

wait a second... i know there is a website that uses usb rubber ducky commands, is it possible to load that website, and or virtualize the same software to execute keyboard commands to configure the wireless network adapter???

off to work i go!

http://www.iducke.com/Encoder/IDE would be the website and i can generate a specific url, now to look at duckyscripting and figure out the commands i need to configure this all correctly

edit ****** removing non used code

rubber ducky commands after launching ncpa.cpl

edit, had to account for a few things, example selecting adapter, down as much as possible to select local even if you run vmware etc.

Edited by sober
Link to comment
Share on other sites

http://www.iducke.co...der/IDE/7t the link to the duck script i need, any clue why its making an inject.bin? i swear on one of the hak5 episodes, and the first time i used this as a test, it just worked...

also is there any other way to say virtualize the ducky

inject.bin is the file that the new duckys use.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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