forked from greenbone/openvas-scanner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChangeLog
More file actions
13776 lines (8834 loc) · 468 KB
/
Copy pathChangeLog
File metadata and controls
13776 lines (8834 loc) · 468 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2018-01-16 Hani Benhabiles <hani.benhabiles@greenbone.net>
* src/openvassd.c (check_kb_status): Disconnect and free nvticache kb
only if it was found.
2018-01-12 Hani Benhabiles <hani.benhabiles@greenbone.net>
* misc/plugutils.c (get_plugin_preference), src/openvassd.c
(check_kb_status), nasl/nasl_func.c (nasl_func_call),
nasl/nasl_misc_funcs.c (var_cmp), nasl/nasl_scanner_glue.c
(script_get_preference): Fix memory leaks.
* nasl/exec.c (cell2str): Do not duplicate array2str() return value.
(nasl_exec): Fix memory leak.
* nasl/nasl_var.c (array2str): Do not return const string.
(nasl_iterate_array): Do not free array inside function.
* nasl/nasl_var.h: Adjust function header.
2017-12-19 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/exec.c (cell_cmp): Fix regression introduced in r29164. Don't
call cell2str() before cell2atom() as it leads to executing expressions
such as incrementations and function calls twice.
2017-12-17 Hani Benhabiles <hani.benhabiles@greenbone.net>
* src/plugs_req.c (kb_missing_keyname_of_namelist, requirements_plugin)
(kb_present_keyname_of_namelist): Check for empty string too.
2017-12-15 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_var.c (nasl_array_iterator): Make a deep copy of the array,
instead of shallow one. This fixes the issue of using the array's
variable for another value or value type during the loop.
(nasl_iterate_array): Free the array.
2017-12-11 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl.c (main): Add reverse-lookup result to the host's vhosts
list like the scanner does.
2017-12-09 Hani Benhabiles <hani.benhabiles@greenbone.net>
* src/attack.c (attack_start): Add reverse-lookup name to the host's
vhosts list.
2017-12-08 Hani Benhabiles <hani.benhabiles@greenbone.net>
Handle multiple hostnames per target host.
* src/attack.c (launch_plugin, attack_host, attack_start): Adjust to use
the host's vhosts list instead of single hostname.
(list_to_str): New function.
* src/nasl_plugins.c (nasl_plugin_launch), src/pluginlaunch.c
(plugin_launch): Adjust functions headers.
* src/pluginlaunch.h, src/pluginload.h: Adjust functions headers.
2017-12-07 Hani Benhabiles <hani.benhabiles@greenbone.net>
* misc/network.c (host_info_init, host_info_free): Remove functions.
(open_sock_tcp): Adjust for host_info removal.
* misc/network.h: Remove struct host_info and functions headers.
* misc/plugutils.c (plug_get_host_fqdn, plug_get_host_ip)
(proto_post_wrapped), nasl/nasl.c (init),
nasl/nasl_builtin_openvas_tcp_scanner (plugin_run_openvas_tcp_scanner),
src/attack.c (launch_plugin, attack_host, attack_start),
src/nasl_plugins.c (nasl_plugin_launch, nasl_thread, src/pluginlaunch.c
(plugin_launch): Adjust for host_info removal.
* misc/scanneraux.h: Remove hostname field, add ip field and make vhosts
a linked-list.
* src/pluginlaunch.h, src/pluginload.h: Adjust functions headers.
2017-12-07 Hani Benhabiles <hani.benhabiles@greenbone.net>
* misc/network.h: Remove fqdn element. Make vhosts a linked-list.
* misc/network.c (socket_negotiate_ssl): Free hostname.
(open_sock_tcp): Use plug_current_vhost().
(host_info_init, host_info_free): Adjust for struct host_info change.
* misc/plugutils.c (plug_current_vhost): New function.
(plug_get_host_fqdn, proto_post_wrapped): Adjust to host_info change.
* misc/plugutils.h: Add function prototype.
* src/attack.c (launch_plugin): Rename hostname to ip_str for clarity.
2017-12-06 Juan Jose Nicola <juan.nicola@greenbone.net>
* src/utils.c (is_scanner_only_pref): The preference is log_whole_attack
instead of log_while_attack. the preference will not be sent to
the manager.
2017-12-06 Hani Benhabiles <hani.benhabiles@greenbone.net>
* misc/network.h (struct host_info): Remove name parameter.
* misc/network.c (open_sock_tcp, host_info_free): Adjust for host_info
change.
(host_info_init): Remove name parameter. Don't fetch vhosts_ip/vhosts
preferences.
* misc/plugutils.c (plug_get_hostname): Remove function.
(plug_get_host_fqdn): Don't check vhosts_ip/vhosts preferences.
(proto_post_wrapped): Adjust for host_infos change.
* misc/plugutils.h: Remove function header.
* nasl/nasl.c (init): Adjust for host_infos_init() change. Reorganize
name resolution and reverse-resolution to mimic steps in scanner.
* src/attack.c (init_host_kb): Remove hostinfos parameter. Rename
hostname to ip_str. Remove unused Hostname and Host-IP keys.
(attack_host, attack_start), src/nasl_plugins.c (nasl_thread),
nasl/nasl_ssh.c (nasl_ssh_connect): Rename hostname to ip_str for
clarity. Adjust for host_info change.
2017-12-05 Hani Benhabiles <hani.benhabiles@greenbone.net>
* misc/plugutils.c (plug_get_host_fqdn): Set host fqdn value to the
fetched vhosts value.
(proto_post_wrapped): Send host fqdn value in result message.
* misc/network.c (open_sock_tcp), src/attack.c
(error_message_to_client, attack_host), src/pluginlaunch.c
(update_running_process): Add new hostname field in result message.
2017-12-05 Hani Benhabiles <hani.benhabiles@greenbone.net>
* misc/plugutils.c (proto_post_wrapped): Refactor code.
2017-12-04 Juan Jose Nicola <juan.nicola@greenbone.net>
* src/openvassd.c (openvassd_defaults): Add new default value
open_sock_max_attempts.
* doc/openvassd.8.in: Update documentation about new default value.
* misc/network.c (open_sock_tcp): Use the prefs open_sock_max_attempts
as max value to set a port as closed. When a port is set to closed, it
send an error message to the manager.
2017-12-01 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_ssh.c (exec_ssh_cmd): Use ssh_channel_read_timeout().
2017-12-01 Juan Jose Nicola <juan.nicola@greenbone.net>
* misc/network.c (open_sock_tcp): After some unsuccessfully attempts,
the port is set to closed.
2017-11-23 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_ssh.c (exec_ssh_cmd): Attach session to a pseudo-terminal
before executing the command. This ensures that long-running commands
are properly terminated by the host on session disconnect.
2017-11-21 Juan Jose Nicola <juan.nicola@greenbone.net>
* src/pluginscheduler.c (plugin_add): Check for NULL before calling
g_strsplit during deprecated plugin check. Replace tabs with spaces.
2017-11-15 Juan Jose Nicola <juan.nicola@greenbone.net>
* nasl/nasl_misc_funcs.c (nasl_gzip): Look for a new local variable
into the lexic to select the header format, zlib or gzip.
2017-10-31 Hani Benhabiles <hani.benhabiles@greenbone.net>
* src/attack.c (attack_start): Revert r29884.
2017-10-27 Hani Benhabiles <hani.benhabiles@greenbone.net>
* src/pluginscheduler.c (plugins_scheduler_stop): New function.
(struct plugins_scheduler): Add stopped element.
* src/pluginscheduler.h: Add function header.
* src/attack.c (attack_host): Call plugins_scheduler_stop() if scan is
stopped.
2017-10-27 Hani Benhabiles <hani.benhabiles@greenbone.net>
* misc/plugutils.c (plug_fork_child): Remove debug messages.
2017-10-25 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_socket.c (nasl_open_privileged_socket): Set lowest_socket
variable, to fix close() error message.
2017-10-22 Hani Benhabiles <hani.benhabiles@greenbone.net>
* src/attack.c (attack_start): Send error message to client on
reverse-lookup failure.
2017-10-22 Hani Benhabiles <hani.benhabiles@greenbone.net>
* src/nasl_plugins.c (check_nvti): New function.
(nasl_plugin_add): Use new function.
2017-10-15 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_smb.c (nasl_win_cmd_exec): Escape the password to not be
interpreted by the shell.
2017-10-13 Hani Benhabiles <hani.benhabiles@greenbone.net>
* COPYING: Remove internal_com.h entry.
* misc/internal_com.h: Remove file.
* misc/network.c (internal_send, internal_recv): Remove message type
handling.
* misc/network.h: Adjust function headers.
* misc/plugutils.c (plug_get_host_fqdn, proto_post_wrapped)
(plug_get_key): Adjust function calls.
(plug_fork_child): Send results through global_socket directly.
* nasl/nasl_builtin_find_service.c (fwd_data), src/attack.c
(comm_send_status, attack_host), src/hosts.c (forward),
src/nasl_plugins.c (nasl_thread), src/ntp.c (__ntp_timestamp_scan_host),
src/pluginlaunch.c (update_running_processes): Adjust function calls.
2017-10-13 Hani Benhabiles <hani.benhabiles@greenbone.net>
* src/pluginlaunch.c (plugin_launch): Adjust to set child processes to
send scan results directly to main scan process instead of passing them
through parent host process.
(struct running): Remove internal_soc element.
(process_internal_msg, wait_for_children, pluginlaunch_child_cleanup)
(read_running_processes): Remove functions.
(update_running_processes): Adjust to check if child processes are
alive.
(wait_if_simult_ports, next_free_process, pluginlaunch_init)
(pluginlaunch_wait, pluginlaunch_wait_for_free_process): Don't call
removed functions.
* src/nasl_plugins.c (nasl_thread): Don't call removed function.
* src/pluginlaunch.h: Remove deleted function header.
2017-10-11 Juan Jose Nicola <juan.nicola@greenbone.net>
* src/opevassd.c (stop_all_scans): Remove popen() and get the pids
reading the /proc directory.
2017-10-10 Juan Jose Nicola <juan.nicola@greenbone.net>
* src/opevassd.c (stop_all_scans): Do not get the group process ID.
Set the char array size to 8.
2017-10-10 Juan Jose Nicola <juan.nicola@greenbone.net>
* src/opevassd.c (stop_all_scans): Evaluate the return code from
the first fscanf () call.
* Changelog: Correct log entry email.
2017-10-09 Juan Jose Nicola <juan.nicola@greenbone.net>
* src/attack: Remove error type ERR_REDIS_CONN.
(launch_plugin, attack_host): Remove handling of redis error.
2017-10-09 Juan Jose Nicola <juan.nicola@greenbone.net>
In case of redis error, the scanner detects it and send the SIGUSR2
signal to all the running scans.
* src/opevassd.c (stop_all_scans): New function.
(check_kb_status): Call stop_all_scans().
* src/attack.c: New variable global_stop_all_scans.
(all_scans_are_stopped): New function.
(launch_plugin, attack_star): Call all_scans_are_stopped().
(attack_host): Do not send error message to the client. Call
all_scans_are_stopped().
(handle_stop_all_scans_signal): New function.
(attack_network): Set SIGUSR2 signal handler. Call
all_scans_are_stopped().
2017-10-09 Hani Benhabiles <hani.benhabiles@greenbone.net>
* misc/plugutils.c (mark_successful_plugin): Remove useless function.
(proto_post_wrapped): Don't call removed function.
2017-10-06 Hani Benhabiles <hani.benhabiles@greenbone.net>
* src/attack.c (attack_start_args): Remove hostip and fqdn elements.
(attack_network, attack_start): Move hostname resolving and reverse
resolving from main scan process to the spawned host process.
2017-10-05 Hani Benhabiles <hani.benhabiles@greenbone.net>
* misc/pcap.c (v6_get_mac_addr): Remove function.
* misc/pcap_openvas.h: Remove function header.
* src/attack.c (struct attack_start_args): Remove host_mac_addr element.
(attack_start): Remove host_mac_addr check.
(attack_network): Remove handling of unused use_mac_addr preference.
2017-10-04 Hani Benhabiles <hani.benhabiles@greenbone.net>
* misc/pcap.c (get_random_bytes): Remove function.
(v6_getsourceip): Use rand() instead of get_random_bytes().
2017-09-29 Michael Wiegand <michael.wiegand@greenbone.net>
Address documentation issues.
* nasl/nasl_grammar.y: Add missing parameter documentation.
* src/attack.c: Remove documentation of non-existing parameters.
* src/ntp.c: Correct parameter name.
* src/openvassd.c: Remove documentation of non-existing parameters.
Add missing parameter documentation.
* src/plugs_req.c: Replace non-existing reference with more
appropriate Doxygen command.
2017-09-28 Juan Jose Nicola <juan.nicola@greenbone.net>
* src/openvassd.c (check_kb_status): Call kb_lnk_reset() to close
redis connection, to avoid the increase of connections and to reach
the maximum.
2017-09-27 Juan Jose Nicola <juan.nicola@greenbone.net>
* src/openvassd.c (check_kb_status): New function. Check if Redis
Server is up and if the KB exists. If KB does not exist force a reload.
(main_loop): Call new function.
2017-09-25 Michael Wiegand <michael.wiegand@greenbone.net>
* doc/Doxyfile.in, doc/Doxyfile_full.in: Set EXTRACT_PRIVATE and
EXTRACT_STATIC to YES to ensure documentation is also generated for
items Doxygen considers 'private' or 'static'.
2017-09-25 Hani Benhabiles <hani.benhabiles@greenbone.net>
* misc/network.c (openvas_connection): Remove options parameter.
(set_ids_evasion_mode): Remove function.
(open_stream_connection_ext, write_stream_connection4): Don't check
for ids evasion options.
* nasl/nasl_http.c (build_encode_URL): New function. Moved from
www_funcs.c and removed outdated NIDS evasion techniques.
(_http_req): Adjust build_encode_URL() calls.
* misc/ids_send.c, misc/ids_send.h, misc/www_funcs.c, misc/www_funcs.h:
Remove unused files.
* misc/CMakeLists.txt: Don't build removed files.
* COPYING: Remove entries of removed files.
2017-09-25 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_cert.c (build_hostname_list, get_name): Return NULL instead
of using g_assert().
2017-09-25 Hani Benhabiles <hani.benhabiles@greenbone.net>
* src/comm.c (send_plugins_preferences): Add function documentation.
2017-09-24 Hani Benhabiles <hani.benhabiles@greenbone.net>
* src/comm.c (send_plugin_preferences): New function.
(comm_send_preferences): Call new function.
* src/nasl_plugins.c (prefs_add_nvti, nvtpref_free_helper): Remove
functions.
(nasl_plugin_add): Don't add plugin preferences in memory.
* misc/plugutils.c (get_plugin_preference): When no value is found in
memory preferences, use the default one from nvticache.
2017-09-21 Juan Jose Nicola <juan.nicola@greenbone.net>
* nasl/lint.c (add_predef_varname, check_called_files) Use
g_slist_prepend instead of g_slist_append.
(nasl_lint_defvar): Set GSLists to NULL after freeing. Fix case where
a defined variables is global.
(nasl_lint): Set GSLists to NULL after freeing.
2017-09-21 Juan Jose Nicola <juan.nicola@greenbone.net>
* nasl/lint.c (nasl_lint_def, nasl_lint_call): Check if a function
is associated to a filename before to set it.
2017-09-20 Juan Jose Nicola <juan.nicola@greenbone.net>
* nasl/lint.c (nasl_lint_defvar): Add new GSList for local variables.
Handle variables declared as local.
* Changelog: Correct the format of the last entry.
2017-09-19 Juan Jose Nicola <juan.nicola@greenbone.net>
openvas-nasl-lint does not go deeper through a declared function
if it is not called/used. If a not used function has unsatisfied
dependencies, no errors will show.
* nasl/lint.c (nasl_lint_def): Receive a new argument. Add a comment.
Check if a declared function will be used, before to continue to going
deeper in the tree.
(nasl_lint_call): Receive a new argument. Check if a
declared function will be used, before to continue to going deeper in
the tree.
(nasl_lint_defvar): Receive a new argument. Check if a
declared function will be used, before to continue to going deeper in
the tree.
(make_call_func_list): New function. It adds to a list
all called functions.
(nasl_lint): New GSList. Call make_call_func_list().
Pass as argument the new GSList to functions. Free the new list.
2017-09-15 Juan Jose Nicola <juan.nicola@greenbone.net>
* nasl/lint.c (nasl_lint_defvar): Handle case in which a variable
is declared incrementing it self. Handle the case in wich a variable
is declared with 'plus equal'.
2017-09-14 Juan Jose Nicola <juan.nicola@greenbone.net>
* nasl/lint.c (add_predef_varname): Remove keywords and add them
calling get_nasl_library().
* nasl/nasl_init.c (add_nasl_library): New function. Add built-in
variables to a GSlist.
* nasl/nasl_init.h: Add function prototype.
2017-09-14 Hani Benhabiles <hani.benhabiles@greenbone.net>
* src/pluginload.c (plugins_reload_from_dir): Don't call
nvticache_save(). Don't set include dirs. Exit instead of returning.
(include_dirs): New function.
(plugins_init): Fork a child process to load-up plugins and prevent main
process memory footprint growth. Call nvtiache_save() and new function
accordingly.
2017-09-12 Hani Benhabiles <hani.benhabiles@greenbone.net>
* src/attack.c (comm_send_status): Check hostname parameter value.
2017-09-11 Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>
* src/pluginscheduler.c (plugin_add): In case a NVT marked as
dependency can not be found in the hash table, don't just
apply a "assert". Rather send a g_warning to inform that
likely a deprecated NVT was defined as a dependeny by
another NVT. This way such a problem can even be detected
when using non-developer builds.
2017-09-11 Juan Jose Nicola <juan.nicola@greenbone.net>
* src/attack.c: Define PROGRESS_BAR_STYLE.
(attack_host): Add preprocessor directives to switch the progress
bar style. In case of a dead host, it sends max_ports = -1 to the
manager, and it will not be taken into account to calculate the scan
progress.
2017-09-08 Juan Jose Nicola <juan.nicola@greenbone.net>
* misc/vendorversion.c (vendor_version_set, vendor_version_set): Correct
the comment to match with the implementation.
2017-09-08 Hani Benhabiles <hani.benhabiles@greenbone.net>
* src/comm.c (comm_send_preferences, comm_send_nvt_info): Add check for
client socket status.
(comm_wait_order): Remove warning for when the client is first to close
the socket. Use g_warning() instead of g_debug() for erroneous input
error.
2017-09-08 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_grammar.y (load_checksums, init_nasl_ctx, file_checksum):
Improve code readability by using GCRY_MD_* constants.
2017-09-07 Juan Jose Nicola <jnicola@armant.core.os.greenbone.net>
* misc/CMakeLists.txt: Set new file vendorversion.c.
* misc/vendorversion.c: New file with functions to set and to get
the vendor version.
* misc/vendorversion.h: New file with functions prototypes.
* nasl/nasl.c: Include ../misc/vendorversion.h.
(main) Add new command line option vendor-version.
* nasl/init.c (libfuncs): Add vendor_version().
* nasl/nasl_scanner_glue.c: Include ../misc/vendorversion.h.
(nasl_vendor_version): New function.
* nasl/nasl_scanner_glue.h: Add function prototype.
* src/openvassd.c: Include ../misc/vendorversion.h.
(main) Add new command line option vendor-version.
2017-09-06 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_grammar.y (load_checksums, file_checksum, init_nasl_ctx):
Refactor functions to be checksum algorithm agnostic. Handle sha256 case.
2017-09-04 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_grammar.y (init_nasl_ctx): Use a timestamp to skip checking
for .nasl and .inc files that were checked before and weren't updated
since. Delay call to load_signatures() until the checksums are needed.
(load_signatures): Rename to load_checksums.
2017-09-01 Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>
* tools/greenbone-nvt-sync.in: Globally set NVT_DIR instead of
on-demand. Separate the retrieval of feed meta information into
funtion of its own. Don't fall back to static feed meta info
in case the feed does not not contain any.
2017-08-31 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_grammar.y (load_signatures, file_md5sum): New functions.
(init_nasl_ctx): Use checksums from md5sum file to authentify nasl
files.
2017-08-29 Michael Wiegand <michael.wiegand@greenbone.net>
* INSTALL: Rework 'Configuration Options' section, remove reference to
a build flag that was removed a long time ago.
2017-08-29 Michael Wiegand <michael.wiegand@greenbone.net>
Make it possible skip dependency checks during configuration. This
makes it possible to generate documentation and source tarballs in
environments where said dependencies are not present.
* CMakeLists.txt: Move dependency checks to subdirectories. Do not
consider subdirectories containing code and dependency checks when
SKIP_SRC is defined.
* misc/CMakeLists.txt: Explicitly check for glib-2.0 and libgvm_base
since this is no longer done by the top-level CMakeLists.txt.
* nasl/CMakeLists.txt: Explicitly check for glib-2.0 since this is no
longer done by the top-level CMakeLists.txt.
* src/CMakeLists.txt: Explicitly check for glib-2.0, libgvm_base and
gcrypt since this is no longer done by the top-level CMakeLists.txt.
2017-08-28 Michael Wiegand <michael.wiegand@greenbone.net>
* doc/Doxyfile.in, doc/Doxyfile_full.in: Use correct INPUT_ENCODING,
otherwise Doxygen ends up producing invalid XML.
2017-08-21 Juan Jose Nicola <juan.nicola@.greenbone.net>
* nasl/lint.c (nasl_lint_defvar): Handle case in which the variable
is declared in a foreach node.
2017-08-16 Juan Jose Nicola <juan.nicola@greenbone.net>
Make openvas-nasl-lint able to check if a variable was defined
before to be used.
* nasl/lint.c (add_predef_varname, nasl_lint_defvar,list_cmp): New
functions.
(nasl_lint_call): Recieve less arguments and use a static variable.
(nasl_lint): Pass less arguments to nasl_lint_call. New GSList.
Call nasl_lint_defvar to check variables.
2017-08-14 Hani Benhabiles <hani.benhabiles@greenbone.net>
* src/pluginscheduler.c, src/pluginlauncher.c, src/pluginlauncher.h
(pluginlaunch_disable_parallel_checks)
(pluginlaunch_enable_parallel_checks): Fix typo in functions name.
2017-08-09 Michael Wiegand <michael.wiegand@greenbone.net>
* INSTALL: Make libssh flavor recommended in Debian install
prerequisites match the flavor recommended in gvm-libs.
2017-08-04 Michael Wiegand <michael.wiegand@greenbone.net>
Switch to NEW behavior for CMake policy CMP0005. The policy was
introduced in CMake 2.6, the OLD behavior is deprecated by definition.
This means that preprocessor definition values are now escaped
automatically and no longer have to be escaped to work around
limitations in earlier CMake versions.
* CMakeLists.txt: Switch CMake Policy CMP0005 to NEW behavior.
* misc/CMakeLists.txt, nasl/CMakeLists.txt, src/CMakeLists.txt: Remove
now superfluous escaping.
2017-08-04 Juan Jose Nicola <juan.nicola@greenbone.net>
* nasl/nasl_socket.c (nasl_socket_cert_verify): Handle case in which
tls_session is NULL or the certificate type is not x509. Fix documentation
issue.
2017-08-03 Juan Jose Nicola <juan.nicola@greenbone.net>
Function to verify certifactes retrieved from an active socket.
* nasl/nasl_socket.c (nasl_socket_cert_verify): New function.
* nasl/nasl_socket.h: Add function prototype.
* nasl/nasl_init.c (libfuncs): Add socket_cert_verify().
2017-08-03 Michael Wiegand <michael.wiegand@greenbone.net>
Unify handling of compiler flags to avoid passing the same flag
multiple times.
* CMakeLists.txt: Move explanatory comment for flags required by GPGME
here from nasl/CMakeLists.txt.
* misc/CMakeLists.txt: Stop setting HARDENING_FLAGS and
LINKER_HARDENING_FLAGS as they are already set in top-level. Stop
adding the HARDENING_FLAGS to CMAKE_C_FLAGS_RELEASE a second time,
they were already added in top-level.
* nasl/CMakeLists.txt: Stop adding GPGME related flags to
CMAKE_C_FLAGS, they were already added in top-level. Remove related
comment as well. Stop adding the HARDENING_FLAGS to
CMAKE_C_FLAGS_RELEASE a second time, they were already added in
top-level.
2017-08-03 Michael Wiegand <michael.wiegand@greenbone.net>
* CMakeLists.txt: Remove -O2 from HARDENING_FLAGS. It is not directly
related to hardening and having it in HARDENING_FLAGS actually causes
optimization flags from CMAKE_C_FLAGS_RELEASE to be duplicated or even
superseded for no good reason.
2017-08-03 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_var.c (get_var_ref_by_name): Check for null parameter.
2017-07-31 Michael Wiegand <michael.wiegand@greenbone.net>
* tools/greenbone-nvt-sync.in: Re-add period lost in last commit.
2017-08-31 Jan-Oliver Wagner <jan-oliver.wagner@greenbone.net>
Drop the HUP signal sending to gvmd by the sync script
greenbone-nvt-sync. This makes the entire module unaware of
the Greenbone Vulnerability Manager. The gvmd will on its own decide
when to load new NVT data from the scanner rather then being triggered
by the NVT sync script. That mechanism was error-prone anyway as it had
to find out the PID of gvmd on its own.
* tools/greenbone-nvt-sync.in: Adjust some comments to explain that
only OpenVAS Scanner gets a HUP after the sync.
(update_gvmd): Removed.
(do_sync): Remove the sleep and the call of update_gvmd().
* doc/greenbone-nvt-sync.8: Rempove any note on GVM accordingly.
2017-07-28 Hani Benhabiles <hani.benhabiles@greenbone.net>
* misc/ids_send.c (ids_send), nasl/nasl_host.c (nasl_same_host),
nasl/nasl_var.c (get_array_elem, add_var_to_list): Fix garbage values
and possible null pointer dereference warnings.
2017-07-28 Juan Jose Nicola <juan.nicola@greenbone.net>
* nasl/nasl_smb.c (nasl_win_cmd_exec): Add quotation marks to cmd, since
wmiexec.py needs it if the cmd has more than one word.
2017-07-27 Hani Benhabiles <hani.benhabiles@greenbone.net>
* misc/pcap.c (v6_ipaddr2devname): Fix garbage value warning.
* nasl/nasl_grammar.y (init_nasl_ctx): Fix possible null value warning.
* nasl/genrand.c (do_reseed_ntlmssp): Fix garbage value warning.
2017-07-27 Juan Jose Nicola <juan.nicola@greenbone.net>
Add the file name in the openvas-nasl-lints error message.
* nasl/lint.c (print_uncall_files): Adjust documentation.
(nasl_lint_def): Receive new parameters. Handle NODE_FUN_CALL case
to associet an undefined function with a filename. Set the actual
filename.
(nasl_lint_call): Receive new parameters. Set the file name to be
show in error message if a called function is not defined.
(nasl_lint): New hash table. Pass the table as argument to
nasl_lint_def() and nasl_lint_call() functions. Check if
the included files are used or not. Improve the code style.
2017-07-25 Michael Wiegand <michael.wiegand@greenbone.net>
* nasl/nasl_crypto.c (tls1_prf), src/pluginload.c
(current_loading_plugins, total_loading_plugins): Fix typos in
documentation.
2017-07-25 Michael Wiegand <michael.wiegand@greenbone.net>
* misc/CMakeLists.txt: Stop superfluous linking against libgcrypt.
2017-07-24 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_socket.c (nasl_open_sock_udp): Set lowest_socket variable.
(nasl_close_socket): Check lowest_socket instead of using hardcoded
value. Fixes close() error for udp sockets.
* nasl/nasl_ssh.c (nasl_ssh_connect): Set lowest_socket variable.
2017-07-24 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_grammar.y (INCLUDE): Zero subctx struct. Fixes clang
analyzer error.
2017-07-24 Juan Jose Nicola <juan.nicola@greenbone.net>
* nasl/exec.c (cell_cmp): Use cell2str() to copy the cell's values
since it checks if the cell is NULL and then are freed conveniently.
2017-07-20 Juan Jose Nicola <juan.nicola@greenbone.net>
* nasl/nasl_grammar.y (naslerror): Replace fputs and fputc
with g_message to avoid error messages end into syslog.
2017-07-19 Juan Jose Nicola <juan.nicola@greenbone.net>
Check if the included files are used or not.
* nasl/lint.c (check_called_files, print_uncall_files):
New functions.
(nasl_lint_def): Get hash table as new parameter. Add into the table
the included files.
(nasl_lint_call): Get hash table as new parameter. Mark the included
file in the table, if a called function is inside the file.
(nasl_lint): New hash table. New single linked list. Pass the table as
argument to nasl_lint_def() and nasl_lint_call() functions. Check if
the included files are used or not.
2017-07-17 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/exec.c (cell2int3): Fix compilation with gcc 7.
2017-07-12 Juan Jose Nicola <juan.nicola@greenbone.net>
* nasl/nasl_ssh.c (verify_session_id): Receive lexic as new parameter.
Used nasl_perror instead of g_message to be able to show the NVT
name in case of bad/invalid SSH session_id.
(nasl_ssh_disconnect, nasl_ssh_get_sock, nasl_ssh_set_login)
(nasl_ssh_userauth, nasl_ssh_login_interactive)
(nasl_ssh_login_interactive_pass, nasl_ssh_request_exec)
(nasl_ssh_get_issue_banner, nasl_ssh_get_server_banner)
(nasl_ssh_get_auth_methods, nasl_ssh_shell_open, nasl_ssh_shell_read)
(nasl_ssh_shell_write, nasl_ssh_shell_close): Pass lexic as argument
when it calls verify_session_id().
* nasl/nasl_text_utils.c (nasl_string): Add the string in the error
message for the case "unknow scape sequence".
* ChangeLog: Add missing information in one of my last log entry.
2017-07-12 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_debug.c (nasl_get_filename): Add null variable check.
2017-07-12 Juan Jose Nicola <juan.nicola@greenbone.net>
* nasl/nasl_debug.c (nasl_perror): Use g_strconcat() instead of
g_snprintf() to fix the message format.
2017-07-11 Juan Jose Nicola <juan.nicola@greenbone.net>
Show the name of the function in which an error ocurred. Add more
information in the error message for debugging purposes.
* nasl/nasl_debug.c (nasl_set_function_name, nasl_get_function_name):
New functions.
(nasl_perror): Add the function name to the message.
* nasl/nasl_debug.h: Add functions prototypes.
* nasl/nasl_func.c (nasl_func_call): Set the function name.
* nasl/nasl_text_utils.c (nasl_substr): Show a more specific
error message for nasl_substr() errors.
2017-07-11 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_global_ctxt.h (naslctxt): Add buffer and index elements.
Remove fp element.
* nasl/nasl_grammar.y (INCLUDE, mylex): Adjust to use ctxt buffer instead of
file pointer.
(nasl_clean_ctxt, init_nasl_ctxt): Adjust to naslctxt changes. Adjust
nasl_verify_signature() call.
* nasl/nasl_signature.c (nasl_verify_signature): Don't re-read file
content, get it as parameter instead.
* nasl/nasl_signature.h: Adjust function header.
2017-07-10 Juan Jose Nicola <juan.nicola@greenbone.net>
* nasl/exec.c (cell_cmp): Add the variable name or its content to
the error message passed to nasl_perror.
2017-07-10 Juan Jose Nicola <juan.nicola@greenbone.net>
* nasl/exec.c (cell2int3): Receive a new argument with variable
value and name to give more information in a error message.
Handle REF_VAR case to take variable value and name.
(cell2intW, cell2int): Add parameter in call to cell2int3().
(nasl_exec): Set line_nb only if it is differente to zero.
2017-07-07 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_debug.c (nasl_get_filename, nasl_set_function_filename): New
functions.
(nasl_set_filename): Handle case where passed parameter is current
debug_filename value.
* nasl/nasl_debug.h: Add functions prototypes.
* nasl/nasl_func.c (nasl_func_call): Set correct filename for executed
function.
* nasl/nasl_grammar.y (FUNCTION, INCLUDE): Use new functions to set
matching filename for defined functions.
(nasl_clean_inc): Check for null value.
2017-07-07 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_debug.c, nasl/nasl_debug.h, nasl/exec.c,
nasl/nasl_global_ctxt.h, nasl/nasl_grammar.y, nasl/nasl_tree.h,
nasl/nasl_lex_ctxt.h: Revert r28943.
2017-07-06 Juan Jose Nicola <juan.nicola@greenbone.net>
Re-add the file name to the nasl context to be showed in case of error.
* nasl/nasl_debug.c: Remove global variable debug_filename.
(nasl_set_filename): Remove function.
(nasl_perror): Add filename variable. Climb up the context to
find a filename.
* nasl/nasl_debug.h: Remove function prototype.
* nasl/exec.c (nasl_exec): Copy the filename from tree_cell
to the lexic context only in the case NODE_FUN_CALL.
(exec_nasl_script): Remove call to nasl_set_filename.
(nasl_perror): Add filename variable. Climb up the context to
find a filename.
* nasl/nasl_debug.h: Remove function prototype.
* nasl/exec.c (nasl_exec): Copy the filename from tree_cell
to the lexic context only in the case NODE_FUN_CALL.
(exec_nasl_script): Remove call to nasl_set_filename.
* nasl/nasl_global_ctxt.h (naslctxt): Add filename element.
* nasl/nasl_grammar.y: Add macro FNAME. Set filename only
for NODE_FUN_CALL.
(init_nasl_ctx): Do a copy of the parsed filename. Remove
call to nasl_set_filename.
* nasl/nasl_lex_ctxt.h (lex_ctxt): Add filename element.
* nasl/nasl_tree.h (nasl_tree): Add filename element.
2017-07-05 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_grammar.y (file_md5sum): Remove function.
(init_nasl_ctx): Check file last modification time to skip signature
reverfication.
2017-07-04 Michael Wiegand <michael.wiegand@greenbone.net>
Adapt to include-streamling in gvm-libs. Include necessary headers
directly instead of relying on other headers to include them.
* nasl/nasl.c: Add includes of errno.h (for 'errno ()') and
gvm/base/networking.h (for 'gvm_source_iface_init ()') since they are
no longer included via gvm/base/hosts.h.
2017-06-30 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_grammar.y (nasl_clean_inc): New function.
(INCLUDE): Save parsed tree cells of included files for later re-usage.
Significantly improves load-up performance.
* nasl/nasl.h: Add function prototype.
* src/pluginload.c (plugins_reload_from_dir): Call nasl_clean_inc().
2017-06-30 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_func.c (free_func): Remove unneeded call to func_is_internal().
2017-06-29 Christian Fischer <christian.fischer@greenbone.net>
* nasl/nasl_crypto.c (nasl_get_sign, nasl_get_smb2_sign,
nasl_keyexchg): Use the function names in nasl_perror
which are exposed to the NASL scripts.
2017-06-29 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_global_ctxt.h (naslctxt): Remove maxlen and buffer elements.
* nasl/nasl_grammar.y (parse_buffer, parse_len): New variables.
(init_nasl_ctx, nasl_clean_ctx, mylex): Adjust to use parse_buffer and
parse_len instead of allocating and reallocating a new ctxt buffer each
time. Improves parsing performance.
2017-06-29 Juan Jose Nicola <juan.nicola@greenbone.net>
* src/nasl_plugins.c (nasl_plugin_add): Set the preference's name to
Timeout instead of Script timeout.
2017-06-28 Hani Benhabiles <hani.benhabiles@greenbone.net>
Remove repetitive filename duplications during parsing. Improves fresh
load-up time.
* nasl/nasl_debug.c (nasl_set_filename): New function.
(nasl_perror): Use value set by new function instead of filename element
in lex_ctxt.
* nasl/nasl_debug.h: Add new function prototype.
* nasl/nasl_global_ctxt.h (lex_ctxt): Remove filename element.
* nasl/exec.c (nasl_exec, exec_nasl_script): Call nasl_set_filename().
* nasl/lint.c (nasl_lint_call), nasl/nasl_tree.c (free_tree): Remove
filename handling.
* nasl/nasl_tree.h (tree_cell): Remove filename element.
* nasl/nasl_grammar.y (FNAME): Remove macro.
(nasllex): Don't duplicate context filename.
(init_nasl_ctxt): Call nasl_set_filename().
(nasl_clean_ctxt): Don't free filename.
2017-06-28 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_tree.c (allloc_tree_cell): Remove unneeded initializations.
Remove function parameters.
* nasl/nasl_tree.h: Adjust function prototype.
* nasl/exec.c, nasl/nasl_cert.c, nasl/nasl_crypto.c,
nasl/nasl_crypto2.c, nasl/nasl_grammar.y, nasl/nasl_http.c,
nasl/nasl_misc_funcs.c, nasl/nasl_packet_forgery.c,
nasl/nasl_packet_forgery_v6.c, nasl/nasl_scanner_glue.c,
nasl/nasl_smb.c, nasl/nasl_socket.c, nasl/nasl_text_utils.c,
nasl/nasl_tree.c, nasl/nasl_var.c, nasl/nasl_wmi.c: Adjust
alloc_tree_cell() calls accordingly.
2017-06-27 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/nasl_init.c (libvars): Remove unused global variable
pcap_timeout.
2017-06-27 Michael Wiegand <michael.wiegand@greenbone.net>
* misc/network.c (read_stream_connection_unbuffered): Do not try to
store errno in 'fp->last_err'. This only makes sense when this is an
"openvas connection", otherwise 'fp' is still NULL.
2017-06-27 Juan Jose Nicola <juan.nicola@greenbone.net>
* src/nasl_plugins.c (nasl_plugin_add): Add the script timeout to
the preferences list to be passed to manager.
2017-06-26 Hani Benhabiles <hani.benhabiles@greenbone.net>
* nasl/lint.c (stringcompare): Remove function.
(nasl_lint), nasl/exec.c (exec_nasl_script): Don't call
init_nasl_library().
* nasl/nasl_lex_ctxt.c (init_empty_lex_ctxt): Call init_nasl_library().