Python For Penetration Testers

Wow!

vulnerablelife


Python for penetration testers

If you are involved in vulnerability research, reverse engineering or penetration testing, I suggest to try out the Python programming language. It has a rich set of useful libraries and programs. This page lists some of them.

Most of the listed tools are written in Python, others are just bindings for existing C libraries, i.e. they make those libraries easily usable from Python programs.



Network

  • Scapy: send, sniff and dissect and forge network packets. Usable interactively or as a library
  • pypcapPcapy and pylibpcap: several different bindings for libpcap
  • libdnet: low-level networking routines, including interface lookup and Ethernet frame transmission
  • dpkt: fast, simple packet creation/parsing, with definitions for the basic TCP/IP protocols
  • Impacket: craft and decode network packets. Includes support for higher-level protocols such as NMB and SMB
  • pynids: libnids wrapper offering sniffing, IP defragmentation, TCP stream reassembly…

View original post 1,027 more words

Advertisements

Linux pseudo files & cheat sheet

*A blog post that I’m actively collecting “Linux pseudo files and cheat sheets”

Files:

  • cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq –  Real time speed of the CPU(ability to adjust their speed to help in saving on battery/power usage)
  • ​​/proc Directory
    • /proc/cpuinfo | grep MHz  – The absolute (max) CPU speed
    • /proc/sys/net/ipv4/* – Refer kernel.org docs
    • /proc/net/tcp and /proc/net/tcp6 – Refer kernel.org doc for more info

Special Device Files:

  • /dev/null– Discards all data written to it but reports that the write operation succeeded[Read man]
  • /dev/full – Returns the error code ENOSPC (meaning “No space left on device”) on writing[Read man]
  • /dev/random – Special file that serves as a blocking pseudorandom number generator. It allows access to environmental noise collected from device drivers and other sources.(Block until additional environmental noise is gathered)[Read man]
  • /dev/urandom – Without block [Read man]
  • /dev/zero – Provides as many null characters as are read from it [Read More]

Directories:

  • /var/lock/ – Store lock files, which are simply files used to indicate that a certain resource (a database, a file, a device) is in use and should not be accessed by another process. Aptitude, for example, locks its database when a package manager is running.
  • /var/run – Used to store .pid files, which contain the process id of a running program. This is commonly used in services or other programs that need to make their process id’s available to other processes.

Commands:

  • lscpu – Display CPU architecture information
  • cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 40 | head -n 1 – Generates 40 characters long random string.
  • mtr – mtr combines the functionality of the traceroute and ping programs in a single network diagnostic tool.

Install Cheats:

1. Install virtual box in kali linux 2016 (kali-rolling)

Below are the dependency packages for virtual-box in in kali linux
1. libpng12 (Download .dep package, and install with command dpkg -i package_name)
2. libvpx1 (Download .dep package, and install with command dpkg -i package_name)
3. libssl1.0.0 (apt-get install libssl1.0.0)

Now goto virtual-box’s download page, download dep package for Debian 7 (“Wheezy”) version and then install the .deb package with dpkg -i package_name