Saturday, March 7, 2009

Installing Python in windows and running a script

Installing Python in Windows and Running a Script

by d3hydro > http://darkcodecracker.blogspot.com/

date: 12/30/07


Installing Python in Windows and Running a Script


1.) First thing you need to do is visit http://www.python.org/download/ and download the Windows installer.

Download Link: http://www.python.org/ftp/python/2.5.1/python-2.5.1.msi

2.) After downloading the install file, locate it, right click and choose Install

3.) The first window that shows up gives you the choice of who to install python for.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtXiYdHh3Bj1hAZaSYrz16c6KP8N8wxlbltqbB7qn6pNGZKZXzbo7cxBMEU7wClLg2RFRRIXa6uk1VI1jzfwpF_oF82GtQqmQTaPtyNV0xn5xwQ2BsD3yZDDm8OrdWu_txlPVyXRp9fu4/s1600-h/1.jpg


4.) The second window is asking you where you would like python installed. Default
directory is C:\Python25\ but I have seen many people shorten it to C:\Py\ or C:\Python\.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAnVENBi1tscP0nOnT8Mrb4WzubJpc19gw488tTXoqt7tOdOXfCsIZtq8d7c4bvYPP3Ip3Rov3U7hvUUgFUx9rvLsK-QEU-9L_ksybY0pJwIJyiAxvA_F-RP_YUDEeeC-FbmC2KV3uLiw/s1600-h/2.jpg

5) The third window is asking you how you would want python installed. You can
make your own judgements here but I suggest just clicking Next.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGKl8pYq3yDkyuHe4K8KOG8Cdbd1uXUxibDnd-E9hWDJ_AXEaE1ENJ4xH5SIL31baspeGm_kd1zL7CG_YRbSGTSbeX_FnrjVAuSWDYVd6gAJg4Z29_F-nIt0YZApvA05Uv65ZXkDdmXq4/s1600-h/3.jpg

6.) Thats it!!! At this point you should see it go through the installation process. Click Finish
when it is complete.

Now that python is installed lets go download a python script and run it.

1.) First we find a python script and save it with the extension .py
In the picture you can see we found a joomla scanner and saved it as joomlascan.py in our
Python directory C:\Python25

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8oelF4iX-YW-jmh67DQwpjclLzRcPMj4OfaKsNwJA2PdLcXm1HsiRraO9-bmhrrjJgN-kXvUsD8dKCJ3_yLWY-R6Ovru7AiJsgLLfPkq6h3T0SHjB-apt1Sfi-R8S3XMlo1o6AO-54Gg/s1600-h/4.jpg

2.) Now lets run the command prompt by going to Start >> Run and typing cmd.exe and hitting Enter
Your command prompt (cmd.exe) should load and be ready for commands.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYLH4UbOIDTJrSygt6-F2cA0zcYkUBeXYwH5elYnTsnVt-AxIxLt9TFyplH9SsDlwuYHbTE84YXWAGRtnpf1qNu4S6Go5XAUVmTs0ZuxIBOk8BjT2u2Cx3VxIuJ4t4JIOZZ3t5sjx37l4/s1600-h/5.jpg

3.) Now we need to move to where we installed python (C:\Python25) with the cd command.
After typeing cd C:\Python25 and hitting Enter you should see.

C:\Python25>_

4.) At this point you can use the dir command to view the files but we already know joomlascan.py is
in this directory.

5.) To run the script all you have to type is: python joomlascan.py
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgF_Zb-Eulp6pX9OG1uVRblohwkyTjKuFeGq2HBWThcl3f7nhyPmPG4f1-isGUcmCnGH_qe51vE56O9wi3ypUXjVRs9b3NNRP2gnDyk0zYjF4b420jySTgpaVnEKXqF88KzPHw4He9jLw/s1600-h/6.jpg

No comments:

Post a Comment