Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

BackDoor.h

Go to the documentation of this file.
00001 // $Id: BackDoor.h,v 1.3 2005/09/07 17:07:21 vern Exp $
00002 //
00003 // Copyright (c) 1999, 2000, 2001, 2002
00004 //      The Regents of the University of California.  All rights reserved.
00005 //
00006 // Redistribution and use in source and binary forms, with or without
00007 // modification, are permitted provided that: (1) source code distributions
00008 // retain the above copyright notice and this paragraph in its entirety, (2)
00009 // distributions including binary code include the above copyright notice and
00010 // this paragraph in its entirety in the documentation or other materials
00011 // provided with the distribution, and (3) all advertising materials mentioning
00012 // features or use of this software display the following acknowledgement:
00013 // ``This product includes software developed by the University of California,
00014 // Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
00015 // the University nor the names of its contributors may be used to endorse
00016 // or promote products derived from this software without specific prior
00017 // written permission.
00018 // THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
00019 // WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
00020 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021 
00022 #ifndef backdoor_h
00023 #define backdoor_h
00024 
00025 #include "TCP.h"
00026 #include "Timer.h"
00027 #include "NetVar.h"
00028 #include "Login.h"
00029 
00030 class BackDoorEndpoint : public TCP_EndpointAnalyzer {
00031 public:
00032         BackDoorEndpoint(TCP_Endpoint* e);
00033 
00034         int DataSent(double t, int seq, int len, int caplen, const u_char* data,
00035                      const IP_Hdr* ip, const struct tcphdr* tp);
00036 
00037         RecordVal* BuildStats();
00038 
00039         void FinalCheckForRlogin();
00040 
00041 protected:
00042         void CheckForRlogin(int seq, int len, const u_char* data);
00043         void RloginSignatureFound(int len);
00044 
00045         void CheckForTelnet(int seq, int len, const u_char* data);
00046         void TelnetSignatureFound(int len);
00047 
00048         void CheckForSSH(int seq, int len, const u_char* data);
00049         void CheckForFTP(int seq, int len, const u_char* data);
00050         void CheckForRootBackdoor(int seq, int len, const u_char* data);
00051         void CheckForNapster(int seq, int len, const u_char* data);
00052         void CheckForGnutella(int seq, int len, const u_char* data);
00053         void CheckForKazaa(int seq, int len, const u_char* data);
00054         void CheckForHTTP(int seq, int len, const u_char* data);
00055         void CheckForHTTPProxy(int seq, int len, const u_char* data);
00056         void CheckForSMTP(int seq, int len, const u_char* data);
00057         void CheckForIRC(int seq, int len, const u_char* data);
00058         void CheckForGaoBot(int seq, int len, const u_char* data);
00059 
00060         void SignatureFound(EventHandlerPtr e, int do_orig = 0);
00061 
00062         int CheckForStrings(const char** strs, const u_char* data, int len);
00063         int CheckForString(const char* str, const u_char* data, int len);
00064 
00065         int is_partial;
00066         int max_top_seq;
00067 
00068         int rlogin_checking_done;
00069         int rlogin_num_null;
00070         int rlogin_string_separator_pos;
00071         int rlogin_slash_seen;
00072 
00073         uint32 num_pkts;
00074         uint32 num_8k4_pkts;
00075         uint32 num_8k0_pkts;
00076         uint32 num_lines;
00077         uint32 num_normal_lines;
00078         uint32 num_bytes;
00079         uint32 num_7bit_ascii;
00080 };
00081 
00082 class BackDoorAnalyzer : public TCP_Analyzer {
00083 public:
00084         BackDoorAnalyzer(TCP_Connection* c);
00085         ~BackDoorAnalyzer();
00086 
00087         void Done();
00088         void StatTimer(double t, int is_expire);
00089 
00090 protected:
00091         void StatEvent();
00092         void RemoveEvent();
00093 
00094         BackDoorEndpoint* orig_endp;
00095         BackDoorEndpoint* resp_endp;
00096         double timeout;
00097         double backoff;
00098 };
00099 
00100 class BackDoorTimer : public Timer {
00101 public:
00102         BackDoorTimer(double t, BackDoorAnalyzer* a);
00103         ~BackDoorTimer();
00104 
00105         void Dispatch(double t, int is_expire);
00106 
00107 protected:
00108         BackDoorAnalyzer* analyzer;
00109 };
00110 
00111 #endif

Generated on Wed Sep 14 02:55:57 2005 for bro_docs by doxygen 1.3.5