December 9, 2012

Determining the Vendor by MAC

When performing a recon on a network, whether wireless or LAN based, you may come across devices identified by its MAC address. To get a better footprint of the environment, it is definitely useful to determine the type of device riding within the enterprise. This can usually be done by an nmap sweep of the local environment. Once MAC addresses are gathered, the vendor of the unknown device can be concluded by visiting the following:

https://standards.ieee.org/develop/regauth/oui/oui.txt.

The first three octets are usually reserved by the vendor.

October 6, 2012

How To Show Line Numbers In vi / vim Text Editor

To display line numbers along the left side of a window, type any one of the following:

:set number

or

:set nu


To turn off line number again enter the same command:

:set nu! 


If you need number every time you start vi/vim, append following line to your ~/.vimrc file:

set number 

Python - Editor Indentation

It is possible in most editors to set how the TAB and other control characaters are handled.

In vi  :set ts=4  will set up a 4 character tab.  Use echo ":set ts=4" >> ~/.exrc automaticaly set this at startup.

If you prefer to use nano use the following does the same echo "set tabsize 4" >> ~/.nanorc

h**p://www.python.org/dev/peps/pep-0008/


Python - Object Oriented

h**p://www.tutorialspoint.com/python/python_classes_objects.htm

How to Setup Python in a Windows Environment

Useful links on how to install and setup Python to run in a Linux environment:

h**p://blog.sadphaeton.com/2009/01/20/python-development-windows-part-1installing-python.html

h**p://blog.sadphaeton.com/2009/01/20/python-development-windows-part-2-installing-easyinstallcould-be-easier.html

Isolated Python Environments

Below is a link that is very useful in creating a Python environment:

http://iamzed.com/2009/05/07/a-primer-on-virtualenv/

I discovered it on a forum.

October 5, 2012

Virtual Routers and Switches for Testing

Something I discovered on the web, useful virtual environments:


Cisco Nexus 1000V

Vyatta Live Virtual CD

Vyatta Live CD

Live Web Test Labs

These are some useful live websites I discovered on a hacking forum:


 SPI Dynamics (live) -
 h**p://zero.webappsecurity.com/

 Cenzic (live)
hI**p://crackme.cenzic.com/

Watchfire (live) -
 h**p://demo.testfire.net/

Acunetix (live) -
 h**p://testphp.acunetix.com/
 h**p://testasp.acunetix.com
 h**p://testaspnet.acunetix.com

January 1, 2012

Appending to Python Path

I discovered this while browser. This is how you can add your directory path to Python:


Your path (i.e. the list of directories Python goes through to search for modules and files) is stored in the path attribute of the sys module. Since path is a list, you can use the append method to add new directories to the path.

For instance, to add the directory /home/me/mypy to the path, just do:

import sys
sys.path.append("/home/me/mypy")