url: http://ctf.infosecinstitute.com/levelone.php
flag: infosec_flagis_welcome
solution: Just see the first line of the source
url: http://ctf.infosecinstitute.com/leveltwo.php
flag: infosec_flagis_wearejuststarting
solution:
url: http://ctf.infosecinstitute.com/levelone.php
flag: infosec_flagis_welcome
solution: Just see the first line of the source
url: http://ctf.infosecinstitute.com/leveltwo.php
flag: infosec_flagis_wearejuststarting
solution:
| #!/usr/bin/env python | |
| """Simple HTTP Server With Upload. | |
| This module builds on BaseHTTPServer by implementing the standard GET | |
| and HEAD requests in a fairly straightforward manner. | |
| """ |
| # In the server | |
| sysctl net.ipv4.ip_forward=1 # enable ip forwarding | |
| iptables -t nat -A POSTROUTING -o <output> -j MASQUERADE # accept ip forwarding | |
| # In the client | |
| ip r add default via <ip> dev <dev> |
sudo apt-get update
sudo apt-get install python python-setuptools python-pip python-dev libxslt1-dev libxml2-dev libmysqlclient-dev libpq-dev libffi-dev postgresql lipjpeg-dev
sudo pip install -U virtualenv
virtualenv /clients/sentry/
source /clients/sentry/bin/activate
| from queue import Queue, PriorityQueue | |
| def bfs(graph, start, end): | |
| """ | |
| Compute DFS(Depth First Search) for a graph | |
| :param graph: The given graph | |
| :param start: Node to start BFS | |
| :param end: Goal-node | |
| """ |
| # To use this first you must install pygraphviz | |
| # $ sudo apt install graphviz-dev && sudo pip install pygraphviz | |
| from queue import Queue, PriorityQueue | |
| from pygraphviz import AGraph | |
| from os import path, makedirs | |
| counter = 0 | |
| def show(pth, edges, explored, frontier, start, end): |
| from random import sample, uniform, randrange, shuffle | |
| def is_circuit(chromosome): | |
| global adj_mat | |
| if adj_mat[chromosome[0]][chromosome[-1]] == -1: | |
| return False | |
| for i in range(len(chromosome) - 1): | |
| if adj_mat[chromosome[i]][chromosome[i+1]] == -1: | |
| return False |