Created
March 22, 2014 07:54
-
-
Save aniversarioperu/9702860 to your computer and use it in GitHub Desktop.
inpt is an access log file from Apache
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
import sys | |
import codecs | |
import urllib | |
filename = sys.argv[1].strip() | |
f = codecs.open(filename, "r", "utf8") | |
lines = f.readlines() | |
f.close() | |
for line in lines: | |
line = line.strip() | |
if "POST" in line and "cgi" in line: | |
line = line.split("POST ") | |
if len(line) > 1: | |
line = line[1].split(" ") | |
if len(line) > 1: | |
url = line[0] | |
print urllib.unquote(url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment