Find Jobs
Hire Freelancers

PYTHONNNN basic programming assignment

$30-250 CAD

Cerrado
Publicado hace más de 9 años

$30-250 CAD

Pagado a la entrega
Introduction System administrators often analyze log files, such as packet captures or firewall logs, to see if there is unusual activity, such as a spike in traffic during a DDOS attack. Unfortunately, there are many different kinds of devices/programs that produce different kinds of log files in many different formats, often with a variable of number of fields, so there is no one tool that understands all the different formats. Consequently, sys admins often write scripts to parse (break into its individual fields) log files for analysis. In this assignment you will write a script to parse a comma separated values (CSV) text file. Once you have the individual fields, your program will then do a basic analysis of the file that gives us a summary report of traffic to a destination IP (or IPs). To make it flexible, your user should be able to use partial IPs so that the program summarizes a range of IPs. Part I - Validating Arguments For your script to be flexible, you need to specify the IPs of interest on the command line when invoking the program. The requirements are as follows: Name your program a1. You should be able to run your program from the command line with the following syntax: [login to view URL] file [login to view URL] src_ip file [login to view URL] src_ip dest_ip file where file is the name of a text file of packet captures, src_ip is a source IP and dest_ip is a destination IP. So you may have 1-3 arguments. Below are some examples of valid commands: [login to view URL] [login to view URL] [login to view URL] [login to view URL] log [login to view URL] [login to view URL] [login to view URL] net-dump Test to make sure your arguments are correct, and if not, print appropriate error messages: Less than 1 or more than 3 arguments should generate a "usage" error message, similar to the usage error for other Linux commands. The last argument must be a file that exists. You do not have to test to make sure the contents of the file are in the correct format, but you do have to test for existence of the file. You also have to test that the IP pattern is in the proper format. Note that IPs must have exactly for octets, each of which has the range 0-255. Below are examples of invalid calls to the program (also illustrated in the set of sample runs in Part II): bob@bob-pc-ocz:~/srt-a1$ [login to view URL] Usage: [login to view URL] [src_ip [dest_ip]] file bob@bob-pc-ocz:~/srt-a1$ [login to view URL] 172.16.112 [login to view URL] Invalid source IP bob@bob-pc-ocz:~/srt-a1$ [login to view URL] [login to view URL] 202.77.162.2213 [login to view URL] Invalid destination IP bob@bob-pc-ocz:~/srt-a1$ [login to view URL] nofile File nofile does not exist Note: all validation on IP numbers must be done using regular expressions. Hint: don't try to do the whole assignment at once. Do Part I first, test it to make sure it is working, then move on to Part II where you actually analyze the packets. Part II - Parsing a Log FileFor Analysis To parse a log file means to break the records (lines) from the file into its fields so that we may analyze the fields. In our case, it means extracting the source IP, destination IP, and protocol from the rest of the fields in each record. (You will be doing a lot more of this in SRT411.) If the command line arguments are valid, you are to analyze the contents of a CSV file which contains network traffic in the format in this sample file: [login to view URL] Here is a link to the original tcpdump file I will be using to test this assignment. You can create a file in the format shown above by exporting through Wireshark using File | Export Packet Dissections | As "CSV". Note: you should remove the first line which contains headings. Your program should print a summary report based on the IPs specified. If you specified no IPs, then your program should produce a summary report based on all traffic (all source IPs to all destination IPs). If you specified only a src_ip, then your program should print a summary report of all destination IPs for that source IP. Your program should list each source IP that sent to the destination IP(s), followed by a count of the number of packets they received by protocol. Below is a file of some sample runs. It contains tests where 0) the command line arguments are invalid, 1) there is no traffic from the source IP, 2) there is only traffic from one source IP to one destination IP, 3) there is traffic from one source IP to multiple destination IPs. The results are from my program, so they should be correct (I hope!): [login to view URL] Your program should match this output as closely as possible. You should line up your columns nicely like mine. Testing a program thoroughly is part of what a programmer does (and what you should do!). When I test your assignment on the due date, it will be with all these test cases -- and more. So make sure your program not only works for the set above, but for additional cases this set might not cover. Your program should contain at least two user-defined functions and possibly more. For example, you could write one function to validate the IPs entered. You should test that your program produces the same results shown, and run additional test cases. Note that you are writing a small part of the Wireshark filter function, and so you can test your program by using Wireshark to filter by IP and protocol to see if you get the same results as your program.
ID del proyecto: 6633199

Información sobre el proyecto

3 propuestas
Proyecto remoto
Activo hace 9 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
3 freelancers están ofertando un promedio de $172 CAD por este trabajo
Avatar del usuario
A proposal has not yet been provided
$250 CAD en 3 días
5,0 (227 comentarios)
6,0
6,0
Avatar del usuario
一个有效的提议尚未被提供
$155 CAD en 3 días
4,9 (23 comentarios)
4,9
4,9
Avatar del usuario
I can create the app as you mentioned in a quick turn around.I am an independent and professional developer experienced in Java, C# C++ .NET php mysql, html5 Mobile apps etc.. Let's have a details discussion about the project goal.
$200 CAD en 10 días
5,0 (7 comentarios)
3,8
3,8
Avatar del usuario
I'm very experienced with Python, and can complete this assignment quickly as I have actually written scripts that parse traffic logs before.
$111 CAD en 2 días
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de CANADA
mississauga, Canada
5,0
2
Forma de pago verificada
Miembro desde oct 23, 2014

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.