Changeset 436

Show
Ignore:
Timestamp:
03/27/06 14:27:39 (3 years ago)
Author:
common
Message:

shellcode-signature
- added namespace::base64 for base64 decoding like iis asn1
- added namespace::konstanzxor for the great konstanzxor
- added engine::unicode for guessing unicode shellcodes and make them 'visible'
- added sc_base64 to the parser.{y,l} files

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nepenthes/trunk/modules/shellcode-signatures/Makefile.am

    r433 r436  
    2323shellcodesignatures_la_SOURCES += sch_namespace_connectbackfiletransfer.cpp sch_namespace_connectbackfiletransfer.hpp 
    2424shellcodesignatures_la_SOURCES += sch_namespace_bindfiletransfer.cpp sch_namespace_bindfiletransfer.hpp 
     25shellcodesignatures_la_SOURCES += sch_namespace_base64.cpp sch_namespace_base64.hpp 
     26shellcodesignatures_la_SOURCES += sch_engine_unicode.cpp sch_engine_unicode.hpp 
     27shellcodesignatures_la_SOURCES += sch_namespace_konstanzxor.cpp sch_namespace_konstanzxor.hpp 
    2528shellcodesignatures_la_LDFLAGS = -module -no-undefined -avoid-version 
    2629 
  • nepenthes/trunk/modules/shellcode-signatures/parser.h

    r433 r436  
    1515        sc_download, 
    1616        sc_url, 
    17         sc_bindfiletransfer 
     17        sc_bindfiletransfer, 
     18        sc_base64 
    1819 
    1920}; 
  • nepenthes/trunk/modules/shellcode-signatures/parser.l

    r433 r436  
    5353"url"                                                           { return SC_URL; } 
    5454"bindfiletransfer"                              { return SC_BIND_FILETRANSFER; } 
     55"base64"                      { return SC_BASE64; } 
    5556 
    5657"hostkey"                     { return SC_HOSTKEY; } 
  • nepenthes/trunk/modules/shellcode-signatures/parser.y

    r433 r436  
    3333SC_DOWNLOAD  
    3434SC_URL  
     35SC_BASE64 
    3536SC_KEY SC_SUBKEY SC_SIZE SC_SIZEINVERT SC_HOST SC_PORT SC_COMMAND 
    3637SC_URI 
     
    134135        { 
    135136                shellcodes->nspace = sc_bindfiletransfer; 
     137        } 
     138    | 
     139        SC_BASE64 
     140        { 
     141                shellcodes->nspace = sc_base64; 
    136142        } 
    137143        ; 
     
    276282                "download", 
    277283                "url", 
    278                 "bindfiletransfer" 
     284                "bindfiletransfer", 
     285        "base64" 
    279286        }; 
    280287 
    281         if ( num > sizeof(namespacemapping)/sizeof(char *) ) 
     288        if ( num >= sizeof(namespacemapping)/sizeof(char *) ) 
    282289                return "unmapped"; 
    283290        else 
     
    304311                "portkey" 
    305312        }; 
    306         if ( num > sizeof(mapmapping)/sizeof(char *) ) 
     313        if ( num >= sizeof(mapmapping)/sizeof(char *) ) 
    307314                return "unmapped"; 
    308315        else 
  • nepenthes/trunk/modules/shellcode-signatures/shellcode-signatures.cpp

    r433 r436  
    4747#include "sch_namespace_connectbackfiletransfer.hpp" 
    4848#include "sch_namespace_bindfiletransfer.hpp" 
     49#include "sch_namespace_base64.hpp" 
     50#include "sch_engine_unicode.hpp" 
     51#include "sch_namespace_konstanzxor.hpp" 
    4952 
    5053#include "ShellcodeManager.hpp" 
     
    8487{ 
    8588        m_ModuleManager         = m_Nepenthes->getModuleMgr(); 
     89 
     90g_Nepenthes->getShellcodeMgr()->registerShellcodeHandler(new EngineUnicode()); 
    8691        return loadSignaturesFromFile(string("/tmp/shellcode-signatures.sc")); 
    8792} 
     
    141146 
    142147                case sc_konstanzxor: 
     148                        sch = new NamespaceKonstanzXOR(sc); 
    143149                        break; 
    144150 
     
    173179                        break; 
    174180 
     181                case sc_base64: 
     182                        sch = new NamespaceBase64(sc); 
     183                        break; 
    175184                } 
    176185                 
  • nepenthes/trunk/modules/shellcode-signatures/shellcode-signatures.sc

    r435 r436  
    2626[n] [+]   21) HODBind  handles oc192 dcom bindshell 
    2727[n] [+]   22) HODConnect handles oc192 dcom bindshell 
    28 [s] [ ]   23) HODBind  handles house of dabus msmq bindshells 
     28[n] [+]   23) HODBind  handles house of dabus msmq bindshells (xor::msfPexEnvSub & bindshell::schoenborn do the trick) 
    2929[n] [+]   24) HODBind  handles house of dabus netdde bindshells 
    3030[n] [+]   25) HODConnect handles house of dabus netdde bindshells 
     
    766766        pattern 
    767767        ".*\\x53\\x53\\x68(....)\\x68\\x02\\x00(..)\\x8B\\xD4\\x8B\\xD8\\x6A" 
    768 //                         ^^^^->ip             ^^-> port 
     768       //                 ^^^^->ip             ^^-> port 
    769769        "\\x10\\x52\\x53\\xBA\\x63\\x30\\x60\\x5A\\xFF\\xD6\\x50\\xB4\\x02\\x50\\x55\\x53\\xBA" 
    770770        "\\x00\\x58\\x60\\xE2\\xFF\\xD6\\xBF(....)\\xFF\\xE5.*"; 
    771 //                                           ^^^^-> auth key 
     771       //                                   ^^^^-> auth key 
    772772        mapping(none,host,port,key); 
    773773}; 
     
    946946 
    947947 
    948  
    949  
    950  
     948base64::iis_asn1 
     949
     950        pattern 
     951        "GET.*Authorization.*Negotiate (.*)"; 
     952        mapping (none,post); 
     953}; 
     954 
     955 
     956 
     957