Professional Documents
Culture Documents
Objetivos de la lección
Introducir módulos
o Instrucciones para Mac y Linux
o Instrucciones para Windows
Instalar módulos de Python
Objetivos de la lección
Esta lección muestra cómo descargar e instalar módulos de Python. Hay
muchas maneras de instalar módulos externos, pero para esta lección
vamos a utilizar un programa llamado pip. El programa pip viene
instalado por defecto en Python 2.7.9 y versiones más nuevas. Este
tutorial es muy útil para cualquiera que utilice versiones antiguas de
Python (lo que todavía es común).
Introducir módulos
Una de las principales ventajas de utilizar Python es el número de
librerías o bibliotecas de código excelentes que están amplia y
fácilmente disponibles y que te pueden ahorrar escribir mucho código, o
simplemente realizar una tarea particular de la manera más sencilla
(como crear un archivo CSV o recopilar información de una página web
de forma automática -webscraping). Cuando buscas en Google
soluciones a problemas, encuentras ejemplos de código que utilizan
librerías de las cuales no habías escuchado hablar antes. ¡No tengas
miedo! Una vez que estas bibliotecas están instaladas en tu
computadora, puedes utilizarlas importándolas al principio de tu código.
Puedes importar tantas librerías como quieras, por ejemplo:
import csv
import requests
import kmlwriter
import pprint
Para los nuevos usuarios de Python puede resultar un tanto intimidante
descargar e instalar por primera vez módulos externos. Hay muchas
maneras de hacerlo (aumentando así la confusión); esta lección explica
una de las formas más sencillas y la más común de instalar módulos de
Python.
curl -O https://bootstrap.pypa.io/get-pip.py
Una vez que descargaste el archivo get-pip.py, necesitas ejecutarlo con
el intérprete de Python. Sin embargo, si intentas ejecutar el script con
Python de esta manera:
python get-pip.py
La secuencia de comandos del script seguramante falle. Esto se debe a
que no tiene permisos para actualizar ciertos directorios en tu sistema
de archivos para evitar que scripts aleatorios puedan cambiar archivos
importantes e instalarte virus. En este caso, y en todos los casos en que
necesites dar permiso a un script seguro para escribir en las carpetas
del sistema, puedes utilizar el comando sudo(abreviatura de “Super User
DO”) delante del comando Python, como:
Building Nethunter
James Christopher Adduono edited this page on 21 Aug 2016 · 5 revisions
Pages 30
###Table of Contents
###NetHunter Developers
@binkybear
@jmingov
@fattire
@kalilinux
@jcadduono
And the community!
###NetHunter Community
Building NetHunter
Those of you who want to build a NetHunter image from our GitHub repository may
do so using our Python build scripts.
root@kali:~# git clone https://github.com/offensive-security/kali-nethunter
root@kali:~# cd kali-nethunter/nethunter-installer
Before you can build for a device, you will need to enter the nethunter-
installer directory and run ./bootstrap.sh. This will ask you a few questions before
downloading the devices folder.
The main build script is also located in the nethunter-installer directory and can
be used to build images for multiple devices and Android OS versions as shown
below:
root@kali:~/kali-nethunter/nethunter-installer# python build.py -h
usage: build.py [-h] [--device DEVICE] [--kitkat] [--lollipop] [--marshmallow]
[--nougat] [--forcedown] [--uninstaller] [--kernel]
[--nokernel] [--nosu] [--generic ARCH] [--rootfs SIZE]
[--release VERSION]
optional arguments:
-h, --help show this help message and exit
--device DEVICE, -d DEVICE
Allowed device names: htc_pmewl manta flounder flocm
flo grouper angler shamu shamucm bullhead
hammerheadmon hammerheadcm hammerhead makocm mako
shieldtablet oneplusxcm oneplus2cm oneplus2 oneplus3
oneplus1 h830 h850 hlteeur hltecan hltespr hltekor
hlteeur-touchwiz hltecan-touchwiz hltespr-touchwiz
hltekor-touchwiz hltedcm-touchwiz hltekdi-touchwiz
jfltexx klte kltekdi kltespr kltevzw kltechn klte-
touchwiz klteduos-touchwiz kltespr-touchwiz klteusc-
touchwiz kltevzw-touchwiz klteskt-touchwiz kltekdi-
touchwiz cancrocm a5ulte a5ulte-touchwiz
--kitkat, -kk Android 4.4.4
--lollipop, -l Android 5
--marshmallow, -m Android 6
--nougat, -n Android 7
--forcedown, -f Force redownloading
--uninstaller, -u Create an uninstaller
--kernel, -k Build kernel installer only
--nokernel, -nk Build without the kernel installer
--nosu, -ns Build without SuperSU installer
--generic ARCH, -g ARCH
Build a generic installer (modify ramdisk only)
--rootfs SIZE, -fs SIZE
Build with Kali chroot rootfs (full or minimal)
--release VERSION, -r VERSION
Specify NetHunter release version
root@kali:~/kali-nethunter/nethunter-installer#
To build a Lollipop image for a OnePlus One device, we would run build.py as
follows:
root@kali:~/kali-nethunter/nethunter-installer# python build.py -d oneplus1 --
lollipop
The resulting zip file image will be created in the nethunter-installer directory –
this is the zip file you will need to flash on your device later on.