Sitzung: Jeden Freitag in der Vorlesungszeit ab 16 Uhr c. t. im MAR 0.005. In der vorlesungsfreien Zeit unregelmäßig (Jemensch da?). Macht mit!

Benutzer:Grey/Security Tool Developement Projekt EN: Unterschied zwischen den Versionen

(Wie schreibe ich meine eigenen Testskripte?)
(Which language is used to implement a testscript? And why this language?)
 
(5 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 5: Zeile 5:
 
=== For what do we need the testscript? ===
 
=== For what do we need the testscript? ===
 
For testing a firewall, we need the ability to generate and send different packets through our firewall.
 
For testing a firewall, we need the ability to generate and send different packets through our firewall.
Our testscript ist here the manager, who administer to the sending and generating of the packets, while using the wrapper-classes.
+
Our testscript ist here the manager, who administer to the sending and generating of the packets, while using the [[Benutzer:Grey/wrapper-klassen_EN|wrapper-classes]].
 
The testscript is refered in the commandline(the path to the script is refered) to FWTEST, so that FWTEST has not be compiled again for using another testscript.
 
The testscript is refered in the commandline(the path to the script is refered) to FWTEST, so that FWTEST has not be compiled again for using another testscript.
  
Zeile 13: Zeile 13:
 
Python has many advantages:
 
Python has many advantages:
 
* simple syntax and easy to learn
 
* simple syntax and easy to learn
 +
* no memory management required '''TODO:'''in den dt. teil übernehmen
 +
* no type declaration of variables '''TODO:'''in den dt. teil übernehmen
 
* a mighty programming library
 
* a mighty programming library
 
* simple to integrate in C and reversed
 
* simple to integrate in C and reversed
Zeile 63: Zeile 65:
  
 
A detailed discription of writing a UDP-testscript can be found here:
 
A detailed discription of writing a UDP-testscript can be found here:
[[Benutzer:Grey/UDP-Testskript|UDP-testscript]]
+
[[Benutzer:Grey/UDP-Testskript_EN|UDP-testscript]]
  
=== Grenzen von Tests ===
+
=== Limits of tests ===
  
Testskripte sollen den Traffic simulieren und somit einen realistischen Paketaustausch darstellen.
+
Testscripts shall simulate the traffic and as a sequence representing a realistic packet exchange.
Zum Beispiel in unserem netdate-Beispiel haben wir eine Einschränkung.  
 
  
Wir benutzen nicht wirklich den Heise-Server, sondern unser Agent nimmt diese Funktion ein, so daß natürlich die IP-Adresse unseres Agenten B (Bchen) im IP-Paket stehen muß.
+
For example, in our netdate-example we have a restriction.
So gesehen ist es nicht wirklich eine Einschränkung des Testsktiptes, sondern eher des Versuchaufbaus. Es sei denn Bchen ist www.heise.de.
 
  
Eine weitere Einschränkung ist die komplexe Nachbildung einer Verbindungsstrecke, wie beim ICMP Fragmentation Needed Aufbau. Wir haben nicht alles, Server und Rechner zu denen eine Verbindung in der Realität aufgebaut werden würde, aber das ist auch nicht nötig. Es soll nur die Firewall getestet werden, ob sie richtig konfiguriert ist oder Schwachstellen hat.  
+
We don't really use the www.heise.de Server, but our agent take place of the Server, so that of course the IP-address from our agent b(bchen) is taken and shown in the IP-packet.
  
So sind nur die Pakete wichtig die durch die Firewall gehen.
+
It is not really a restriction of the testscript, but of the breadboard construction. Is bchen www.heise.de the restriction is obsolete.
 +
 
 +
Another restriction is the complex emulation of a connection (road section), as the construction of ICMP Fragmentation Needed shows.
 +
We don't have all servers and computer that are needed for the reality, but that is not the point. We don't need them to test the firewall in a realistic way.
 +
We only want to test the firewall, if it has weak points or misconfigurations.
 +
 
 +
So only the packets, which pass the firewall are important.

Aktuelle Version vom 15. Oktober 2005, 17:27 Uhr

Documentation

HowTo

For what do we need the testscript?

For testing a firewall, we need the ability to generate and send different packets through our firewall. Our testscript ist here the manager, who administer to the sending and generating of the packets, while using the wrapper-classes. The testscript is refered in the commandline(the path to the script is refered) to FWTEST, so that FWTEST has not be compiled again for using another testscript.

Which language is used to implement a testscript? And why this language?

Python.

Python has many advantages:

  • simple syntax and easy to learn
  • no memory management required TODO:in den dt. teil übernehmen
  • no type declaration of variables TODO:in den dt. teil übernehmen
  • a mighty programming library
  • simple to integrate in C and reversed
  • platformindependent

What abilities has a testscript?

  • default packets
  • IP-packets
  • UDP-packets
  • TCP-packets
  • ICMP-packets
  • sending packets
  • everything that Python can

How does a breadboard construction for a testscript looking?

As a basic principle we can say that FWTEST has two agents- and one FWTEST-process.

We have two mostly used breadboard constructions.

variation 1:

We have three computers: the firewall, agent a(achen) and agent b(bchen). On achen and bchen is running an instance of our agent, additionaly is an instance of fwtest running on one of our agents (achen or bchen). So one agent adopts the function of fwtest.

A possible construction could be:

http://www.freitagsrunde.org/~grey/sonstiges/std/versuchsaufbau1.png

variation 2:

The ohther variation is based on four computers, two computers are functioning as agents and the third adopts the function of the controller (so FWTEST). The fourth, the firewall, is untouched.

A possible construction could be:

http://www.freitagsrunde.org/~grey/sonstiges/std/versuchsaufbau2.png

How am I writing my own testscripts?

Implementing a testscript is easy as breathing air. For example let us take a look at implementing a simple UDP-packet. At first the generation of a default ip-packet and its field modifications is done. After that a default UDP-packet is genrated, independently from the default IP-packet. We also have to modify the fields content of the UDP-packet, so that we meet our needs.

To finish, the default packets have to be melted together. We take the UDP-packet as payload for the IP-packet, followed by FIXUP, so that the chekcsum is corrected.

Now with the transceive-function the UDP/IP-packet can be send.

A detailed discription of writing a UDP-testscript can be found here: UDP-testscript

Limits of tests

Testscripts shall simulate the traffic and as a sequence representing a realistic packet exchange.

For example, in our netdate-example we have a restriction.

We don't really use the www.heise.de Server, but our agent take place of the Server, so that of course the IP-address from our agent b(bchen) is taken and shown in the IP-packet.

It is not really a restriction of the testscript, but of the breadboard construction. Is bchen www.heise.de the restriction is obsolete.

Another restriction is the complex emulation of a connection (road section), as the construction of ICMP Fragmentation Needed shows. We don't have all servers and computer that are needed for the reality, but that is not the point. We don't need them to test the firewall in a realistic way. We only want to test the firewall, if it has weak points or misconfigurations.

So only the packets, which pass the firewall are important.