Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Fix setup.sh #182

Merged
merged 13 commits into from
Apr 5, 2018
Merged

Fix setup.sh #182

merged 13 commits into from
Apr 5, 2018

Conversation

g0tmi1k
Copy link
Contributor

@g0tmi1k g0tmi1k commented Mar 27, 2018

There was some bad practices going on. This fixes it some of it.

@g0tmi1k
Copy link
Contributor Author

g0tmi1k commented Mar 27, 2018

Please could there be a tag release after.
So then the Kali package can also be updated

@ChrisTruncer
Copy link
Member

Thanks, setting up a clean VM to test this now. Always appreciate your help with this :)

There does seem to be one small but, getting this when running setup.sh

./setup/setup.sh: line 671: [: "9": integer expression expected

Will keep building out this VM to test this out

@ChrisTruncer
Copy link
Member

Also, I don't think this installs pywintypes within wine. It's erroring out with that error for a python based payload. Will continue to test.

@g0tmi1k
Copy link
Contributor Author

g0tmi1k commented Apr 2, 2018

Cool. Will fix them up.
btw, is there a reason why it needs pyton2 & python3?
Could it be just one or the other:

v3 ~

pip3 install pycrypto

v2 ~
sudo pip2 install pefile

@g0tmi1k
Copy link
Contributor Author

g0tmi1k commented Apr 2, 2018

@ChrisTruncer Fixed line 671.

I've not noticed any issues with pywintypes.
Could you give any more information/details?

@ChrisTruncer
Copy link
Member

It doesn't look to be installing the pywintypes library within python3 in Wine. To reproduce - use a clean VM, install Veil via sudo config/setup.sh -f -s. Once done installing, try generating any Veil python based payload (I'm using 33 the flat injection). When trying to "compile" with pyinstaller, it fails with the error shown below stating pywintypes library is not found.

pywintypes

@g0tmi1k
Copy link
Contributor Author

g0tmi1k commented Apr 3, 2018

Started to track down the issue... it only happens when you use setup.sh -s. (-f and not using anything is fine).


Update: Something because of pywin32-220.win32-py3.4.exe not like being silent installed.

Which has had an update since Veil-Evasion ~ https://github.com/Veil-Framework/Veil-Evasion/blob/master/setup/pywin32-219.win32-py2.7.exe.

So this isn't anything todo with the alteration which is in this PR, but another bug!


Solution: is to run a python script (Scripts/pywin32_postinstall.py) after its been extracted and moved to the correct folder

Final command: [ -e "SCRIPTS/pywin32_postinstall.py" ] && sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "${winedrive}/Python34/Scripts/pywin32_postinstall.py" "-silent" "-quiet" "-install" >/dev/null


Proof

g0tmi1k@kali-dev:~/Desktop/Veil$ ./Veil.py --setup

 [!] ERROR: Missing /usr/share/veil/config/setup.sh

 ==========================================================================
                  Veil (Setup Script) | [Updated]: 2018-04-02
 ==========================================================================
  [Web]: https://www.veil-framework.com/ | [Twitter]: @VeilFramework
 ==========================================================================

 [I] Kali Linux "2018.1" x86_64 detected...

 [I] Silent Mode: Enabled
 [I]  Force Mode: Enabled
...SNIP...
g0tmi1k@kali-dev:~/Desktop/Veil$
g0tmi1k@kali-dev:~/Desktop/Veil$
g0tmi1k@kali-dev:~/Desktop/Veil$ ./Veil.py -t Evasion -p python/shellcode_inject/flat.py --ip 127.0.0.01 --port 4444
...SNIP...
8768 INFO: Building EXE from out00-EXE.toc completed successfully.

===============================================================================
                                   Veil-Evasion
===============================================================================
      [Web]: https://www.veil-framework.com/ | [Twitter]: @VeilFramework
===============================================================================

 [*] Language: python
 [*] Payload Module: python/shellcode_inject/flat
 [*] Executable written to: /opt/veil/output/compiled/payload2.exe
 [*] Source code written to: /opt/veil/output/source/payload2.py
 [*] Metasploit RC file written to: /opt/veil/output/handlers/payload2.rc
g0tmi1k@kali-dev:~/Desktop/Veil$

- Fix pywintypes install bug (when silent)
- Moved wine folder
- Changed help screen order
- Setup to be silent and forced
- Fix kali non-root user bugs
- Able todo full words rather than letters at prompts
- Able todo capital letters at prompts
- Fix setup dependencies bug
- More verbose during setup.sh
- Changed file permissions not to be 0777!
- List tools on the main menu by default
@ChrisTruncer
Copy link
Member

Looks perfect now, merging in.

Thanks @g0tmi1k!

@ChrisTruncer ChrisTruncer merged commit 7951416 into Veil-Framework:master Apr 5, 2018
@g0tmi1k g0tmi1k deleted the setup branch April 5, 2018 12:51
@g0tmi1k
Copy link
Contributor Author

g0tmi1k commented Apr 5, 2018

🎉
Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants