I'm trying to use the app wapiti to make some security test in a web project running in localhost, but i have some problems with the syntax of Python. I follow the instructions that they give in wapiti project site and write this:
C:\Python27\python C:\Wapiti\wapiti.py http://server.com/base/url/
but i get this:
SintaxError: Invalid Sintax
I had read that the syntax of python changed in that version... I really need help please.
Looks like Wapiti prefers Python 2.3. I'm judging by Wapiti's copyright date of 2006 and a note in its manual that one of its options doesn't work in Python 2.4.
You can simply install Python 2.3. If it's within your skills, you might want to install it in a virtual machine or a Python virtualenv.
Do this setting first
Go to control panel->system security->system->Advance system settings->click Environmentvariables--> change the path in listbox->
variable value =;C:\Python27\ concatenate this with actual text..
run command prompt
go to wapiti file path
example:
D:\wapiti\wapiti-2.2.1\src\python wapiti.py http://domainname.com/ -[options]
D:\wapiti\wapiti-2.2.1\src\python wapiti.py http://domainname.com/ -s
D:\wapiti\wapiti-2.2.1\src\python wapiti.py http://domainname.com/ -h
Related
I'm trying to get python to run my scripts via CMD line.
note: idr if the book said where (a specific place to store my files for) python to access them but scanning back over the beginning I didn't find any relation to it.
According to this book https://automatetheboringstuff.com/2e/appendixb/ I am supposed to be able to type python (script.py) in command line just like this and it should run the script:
Here's the error I am getting upon execution, compared to the example from the book below it to show that this is supposed to work.
CMD LINE OUTPUT :
Microsoft Windows [Version 10.0.18362.1016]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\Armagon>python conway.py
python: can't open file 'conway.py': [Errno 2] No such file or directory
C:\Users\Armagon>
As you can see I get a python Error and researching this has given me nothing I found useful.
Here is the exact sample quoted from the book:
Microsoft Windows [Version 10.0.17134.648]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\Users\Al>python hello.py
Hello, world!
C:\Users\Al>
First off, doing some research I have found a way to make it work, by cd(change directory) to the direct path of the folder containing the scripts C:\Users\Armagon\Desktop\mystuff. This helps to verify that the script I am trying to run is in fact located there and I've spelled it correctly.
But, according to everything I've followed up to this point I shouldn't have to do it this way.
The scripts are on my desktop all in the same folder called mystuff.
Following this link as well as a video Add a directory to Python sys.path so that it's included each time I use Python
I added the mystuff folder to PYTHONPATH in environment variables exactly as suggested. Here is a partial output of the sys.path (ran from IDLE) that shows mystuff filepath is added, so I'm pretty sure I did that part right.
['', 'C:\\Program Files\\Python38\\Lib\\idlelib', 'C:\\Users\\Armagon\\Desktop\\mystuff']
Maybe I've confused what is supposed to be happening here
I am operating under the assumption (based off what I've learned so far) that when CMD executes the line: python (script).py
It's supposed to run python.
Which in turn python is supposed to find my scripts on desktop (by the PYTHONPATH environment variable I created) and execute the script typed in CMD.
I've tried a lot of things in the process of getting just this far. I'd really appreciate if someone could point out what it is I'm overlooking to run python scripts from my desktop just like the book. I'm not very skilled at present and will gladly add any information as needed if I have excluded pertinent info I apologize in advance.
You should be able to do this as long as the script is in the module search path, for example, the PYTHONPATH environment variable. You should then be able to run the script like this:
python -m script
Well, the cd way is the way to go to run a python file via the command prompt. There is no other way I can think of.
Follow these steps or this link -> https://www.wikihow.com/Use-Windows-Command-Prompt-to-Run-a-Python-File to do it:
1)Open command prompt. type cmd or command prompt in search bar or run and press enter key.
2)In command prompt, given that the folder you are trying to access is in desktop, type-> cd desktop\myStuff.. Press enter.
3)Just write- python filename.py and enter.
4)It should run automatically.
I have installed the latest windows 10 version of Git v 24 and use the standard recommended install as shown on a number of websites including https://zarkom.net/blogs/how-to-install-git-and-git-bash-on-windows-9140
he has said that his install recommends for vers 19 are still ok for v24 and just click on Next etc. I have had this confirmed with other help guides but on install I type in after the $ sign either python and or python3 and nothing happens but I can see when running a test file the bash:
/c/Users/nigel/AppData/Local/Microsoft/WindowsApps/python3: Permission denied
I don't have python3 installed there but in standard C:\Users\nigel\AppData\Local\Programs\Python.
I have powershell running ok and am using Sublime Text 3 ok I can run code I prepare in Powershell version 5.6.. whatever it is now standard install part of Windows10. No issues running Python IDLE either.
When I search the reg with regedit and type in git bash I cannot trace this odd link to Microsoft/*/Python as above but in that folder there is an odd link not seen previously not sure what installed that other than sometime ago I might have started an instll of python via M store but sure I didn't but this odd python language server may have got installed through something else?
C:\Users\nigel\AppData\Local\Microsoft\Python Language Server\stubs.v1 is all I can find but in windowapps I found 0kb of a couple of files that are odd ie python.exe and python3.exe and size says 0kb.
I cant seem to find how to amend git so that it stops looking in this odd location and looks in correct folder as stated above ie C:\Users\nigel\AppData\Local\Programs\Python
I would appreciate any help although I am using powershell and ST3 ok on my python courses on UDEMY. I have tried to look at environmental path etc but cant see any reference to this odd path link with windowapps ? I have amended path ok previously for other editors or ensured that the path was pointing to correct python. The only other version of python I have is with Jupyter/ananconda but that is self contained my word ie it doesn't fire up unless I am in Anaconda or jupyter hope that makes sense which I use on another course ie bootcamp course
I have some code working with python 3.6.6 but I have 3.7.2 in enviroment too.When I try to run my code in cmd, it's trying to run with 3.7.2.How can I chance it?
There are a couple of ways you can tell a script to run with a specific version of Python, commonly you'd use a shebang:
#!/user/bin/env/python3.x
However, I think this only works for Linux/Mac which it sounds like you aren't on if you're referring to cmd. You may want to check out this answer which has a few other options that may help: How do I tell a Python script to use a particular version
Alternatively you can set up a virtual environment, which allows you to run different versions of Python, modules and any other environment settings for a specific project. If that sounds like a better solution then this answer should help you out: (Easiest) Way to use Python 3.6 and 3.7 on same computer?
I wonder how to find out the version of the cygwin setup program (setup-x86 or setup-x86_64). I know there's setup.ini file when the setup program downloads stuff. There's a line "setup_version: 2.XXX" therein. Is there any direct way to get the version number? Something akin to "setup --version" on the command line.
There is no version command line as you can see from the help output
/setup-x86.exe -h
You can ask on the mailing list for this additional info to be added
as setup is currently under deep review.
The only way, currently available, is to look at the start window
I would like to setup VCAP without a script on my linux box (mostly for learning, but also for controlling which packages get installed). I want to do it for a production like system (so it's not my own linux box, but a server that I use for demo purposes)
I am using Ubuntu 10.04 and I have rvm 1.10 installed). I already asked this question on cloudfoundry support (http://support.cloudfoundry.com/entries/21004021-single-node-vcap-setup-without-a-script-chef-etc)
Really apprecaite your input
Looks like your post on the CF forums was updated. As mentioned there, documentation for self-install doesn't exist. Your best bet is to use the existing install scripts, read through what they're doing, and perform the process manually.
The original install script: https://raw.github.com/cloudfoundry/vcap/master/setup/install
The new Chef-based install script, which will replace the original script: https://github.com/cloudfoundry/vcap/blob/master/dev_setup/bin/vcap_dev_setup