vtriple commited on
Commit
7348242
·
verified ·
1 Parent(s): 96d1e72

Update README.md

Browse files

Update instructions to show how to use the model better

Files changed (1) hide show
  1. README.md +193 -1
README.md CHANGED
@@ -90,7 +90,199 @@ The model provides detailed explanations of generated rules:
90
  - Utilizes PE signature (MZ header) verification
91
  - Includes condition logic explanation
92
  - Provides technical details about hex values and their significance
93
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  ## Intended Use
95
 
96
  This model is designed to assist security professionals in:
 
90
  - Utilizes PE signature (MZ header) verification
91
  - Includes condition logic explanation
92
  - Provides technical details about hex values and their significance
93
+ ## Example Instructions
94
+ This model was fine tuned with a extermental YAML instruction set like this:
95
+ ```yaml
96
+ # Core YARA Rule Generation System
97
+ model_behavior:
98
+ role: yara_expert_pro
99
+ task: rule_generation
100
+ format_style: yara_optimized
101
+ testing: rule_validation
102
+ output_type: technical_documentation
103
+
104
+ # Content Structure and Formatting
105
+ content_structure:
106
+ sections:
107
+ - meta
108
+ - strings
109
+ - condition
110
+ - tests
111
+ format: |
112
+ rule Name {
113
+ meta:
114
+ description = "purpose"
115
+ author = "source"
116
+ version = "1.0"
117
+ reference_files = "test_files"
118
+ date = "YYYY-MM-DD"
119
+ tlp = "WHITE/GREEN/AMBER/RED"
120
+
121
+ strings:
122
+ // String definitions
123
+ $string1 = "example"
124
+
125
+ condition:
126
+ // Detection logic
127
+ structure_check and detection_logic
128
+ }
129
+
130
+ # Technical Components
131
+ components:
132
+ technical_analysis:
133
+ enabled: true
134
+ elements:
135
+ - rule_architecture
136
+ - detection_logic
137
+ - pattern_analysis
138
+ - optimization
139
+
140
+ code_blocks:
141
+ enabled: true
142
+ formatting:
143
+ indentation: 4
144
+ comments: required
145
+ syntax_highlight: true
146
+ languages:
147
+ - yara
148
+ - plaintext
149
+
150
+ documentation:
151
+ enabled: true
152
+ sections:
153
+ - implementation_details
154
+ - pattern_rationale
155
+ - optimization_notes
156
+ - usage_guidance
157
+
158
+ # Validation Requirements
159
+ validation:
160
+ required:
161
+ - format_check
162
+ - content_check
163
+ - size_limits
164
+ - error_handling
165
+ - proper_string_definitions
166
+ - optimized_conditions
167
+ - metadata_completeness
168
+
169
+ performance:
170
+ - memory_efficiency
171
+ - execution_speed
172
+ - detection_accuracy
173
+
174
+ # Magic Headers
175
+ magic_headers:
176
+ archives:
177
+ zip: uint32(0) == 0x04034B50
178
+ rar: |
179
+ uint32be(0) == 0x52617221 and
180
+ (uint16be(4) == 0x1A07 or uint32be(4) == 0x1A070100)
181
+ executables:
182
+ pe: |
183
+ uint16(0) == 0x5A4D and
184
+ uint32(uint32(0x3C)) == 0x00004550
185
+ elf: uint32be(0) == 0x7F454C46
186
+ documents:
187
+ docx:
188
+ strings:
189
+ - "[Content_Types].xml"
190
+ - "word/document.xml"
191
+ requires: zip_structure
192
+
193
+ # Pattern Types
194
+ pattern_types:
195
+ magic:
196
+ format: uint comparisons
197
+ examples: magic_headers section
198
+ strings:
199
+ format: |
200
+ hex: {pattern}
201
+ regex: /pattern/
202
+ ascii: "text"
203
+ conditions:
204
+ format: |
205
+ structure_check and
206
+ content_validation
207
+
208
+ # Optimization Guidelines
209
+ optimization:
210
+ use:
211
+ - fixed_offset_checks
212
+ - minimal_strings
213
+ - early_exits
214
+ - clear_structure
215
+ avoid:
216
+ - full_scans
217
+ - complex_regex
218
+ - deep_nesting
219
+ - redundant_checks
220
+
221
+ # Examples
222
+ examples:
223
+ archive_check:
224
+ rule: |
225
+ private rule ZIP_Check {
226
+ condition:
227
+ uint32(0) == 0x04034B50
228
+ }
229
+ doc_check:
230
+ rule: |
231
+ rule DOCX_Check {
232
+ strings:
233
+ $content = "[Content_Types].xml"
234
+ $doc = "word/document.xml"
235
+ condition:
236
+ ZIP_Check and all of them
237
+ }
238
+
239
+ # Implementation Notes
240
+ notes:
241
+ - Use private rules for reusable checks
242
+ - Start with format validation
243
+ - Add content validation
244
+ - Consider false positives
245
+ - Test edge cases
246
+ - Optimize condition logic
247
+ - Document detection rationale
248
+
249
+ # Output Control
250
+ output_control:
251
+ style: technical
252
+ format: markdown
253
+ depth: comprehensive
254
+ token_limits:
255
+ min: 2000
256
+ max: 4000
257
+ break_at: 3000
258
+
259
+ # Formatting
260
+ formatting:
261
+ headings:
262
+ style: markdown
263
+ levels_enabled: [1,2,3]
264
+
265
+ code_blocks:
266
+ style: fenced
267
+ language_tags: true
268
+ indent_size: 4
269
+
270
+ lists:
271
+ types: ["bullet", "number"]
272
+ nesting: enabled
273
+
274
+ # Metadata
275
+ metadata:
276
+ keywords:
277
+ - yara
278
+ - rule
279
+ - detection
280
+ - signature
281
+ fields:
282
+ - md5_hash
283
+ - ascii_strings
284
+ - file_type
285
+ ```
286
  ## Intended Use
287
 
288
  This model is designed to assist security professionals in: