|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Security.Checks.injectionShell</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
|
23 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Security.Checks.injectionShell</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing a check for shell injection. |
|
27 </p> |
|
28 <h3>Global Attributes</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>fullPathMatchRe</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 |
|
35 <table> |
|
36 <tr><td>None</td></tr> |
|
37 </table> |
|
38 <h3>Functions</h3> |
|
39 |
|
40 <table> |
|
41 |
|
42 <tr> |
|
43 <td><a href="#_evaluateShellCall">_evaluateShellCall</a></td> |
|
44 <td>Function to determine the severity of a shell call.</td> |
|
45 </tr> |
|
46 <tr> |
|
47 <td><a href="#checkOtherFunctionWithShell">checkOtherFunctionWithShell</a></td> |
|
48 <td>Function to check for any function with shell equals true.</td> |
|
49 </tr> |
|
50 <tr> |
|
51 <td><a href="#checkStartProcessWithNoShell">checkStartProcessWithNoShell</a></td> |
|
52 <td>Function to check for starting a process with no shell.</td> |
|
53 </tr> |
|
54 <tr> |
|
55 <td><a href="#checkStartProcessWithPartialPath">checkStartProcessWithPartialPath</a></td> |
|
56 <td>Function to check for starting a process with no shell.</td> |
|
57 </tr> |
|
58 <tr> |
|
59 <td><a href="#checkStartProcessWithShell">checkStartProcessWithShell</a></td> |
|
60 <td>Function to check for starting a process with a shell.</td> |
|
61 </tr> |
|
62 <tr> |
|
63 <td><a href="#checkSubprocessPopenWithShell">checkSubprocessPopenWithShell</a></td> |
|
64 <td>Function to check for use of popen with shell equals true.</td> |
|
65 </tr> |
|
66 <tr> |
|
67 <td><a href="#checkSubprocessPopenWithoutShell">checkSubprocessPopenWithoutShell</a></td> |
|
68 <td>Function to check for use of popen without shell equals true.</td> |
|
69 </tr> |
|
70 <tr> |
|
71 <td><a href="#getChecks">getChecks</a></td> |
|
72 <td>Public method to get a dictionary with checks handled by this module.</td> |
|
73 </tr> |
|
74 <tr> |
|
75 <td><a href="#hasShell">hasShell</a></td> |
|
76 <td>Function to check, if the node of the context contains the shell keyword.</td> |
|
77 </tr> |
|
78 </table> |
|
79 <hr /> |
|
80 <hr /> |
|
81 <a NAME="_evaluateShellCall" ID="_evaluateShellCall"></a> |
|
82 <h2>_evaluateShellCall</h2> |
|
83 <b>_evaluateShellCall</b>(<i>context</i>) |
|
84 |
|
85 <p> |
|
86 Function to determine the severity of a shell call. |
|
87 </p> |
|
88 <dl> |
|
89 |
|
90 <dt><i>context</i> (SecurityContext)</dt> |
|
91 <dd> |
|
92 context to be inspected |
|
93 </dd> |
|
94 </dl> |
|
95 <dl> |
|
96 <dt>Return:</dt> |
|
97 <dd> |
|
98 severity level (L, M or H) |
|
99 </dd> |
|
100 </dl> |
|
101 <dl> |
|
102 <dt>Return Type:</dt> |
|
103 <dd> |
|
104 str |
|
105 </dd> |
|
106 </dl> |
|
107 <div align="right"><a href="#top">Up</a></div> |
|
108 <hr /> |
|
109 <hr /> |
|
110 <a NAME="checkOtherFunctionWithShell" ID="checkOtherFunctionWithShell"></a> |
|
111 <h2>checkOtherFunctionWithShell</h2> |
|
112 <b>checkOtherFunctionWithShell</b>(<i>reportError, context, config</i>) |
|
113 |
|
114 <p> |
|
115 Function to check for any function with shell equals true. |
|
116 </p> |
|
117 <dl> |
|
118 |
|
119 <dt><i>reportError</i> (func)</dt> |
|
120 <dd> |
|
121 function to be used to report errors |
|
122 </dd> |
|
123 <dt><i>context</i> (SecurityContext)</dt> |
|
124 <dd> |
|
125 security context object |
|
126 </dd> |
|
127 <dt><i>config</i> (dict)</dt> |
|
128 <dd> |
|
129 dictionary with configuration data |
|
130 </dd> |
|
131 </dl> |
|
132 <div align="right"><a href="#top">Up</a></div> |
|
133 <hr /> |
|
134 <hr /> |
|
135 <a NAME="checkStartProcessWithNoShell" ID="checkStartProcessWithNoShell"></a> |
|
136 <h2>checkStartProcessWithNoShell</h2> |
|
137 <b>checkStartProcessWithNoShell</b>(<i>reportError, context, config</i>) |
|
138 |
|
139 <p> |
|
140 Function to check for starting a process with no shell. |
|
141 </p> |
|
142 <dl> |
|
143 |
|
144 <dt><i>reportError</i> (func)</dt> |
|
145 <dd> |
|
146 function to be used to report errors |
|
147 </dd> |
|
148 <dt><i>context</i> (SecurityContext)</dt> |
|
149 <dd> |
|
150 security context object |
|
151 </dd> |
|
152 <dt><i>config</i> (dict)</dt> |
|
153 <dd> |
|
154 dictionary with configuration data |
|
155 </dd> |
|
156 </dl> |
|
157 <div align="right"><a href="#top">Up</a></div> |
|
158 <hr /> |
|
159 <hr /> |
|
160 <a NAME="checkStartProcessWithPartialPath" ID="checkStartProcessWithPartialPath"></a> |
|
161 <h2>checkStartProcessWithPartialPath</h2> |
|
162 <b>checkStartProcessWithPartialPath</b>(<i>reportError, context, config</i>) |
|
163 |
|
164 <p> |
|
165 Function to check for starting a process with no shell. |
|
166 </p> |
|
167 <dl> |
|
168 |
|
169 <dt><i>reportError</i> (func)</dt> |
|
170 <dd> |
|
171 function to be used to report errors |
|
172 </dd> |
|
173 <dt><i>context</i> (SecurityContext)</dt> |
|
174 <dd> |
|
175 security context object |
|
176 </dd> |
|
177 <dt><i>config</i> (dict)</dt> |
|
178 <dd> |
|
179 dictionary with configuration data |
|
180 </dd> |
|
181 </dl> |
|
182 <div align="right"><a href="#top">Up</a></div> |
|
183 <hr /> |
|
184 <hr /> |
|
185 <a NAME="checkStartProcessWithShell" ID="checkStartProcessWithShell"></a> |
|
186 <h2>checkStartProcessWithShell</h2> |
|
187 <b>checkStartProcessWithShell</b>(<i>reportError, context, config</i>) |
|
188 |
|
189 <p> |
|
190 Function to check for starting a process with a shell. |
|
191 </p> |
|
192 <dl> |
|
193 |
|
194 <dt><i>reportError</i> (func)</dt> |
|
195 <dd> |
|
196 function to be used to report errors |
|
197 </dd> |
|
198 <dt><i>context</i> (SecurityContext)</dt> |
|
199 <dd> |
|
200 security context object |
|
201 </dd> |
|
202 <dt><i>config</i> (dict)</dt> |
|
203 <dd> |
|
204 dictionary with configuration data |
|
205 </dd> |
|
206 </dl> |
|
207 <div align="right"><a href="#top">Up</a></div> |
|
208 <hr /> |
|
209 <hr /> |
|
210 <a NAME="checkSubprocessPopenWithShell" ID="checkSubprocessPopenWithShell"></a> |
|
211 <h2>checkSubprocessPopenWithShell</h2> |
|
212 <b>checkSubprocessPopenWithShell</b>(<i>reportError, context, config</i>) |
|
213 |
|
214 <p> |
|
215 Function to check for use of popen with shell equals true. |
|
216 </p> |
|
217 <dl> |
|
218 |
|
219 <dt><i>reportError</i> (func)</dt> |
|
220 <dd> |
|
221 function to be used to report errors |
|
222 </dd> |
|
223 <dt><i>context</i> (SecurityContext)</dt> |
|
224 <dd> |
|
225 security context object |
|
226 </dd> |
|
227 <dt><i>config</i> (dict)</dt> |
|
228 <dd> |
|
229 dictionary with configuration data |
|
230 </dd> |
|
231 </dl> |
|
232 <div align="right"><a href="#top">Up</a></div> |
|
233 <hr /> |
|
234 <hr /> |
|
235 <a NAME="checkSubprocessPopenWithoutShell" ID="checkSubprocessPopenWithoutShell"></a> |
|
236 <h2>checkSubprocessPopenWithoutShell</h2> |
|
237 <b>checkSubprocessPopenWithoutShell</b>(<i>reportError, context, config</i>) |
|
238 |
|
239 <p> |
|
240 Function to check for use of popen without shell equals true. |
|
241 </p> |
|
242 <dl> |
|
243 |
|
244 <dt><i>reportError</i> (func)</dt> |
|
245 <dd> |
|
246 function to be used to report errors |
|
247 </dd> |
|
248 <dt><i>context</i> (SecurityContext)</dt> |
|
249 <dd> |
|
250 security context object |
|
251 </dd> |
|
252 <dt><i>config</i> (dict)</dt> |
|
253 <dd> |
|
254 dictionary with configuration data |
|
255 </dd> |
|
256 </dl> |
|
257 <div align="right"><a href="#top">Up</a></div> |
|
258 <hr /> |
|
259 <hr /> |
|
260 <a NAME="getChecks" ID="getChecks"></a> |
|
261 <h2>getChecks</h2> |
|
262 <b>getChecks</b>(<i></i>) |
|
263 |
|
264 <p> |
|
265 Public method to get a dictionary with checks handled by this module. |
|
266 </p> |
|
267 <dl> |
|
268 <dt>Return:</dt> |
|
269 <dd> |
|
270 dictionary containing checker lists containing checker function and |
|
271 list of codes |
|
272 </dd> |
|
273 </dl> |
|
274 <dl> |
|
275 <dt>Return Type:</dt> |
|
276 <dd> |
|
277 dict |
|
278 </dd> |
|
279 </dl> |
|
280 <div align="right"><a href="#top">Up</a></div> |
|
281 <hr /> |
|
282 <hr /> |
|
283 <a NAME="hasShell" ID="hasShell"></a> |
|
284 <h2>hasShell</h2> |
|
285 <b>hasShell</b>(<i>context</i>) |
|
286 |
|
287 <p> |
|
288 Function to check, if the node of the context contains the shell keyword. |
|
289 </p> |
|
290 <dl> |
|
291 |
|
292 <dt><i>context</i> (SecurityContext)</dt> |
|
293 <dd> |
|
294 context to be inspected |
|
295 </dd> |
|
296 </dl> |
|
297 <dl> |
|
298 <dt>Return:</dt> |
|
299 <dd> |
|
300 tuple containing a flag indicating the presence of the 'shell' |
|
301 argument and flag indicating the value of the 'shell' argument |
|
302 </dd> |
|
303 </dl> |
|
304 <dl> |
|
305 <dt>Return Type:</dt> |
|
306 <dd> |
|
307 tuple of (bool, bool) |
|
308 </dd> |
|
309 </dl> |
|
310 <div align="right"><a href="#top">Up</a></div> |
|
311 <hr /> |
|
312 </body></html> |