Changeset 631
- Timestamp:
- 08/30/06 18:22:07 (2 years ago)
- Files:
-
- nepenthes/branches/nepenthes-experimental/modules/submit-file/submit-file.conf.dist (modified) (1 diff)
- nepenthes/branches/nepenthes-experimental/modules/submit-file/submit-file.cpp (modified) (4 diffs)
- nepenthes/branches/nepenthes-experimental/modules/submit-file/submit-file.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
nepenthes/branches/nepenthes-experimental/modules/submit-file/submit-file.conf.dist
r321 r631 2 2 { 3 3 path "var/binaries/"; 4 5 # uncomment this to run the given program on every new sample, the sensor 6 # gets. the path to the sample is provided as argv[1] 7 #sample-handler = "/usr/bin/true"; 8 9 # uncomment this to run the given program on every hit of a new or known 10 # sample against the sensor. path again is provided as argv[1] 11 #hit-handler = "/usr/bin/true"; 4 12 }; 5 13 nepenthes/branches/nepenthes-experimental/modules/submit-file/submit-file.cpp
r543 r631 86 86 return false; 87 87 } 88 89 try 90 { 91 m_sampleHandlerPath = m_Config->getValString("submit-file.sample-handler"); 92 } catch ( ... ) { } 93 94 try 95 { 96 m_hitHandlerPath = m_Config->getValString("submit-file.hit-handler"); 97 } catch ( ... ) { } 88 98 89 99 m_ModuleManager = m_Nepenthes->getModuleMgr(); … … 127 137 logDebug("wrote file %s %i to disk \n",path.c_str(),down->getDownloadBuffer()->getSize()); 128 138 fclose(f); 139 140 if(!m_sampleHandlerPath.empty() && !fork()) 141 { 142 execl(m_sampleHandlerPath.c_str(), m_sampleHandlerPath.c_str(), path.c_str(), (char *) 0); 143 } 144 129 145 break; 130 146 } … … 132 148 logDebug("stat error on file %s (%s) \n",path.c_str(),strerror(errno)); 133 149 } 150 134 151 // m_Nepenthes->getUtilities()->hexdump((byte *)down->getDownloadBuffer()->getData(),down->getDownloadBuffer()->getSize()); 135 152 } … … 138 155 void FileSubmitHandler::Hit(Download *down) 139 156 { 157 string path = m_FilePath + down->getMD5Sum(); 158 159 if(!m_hitHandlerPath.empty() && !fork()) 160 { 161 execl(m_hitHandlerPath.c_str(), m_hitHandlerPath.c_str(), path.c_str(), (char *) 0); 162 } 163 140 164 return; 141 165 } nepenthes/branches/nepenthes-experimental/modules/submit-file/submit-file.hpp
r318 r631 52 52 protected: 53 53 string m_FilePath; 54 string m_sampleHandlerPath, m_hitHandlerPath; 54 55 }; 55 56
