File: simple_parse.nasl

package info (click to toggle)
openvas-scanner 23.38.1-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 22,468 kB
  • sloc: ansic: 41,621; xml: 6,251; pascal: 3,723; yacc: 1,250; sh: 1,068; makefile: 333; sql: 282; javascript: 12
file content (191 lines) | stat: -rw-r--r-- 9,032 bytes parent folder | download
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
# SPDX-FileCopyrightText: 2023 Greenbone AG
# Some text descriptions might be excerpted from (a) referenced
# source(s), and are Copyright (C) by the respective right holder(s).
#
# SPDX-License-Identifier: GPL-2.0-or-later WITH x11vnc-openssl-exception

if(description)
{
  script_oid("0.0.0.0.0.0.0.0.0.1");
  script_version("2022-11-14T13:47:12+0000");
  script_tag(name:"cvss_base", value:"9.0");
  script_tag(name:"cvss_base_vector", value:"AV:N/AC:L/Au:N/C:N/I:N/A:C");
  script_tag(name:"last_modification", value:"2022-11-14 13:47:12 +0000 (Mon, 14 Feb 2022)");
  script_tag(name:"creation_date", value:"2013-04-16 11:21:21 +0530 (Tue, 16 Apr 2013)");
  script_name("that is a very long and descriptive name");

  script_category(ACT_DENIAL);
  script_tag(name:"qod_type", value:"remote_vul");
  script_copyright("Copyright (C) 2022 Greenbone AG");
  script_family("Denial of Service");
  script_dependencies("ssh_detect.nasl");
  script_require_ports("Services/ssh", 22);
  script_mandatory_keys("ssh/blubb/detected");

  script_tag(name:"impact", value:"Successful exploitation will allow remote attackers to destroy the world. Lets sing the doom song now.");

  script_tag(name:"affected", value:"Everything.");

  script_tag(name:"insight", value:"The flaw is very risky...
  ...
  quasi exponential. Doom.");

  script_tag(name:"solution", value:"Upgrade.");

  script_tag(name:"solution_type", value:"VendorFix");
  script_tag(name:"summary", value:"This triggered by something, probably sending bytes");

  exit(0);
}

include("ssh_func.inc");
include("misc_func.inc");
include("port_service_func.inc");

port = ssh_get_port(default:22);
banner = ssh_get_serverbanner(port:port);
if (!banner || "Blubb" >!< banner)
  exit(0);

soc = open_sock_tcp(port);
if(!soc)
  exit(0);

ini_req = raw_string(0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                     0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                     0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                     0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                     0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42);

req = raw_string(0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,

                 ##3rd byte in this next line causes crash
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42,
                 0x42);


send(socket:soc, data:ini_req);
recv(socket:soc, length:1024);

send(socket:soc, data:req);
recv(socket:soc, length:1024);

close(soc);

sleep(5);

soc2 = open_sock_tcp(port);
if(!soc2)
{
  security_message(port);
  exit(0);
}
else
{
  resp = recv(socket:soc2, length:1024);
  if("Blubb" >!< resp)
  {
    close(soc2);
    security_message(port);
    exit(0);
  }
}

close(soc2);