Tag: python

Programming, Python

Install python3 packages with pip

Assuming that you have python2 also installed on the system. >> Install virtualenv sudo apt-get install virtualenvsudo apt-get install virtualenv >> Create shortcut virtualenv -p /usr/bin/python3 py3virtualenv -p /usr/bin/python3 py3 >> Activate shortcut source py3/bin/activatesource py3/bin/activate >> Install package pip install packagepip install package

Footprinting, Hacking, Reconnaissance

IPGeoLocation – Retrieve IP Geolocation information

IPGeoLocation is a small free, open-source tool, coded in python 3, capable of retrieving geolocation information for the targeted IP address. IPGeoLocation makes use of this IP Geolocation API – http://ip-api.com/docs/. You can find IPGeoLocation source code on Github. IPGeoLocation is licensed under GPLv3.

Reverse Engineering

PaiMei – a reverse engineering framework written in Python

PaiMei, is a reverse engineering framework consisting of multiple extensible components. The framework can essentially be thought of as a reverse engineer’s swiss army knife and has already been proven effective for a wide range of both static and dynamic tasks such as fuzzer assistance, code coverage tracking, data flow tracking and more. The largest …

Python

Line oriented command interpreter in Python

The Cmd class provides a simple framework for writing line-oriented command interpreters. A Cmd instance or subclass instance is a line-oriented interpreter framework. There is no good reason to instantiate Cmd itself; rather, it’s useful as a superclass of an interpreter class you define yourself in order to inherit Cmd‘s methods and encapsulate action methods. …

C, C++, Python

Integrate python with C/C++ components

ctypes is a foreign function library for Python. It provides C compatible data types, and allows calling functions in DLLs or shared libraries. It can be used to wrap these libraries in pure Python. ctypes exports the cdll, and on Windows windll and oledll objects, for loading dynamic link libraries. You load libraries by accessing …

Python

Obtain devices list with Python and pcapy

Install pcapy sudo apt-get install python-pcapysudo apt-get install python-pcapy Code import pcapy   devs = pcapy.findalldevs();   for dev in devs: print devimport pcapy devs = pcapy.findalldevs(); for dev in devs: print dev Run sudo python mysniffer.pysudo python mysniffer.py Output eth0 usbmon1 usbmon2 usbmon3 usbmon4 usbmon5 any loeth0 usbmon1 usbmon2 usbmon3 usbmon4 usbmon5 any lo …

Python

ARP scanning using python and scapy

Run the following scipt with administrative rights to discover all alive hosts on the network! #!/usr/bin/env python   import sys from scapy.all import *   if len(sys.argv) != 2: print "Usage: python arp-scan.py 192.168.1.0/24" sys.exit(1)   try: alive,dead=srp(Ether(dst="ff:ff:ff:ff:ff:ff")/ARP(pdst=sys.argv[1]), timeout=2, verbose=0) print "MAC – IP" for i in range(0,len(alive)): print alive[i][1].hwsrc + " – " + …