Difference between revisions of "Summerschool Aachen 2004/Building Attacks Lab"

From C4 Wiki
Jump to: navigation, search
m (Removed protection from "Summerschool Aachen 2004/Building Attacks Lab")
 
(26 intermediate revisions by 16 users not shown)
Line 1: Line 1:
[http://willa-ford-mp3.boom.ru/ | Willa Ford Mp3]
+
= Notes on Lab Session =
[http://used_ford_truck.chat.ru/ | Used Ford Truck]
+
 
[http://used_ford_rang.chat.ru/ | Used Ford Rang]
+
== Google and special characters ==
[http://used_ford_auto.chat.ru/ | Used Ford Auto]
+
 
[http://texas-ford-dea.boom.ru/ | Texas Ford Dea]
+
The star * and the full stop . do not work as wildcards.
[http://texas_ford_deale.chat.ru/ | Texas Ford Deale]
+
 
[http://senator-john.boom.ru/ | Senator John]
+
--[[Alexander Becher]]
[http://remanufactured_f.chat.ru/ | Remanufactured F]
+
 
[http://q1997_ford_explo.chat.ru/ | Q1997 Ford Explo]
+
== Linux clock timings ==
[http://q1997_ford_esc.chat.ru/ | Q1997 Ford Esc]
+
 
[http://q1996_exporer.chat.ru/ | Q1996 Exporer]
+
These show some measurements I have take on the Linux 2.4 kernel clock using gettimeofday(). This returns results with microsecond precision, so I wanted to make sure that this precision was significant. These graphs show that both the millisecond and microsecond parts give fairly uniform results.
[http://problem_with_for.chat.ru/ | Problem With For]
+
 
[http://picture-of-henry.boom.ru/  | Picture Of Henry ]
+
'''Milliseconds'''<br>
[http://old-ford-truck.boom.ru/ | Old Ford Truck]
+
http://www.cl.cam.ac.uk/users/sjm217/volatile/timing_msec.png
[http://northern_califor.chat.ru/ | Northern Califor]
+
 
[http://new-ford-truck.boom.ru/ | New Ford Truck]
+
'''Microseconds'''<br>
[http://model_a_ford.chat.ru/ | Model A Ford]
+
http://www.cl.cam.ac.uk/users/sjm217/volatile/timing_usec.png
[http://melissa_ford_pho.chat.ru/ | Melissa Ford Pho]
+
 
[http://john_ford_tennes.chat.ru/ | John Ford Tennes]
+
-- [[Steven Murdoch]]
[http://john_bleakley_fo.chat.ru/ | John Bleakley Fo]
+
 
[http://indiana_ford_dea.chat.ru/ | Indiana Ford Dea]
+
A comment from the NetBSD 1.6.2 Kernel, file src/sys/kern/kern_microtime.c:
[http://henry_ford_mus.chat.ru/ | Henry Ford Mus]
+
/*
[http://henry_ford_hos.chat.ru/ | Henry Ford Hos]
+
  * Ordinarily, the current clock time is guaranteed to be later
[http://ford-focus-svt.boom.ru/ | Ford Focus Svt]
+
  * by at least one microsecond than the last time the clock was
[http://ford-explor.chat.ru/ | Ford Explor]
+
  * read. However, this rule applies only if the current time is
[http://ford-conversion.boom.ru/ | Ford Conversion]
+
  * within one second of the last time. Otherwise, the clock wil
[http://ford-commercial.boom.ru/ | Ford Commercial]
+
  * (shudder) be set backward. The clock adjustment daemon or
[http://ford-body-part.boom.ru/ | Ford Body Part]
+
  * human equivalent is presumed to be correctly implemented and
[http://ford-amphitheat.boom.ru/ | Ford Amphitheat]
+
  * to set the clock backward only upon unavoidable crisis.
[http://ford_windstar_pa.chat.ru/ | Ford Windstar Pa]
+
  */
[http://ford_truck_sea.chat.ru/ | Ford Truck Sea]
+
 
[http://ford_truck_recal.chat.ru/ | Ford Truck Recal]
+
 
[http://ford_truck_per.chat.ru/ | Ford Truck Per]
+
 
[http://ford_tractor.chat.ru/ | Ford Tractor]
+
== A mathematical theory of communication ==
[http://ford_thunderbi.chat.ru/ | Ford Thunderbi]
+
 
[http://ford_rangers_f.chat.ru/ | Ford Rangers F]
+
I've uploaded this famous paper by C.E. Shannon to http://berlin.ccc.de/~cc/shannon-a_mathematical_theory_of_communication.pdf.<br />
[http://ford_ranger_repa.chat.ru/ | Ford Ranger Repa]
+
You may download it, if you're interested.
[http://ford_probe_raced.chat.ru/ | Ford Probe Raced]
+
 
[http://ford_probe_fo.chat.ru/ | Ford Probe Fo]
+
--[[User:Cpunkt|Cpunkt]] 12:21, 23 Sep 2004 (CEST)
[http://ford_pickup_tr.chat.ru/ | Ford Pickup Tr]
+
 
[http://ford_part_restor.chat.ru/ | Ford Part Restor]
+
== Billy the kid ==
[http://ford_part_onl.chat.ru/ | Ford Part Onl]
+
 
[http://ford_new_hol.chat.ru/ | Ford New Hol]
+
[http://home.student.utwente.nl/g.v.berg/btk/ a python lib that allows you to make raw sockets.]
[http://ford_mustang_par.chat.ru/ | Ford Mustang Par]
+
 
[http://ford_mustang_for.chat.ru/ | Ford Mustang For]
+
== Google Search String Competition ==
[http://ford_mustang_cl.chat.ru/ | Ford Mustang Cl]
+
 
[http://ford_mustan.chat.ru/ | Ford Mustan]
+
Insert here your Favorite (novel) search strings:
[http://ford_motor_recal.chat.ru/ | Ford Motor Recal]
+
 
[http://ford_motor_comp.chat.ru/ | Ford Motor Comp]
+
* [http://www.google.de/search?hl=en&ie=UTF-8&as_qdr=all&q=inurl%3A%22robots.txt%22+Disallow+secret&btnG=Search inurl:"robots.txt" Disallow secret]
[http://ford_motor_co.chat.ru/ | Ford Motor Co]
+
* [http://www.google.com/search?q=inurl:%22robots.txt%22+Disallow+(secret%7Cadmin%7Cstat%7Cstats%7Cconfig%7Cconf%7Cinc%7Cinclude%7Cintern%7Cinterneal)&ie=UTF-8&oe=UTF-8 inurl:"robots.txt" Disallow (secret|admin|stat|stats|config|conf|inc|include|intern|interneal)]
[http://ford_model_part.chat.ru/ | Ford Model Part]
+
* [http://www.google.de/search?hl=en&ie=UTF-8&q=%22phpScheduleIt+v1.0.0+RC1%22&btnG=Google+Search "phpScheduleIt v1.0.0 RC1"] - Get a free homepage (see bug report [http://www.securityfocus.com/bid/11080 Bugtraq 11080])
[http://ford_m.chat.ru/ | Ford M]
+
 
[http://ford_health_henr.chat.ru/ | Ford Health Henr]
+
== nmap - always print fingerprint bad bad idea ==
[http://ford_gt_picture.chat.ru/ | Ford Gt Picture]
+
 
[http://ford_focus_r.chat.ru/ | Ford Focus R]
+
diff -Nau nmap-3.70/output.cc nmap-3.70.mm/output.cc
[http://ford_falcon_part.chat.ru/ | Ford Falcon Part]
+
--- nmap-3.70/output.cc 2004-08-29 11:12:03.000000000 +0200
[http://ford_falcon_for.chat.ru/ | Ford Falcon For]
+
+++ nmap-3.70.mm/output.cc 2004-09-23 19:14:13.000000000 +0200
[http://ford_factory_par.chat.ru/ | Ford Factory Par]
+
@@ -353,7 +353,8 @@
[http://ford_f250_diesel.chat.ru/ | Ford F250 Diesel]
+
snprintf(portinfo, sizeof(portinfo), "%d/%s", current->portno, protocol);
[http://ford_f150_truck.chat.ru/ | Ford F150 Truck]
+
state = statenum2str(current->state);
[http://ford_f150_sacra.chat.ru/ | Ford F150 Sacra]
+
current->getServiceDeductions(&sd);
[http://ford_f_150_pictu.chat.ru/ | Ford F 150 Pictu]
+
- if (sd.service_fp && saved_servicefps.size() <= 8)
[http://ford_explorer_r.chat.ru/ | Ford Explorer R]
+
+    // always print the fingerprint
[http://ford_escort_z.chat.ru/ | Ford Escort Z]
+
+ if (sd.service_fp)
[http://ford_escort_bo.chat.ru/ | Ford Escort Bo]
+
  saved_servicefps.push_back(sd.service_fp);
[http://ford_escape_p.chat.ru/ | Ford Escape P]
+
[http://ford_dealer_was.chat.ru/ | Ford Dealer Was]
+
if (o.rpcscan) {
[http://ford_dealer_st.chat.ru/ | Ford Dealer St]
+
diff -Nau nmap-3.70/service_scan.cc nmap-3.70.mm/service_scan.cc
[http://ford_dealer_pa.chat.ru/ | Ford Dealer Pa]
+
--- nmap-3.70/service_scan.cc 2004-08-29 11:12:03.000000000 +0200
[http://ford_dealer_okla.chat.ru/ | Ford Dealer Okla]
+
+++ nmap-3.70.mm/service_scan.cc 2004-09-23 19:20:57.000000000 +0200
[http://ford_dealer_nas.chat.ru/ | Ford Dealer Nas]
+
@@ -1825,6 +1825,9 @@
[http://ford_dealer_illi.chat.ru/ | Ford Dealer Illi]
+
 
[http://ford_dealer_fo.chat.ru/ | Ford Dealer Fo]
+
      if (MD && MD->serviceName) {
[http://ford_dealer_denv.chat.ru/ | Ford Dealer Denv]
+
        // WOO HOO!!!!!!  MATCHED!  But might be soft
[http://ford_dealer_b.chat.ru/ | Ford Dealer B]
+
+      // mm: print a fingerprint everytime
[http://ford_deale.chat.ru/ | Ford Deale]
+
+        svc->addToServiceFingerprint(MD->serviceName, readstr, readstrlen);
[http://ford_credit_com.chat.ru/ | Ford Credit Com]
+
+
[http://ford_credit_card.chat.ru/ | Ford Credit Card]
+
        if (MD->isSoft && svc->probe_matched) {
[http://ford_contour_svt.chat.ru/ | Ford Contour Svt]
+
  if (strcmp(svc->probe_matched, MD->serviceName) != 0)
 +
    error("WARNING:  service %s:%hi had allready soft-matched %s, but now soft-matched %s; ignoring second value\n", svc->target->NameIP(), svc->portno, svc->probe_matched, MD->serviceName);
 +
@@ -1967,7 +1970,8 @@
 +
    *(*svc)->product_matched? (*svc)->product_matched : NULL,
 +
    *(*svc)->version_matched? (*svc)->version_matched : NULL,
 +
    *(*svc)->extrainfo_matched? (*svc)->extrainfo_matched : NULL,
 +
-   NULL);
 +
+                      (*svc)->getServiceFingerprint(NULL));
 +
+   //NULL); // always pass the fingerprint
 +
 
 +
    } else if ((*svc)->probe_state == PROBESTATE_FINISHED_SOFTMATCHED) {
 +
      (*svc)->port->setServiceProbeResults((*svc)->probe_state,
 +
 
 +
--[[User:Mario Manno|MM]] 17:12, 5 Oct 2004 (CEST)
 +
 
 +
== Making a fingerprinter ==
 +
 
 +
Yesterday I decided to make a (ring) fingerprinting tool in the labsession. the full description of this fingerprinting method is described in: [http://www.intranode.com/fr/doc/ring-full-paper.pdf http://www.intranode.com/fr/doc/ring-full-paper.pdf] It took a bit more work then I had planned (I'd also planned to play a little with the metasploit framework, but there was no time left) but eventually I got a perlscript which looks ok and which the perl interpreter seems to like.  
 +
I haven't tested it yet (when the code was finished it was already around 8 or so), but I'll try to test it today or tomorrow.  
 +
 
 +
-- Ilja van Sprundel
 +
 
 +
== Tunnelling IP over DNS ==
 +
 
 +
Although there are already tools available to do this (cf. [[http://nstx.dereference.de/nstx/ NSTX ]] and [[http://c0re.23.nu/c0de/snap/DeNiSe-snap-20021026.tar.gz DeNiSe]]), I decided it would be an interesting project to try during the afteroon. Working on OpenBSD, I started to write the client part of the code using libnet and libpcap (taking 'inspiration' from various places, including nos-tun). It took quite a while to work out simple things like the correct ioctls for the tun interface, but I've made enough progress that I think it might be nice to continue with this on the project day. I'll try to add some code to this entry once there's enough to be worth looking at!
 +
 
 +
-- [[Stephen Lewis]]
 +
 
 +
== Tunneling information through ICMP ==
 +
 
 +
I've written a small perl script, which uses Net::RawIP to open a pcap listener and looks for ICMP packets with a special combination of type and code. If it sees such a packet, it interprets the payload as a command. Currently, it is possible to send it a "get file" command, which the scripts responds to by splitting the file into 32 bit chunks, sending them back to the requestor. The chunks are being encoded in the ID and sequence fields in the ICMP header.
 +
I have not implemented some kind of flow control yet. This should be done for real world use...
 +
 
 +
--[[User:Cpunkt|Cpunkt]] 09:58, 27 Sep 2004 (CEST)
 +
 
 +
[[Category:Summerschools]]
 +
[[Category:Hacks]]

Latest revision as of 22:23, 24 September 2018

Notes on Lab Session

Google and special characters

The star * and the full stop . do not work as wildcards.

--Alexander Becher

Linux clock timings

These show some measurements I have take on the Linux 2.4 kernel clock using gettimeofday(). This returns results with microsecond precision, so I wanted to make sure that this precision was significant. These graphs show that both the millisecond and microsecond parts give fairly uniform results.

Milliseconds
http://www.cl.cam.ac.uk/users/sjm217/volatile/timing_msec.png

Microseconds
http://www.cl.cam.ac.uk/users/sjm217/volatile/timing_usec.png

-- Steven Murdoch

A comment from the NetBSD 1.6.2 Kernel, file src/sys/kern/kern_microtime.c:

/*
 * Ordinarily, the current clock time is guaranteed to be later
 * by at least one microsecond than the last time the clock was
 * read.  However, this rule applies only if the current time is
 * within one second of the last time.  Otherwise, the clock wil
 * (shudder) be set backward.  The clock adjustment daemon or
 * human equivalent is presumed to be correctly implemented and
 * to set the clock backward only upon unavoidable crisis.
 */


A mathematical theory of communication

I've uploaded this famous paper by C.E. Shannon to http://berlin.ccc.de/~cc/shannon-a_mathematical_theory_of_communication.pdf.
You may download it, if you're interested.

--Cpunkt 12:21, 23 Sep 2004 (CEST)

Billy the kid

a python lib that allows you to make raw sockets.

Google Search String Competition

Insert here your Favorite (novel) search strings:

nmap - always print fingerprint bad bad idea

diff -Nau nmap-3.70/output.cc nmap-3.70.mm/output.cc
--- nmap-3.70/output.cc	2004-08-29 11:12:03.000000000 +0200
+++ nmap-3.70.mm/output.cc	2004-09-23 19:14:13.000000000 +0200
@@ -353,7 +353,8 @@
	snprintf(portinfo, sizeof(portinfo), "%d/%s", current->portno, protocol);
	state = statenum2str(current->state);
	current->getServiceDeductions(&sd);
-	if (sd.service_fp && saved_servicefps.size() <= 8)
+    // always print the fingerprint
+	if (sd.service_fp)
	  saved_servicefps.push_back(sd.service_fp);

	if (o.rpcscan) {
diff -Nau nmap-3.70/service_scan.cc nmap-3.70.mm/service_scan.cc
--- nmap-3.70/service_scan.cc	2004-08-29 11:12:03.000000000 +0200
+++ nmap-3.70.mm/service_scan.cc	2004-09-23 19:20:57.000000000 +0200
@@ -1825,6 +1825,9 @@
 
     if (MD && MD->serviceName) {
       // WOO HOO!!!!!!  MATCHED!  But might be soft
+      // mm: print a fingerprint everytime
+        svc->addToServiceFingerprint(MD->serviceName, readstr, readstrlen);
+
       if (MD->isSoft && svc->probe_matched) {
 	if (strcmp(svc->probe_matched, MD->serviceName) != 0)
 	  error("WARNING:  service %s:%hi had allready soft-matched %s, but now soft-matched %s; ignoring second value\n", svc->target->NameIP(), svc->portno, svc->probe_matched, MD->serviceName);
@@ -1967,7 +1970,8 @@
 					  *(*svc)->product_matched? (*svc)->product_matched : NULL, 
 					  *(*svc)->version_matched? (*svc)->version_matched : NULL, 
 					  *(*svc)->extrainfo_matched? (*svc)->extrainfo_matched : NULL, 
-					  NULL);
+                      (*svc)->getServiceFingerprint(NULL));
+					  //NULL); // always pass the fingerprint
 
    } else if ((*svc)->probe_state == PROBESTATE_FINISHED_SOFTMATCHED) {
     (*svc)->port->setServiceProbeResults((*svc)->probe_state,

--MM 17:12, 5 Oct 2004 (CEST)

Making a fingerprinter

Yesterday I decided to make a (ring) fingerprinting tool in the labsession. the full description of this fingerprinting method is described in: http://www.intranode.com/fr/doc/ring-full-paper.pdf It took a bit more work then I had planned (I'd also planned to play a little with the metasploit framework, but there was no time left) but eventually I got a perlscript which looks ok and which the perl interpreter seems to like. I haven't tested it yet (when the code was finished it was already around 8 or so), but I'll try to test it today or tomorrow.

-- Ilja van Sprundel

Tunnelling IP over DNS

Although there are already tools available to do this (cf. [NSTX ] and [DeNiSe]), I decided it would be an interesting project to try during the afteroon. Working on OpenBSD, I started to write the client part of the code using libnet and libpcap (taking 'inspiration' from various places, including nos-tun). It took quite a while to work out simple things like the correct ioctls for the tun interface, but I've made enough progress that I think it might be nice to continue with this on the project day. I'll try to add some code to this entry once there's enough to be worth looking at!

-- Stephen Lewis

Tunneling information through ICMP

I've written a small perl script, which uses Net::RawIP to open a pcap listener and looks for ICMP packets with a special combination of type and code. If it sees such a packet, it interprets the payload as a command. Currently, it is possible to send it a "get file" command, which the scripts responds to by splitting the file into 32 bit chunks, sending them back to the requestor. The chunks are being encoded in the ID and sequence fields in the ICMP header. I have not implemented some kind of flow control yet. This should be done for real world use...

--Cpunkt 09:58, 27 Sep 2004 (CEST)