Defcon 10 Presentation: page_fault_tolerance_headers
b62e92093f4a8fe6671f80b389d00948859e0f3db0a28d21088e01a68c7ee6fe
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link href="defconX.css" type="text/css" rel="stylesheet">
<title>Introduction to writing spiders and web agents</title>
</head>
<body bgcolor='blue' >
<table width="100%" border="0" cellpadding="1" cellspacing="0">
<tr>
<td align='left' class='main_nav'>
<a href='page_fault_tolerance_case.php.html
'><img src='prev.gif' border='0'></a><br><font size='1'>faulttolerancecase
</td>
<td align='center' class="page_title">
Introduction to writing spiders and agents
</td>
<td align='right' class='main_nav'>
<a href='page_fault_tolerance_proactive.php.html
'><img src='next.gif' border='0'></a><br><font size='1'>faulttoleranceproactive
</td>
</tr>
<tr><td align='center' colspan='3'><img src="WHITE.png" width="750" height="1" border="0" alt=""></td></tr>
</table>
<table border='0' align='left'>
<tr><td class='title' colspan='3'>Fault Tolerance: Look for redirects in headers</td></tr> <tr>
<td> </td>
<td> </td>
<td><img src="HEADUMN.png" width="572" height="359" border="0" alt=""></td>
</tr>
<tr>
<td width="50" valign="top" class="main_font" NOWRAP> </td>
<td valign="top" colspan="2" class="main_code"><a href='#'><font face='courier'>function get_first_page($URL)</a></td>
</tr>
<tr>
<td width="50" valign="top" class="main_font" NOWRAP> </td>
<td valign="top" colspan="2" class="main_code"><a href='#'><font face='courier'> {</a></td>
</tr>
<tr>
<td width="50" valign="top" class="main_font" NOWRAP> </td>
<td valign="top" colspan="2" class="main_code"><a href='#'><font face='courier'> $header = `c:\curl\curl --head $URL`;</a></td>
</tr>
<tr>
<td width="50" valign="top" class="main_font" NOWRAP> </td>
<td valign="top" colspan="2" class="main_code"><a href='#'><font face='courier'> $parsed = inclusive_parse(</a></td>
</tr>
<tr>
<td width="50" valign="top" class="main_font" NOWRAP> </td>
<td valign="top" colspan="2" class="main_code"><a href='#'><font face='courier'> $string=$header, </a></td>
</tr>
<tr>
<td width="50" valign="top" class="main_font" NOWRAP> </td>
<td valign="top" colspan="2" class="main_code"><a href='#'><font face='courier'> $start="Location: ", </a></td>
</tr>
<tr>
<td width="50" valign="top" class="main_font" NOWRAP> </td>
<td valign="top" colspan="2" class="main_code"><a href='#'><font face='courier'> $end="\n", </a></td>
</tr>
<tr>
<td width="50" valign="top" class="main_font" NOWRAP> </td>
<td valign="top" colspan="2" class="main_code"><a href='#'><font face='courier'> $max_span=50</a></td>
</tr>
<tr>
<td width="50" valign="top" class="main_font" NOWRAP> </td>
<td valign="top" colspan="2" class="main_code"><a href='#'><font face='courier'> );</a></td>
</tr>
<tr>
<td width="50" valign="top" class="main_font" NOWRAP> </td>
<td valign="top" colspan="2" class="main_code"><a href='#'><font face='courier'> return $parsed[0];</a></td>
</tr>
<tr>
<td width="50" valign="top" class="main_font" NOWRAP> </td>
<td valign="top" colspan="2" class="main_code"><a href='#'><font face='courier'> }</a></td>
</tr>
</table>