La práctica de hoy hará uso de una aplicación web vulnerable llamada Juice Shop
diseñada y creada por OWASP
con varios contribuyentes a lo largo de los años. Se fue creando con una serie de errores y fallas de seguridad para demostrar la alta tasa de probabilidad que un programador no implemente bien su diseño. A continuación haremos varios ejercicios con explicación.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import heapq | |
def dijkstra(graph, start, end): | |
heap = [(0, start)] | |
visited = set() | |
while heap: | |
(cost, u) = heapq.heappop(heap) | |
if u in visited: | |
continue | |
visited.add(u) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# definimos una matriz estática | |
# de 3 * 3 | |
A = [ | |
[1, 2, 3], | |
[4, 5, 6], | |
[7, 8, 9] | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from bs4 import BeautifulSoup | |
import requests | |
headers = { | |
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5)", | |
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", | |
"accept-charset": "cp1254,ISO-8859-9,utf-8;q=0.7,*;q=0.3", | |
"accept-encoding": "gzip,deflate,sdch", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
Lo primero que debes tomar en cuenta al usar Python es que los módulos pueden | |
ser importados globalmente al inicio del script, pero serán globales y estas | |
harán que tu código sea lento al cargar si son demasiados. | |
Puedes tener funciones específicas donde solamente ahí se usen dichos módulos, | |
y por ende puedes mejor cargarlos ahí. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<style> | |
.modal { | |
display: none; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
Programa de Python para imprimir los números de secuencia de una operación factorial. | |
Ingrese su número: 5 | |
120!=5x4x3x2x1 | |
""" | |
lista = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Código para determinar si un número es primo | |
*/ | |
class Primos | |
{ | |
/** | |
recibe un parámetro número tipo entero | |
*/ | |
static void es_primo(int n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
/* | |
Programa para encontrar el máximo y mínimo de una | |
lista de números | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
/* | |
Ordenamiento por el algoritmo Burbuja en C++ | |
Autor: Jayson Roberto De León Martínez | |
*/ | |
void cambio(int &a, int &b) |
OlderNewer