-
Notifications
You must be signed in to change notification settings - Fork 649
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: NASL builtin function for open privileged sockets with udp and tcp
- Loading branch information
Showing
10 changed files
with
267 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# SPDX-FileCopyrightText: 2024 Greenbone AG | ||
# | ||
# SPDX-License-Identifier: GPL-2.0-or-later WITH x11vnc-openssl-exception | ||
|
||
display("Start"); | ||
display("is function defined: ", defined_func("open_priv_sock_tcp")); | ||
sock = open_priv_sock_tcp(dport: 34254); | ||
display("was socket created: ", !isnull(sock)); | ||
display("fd: ", sock); | ||
ret = send(socket: sock, data: 'foobar'); | ||
display("num bytes sent: ", ret); | ||
rec = recv(socket: sock, length: 10, min: 3); | ||
display("received: ", rec); | ||
port = get_source_port(sock); | ||
display("source port: ", port); | ||
close(sock); | ||
display("end"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# SPDX-FileCopyrightText: 2024 Greenbone AG | ||
# | ||
# SPDX-License-Identifier: GPL-2.0-or-later WITH x11vnc-openssl-exception | ||
|
||
display("Start"); | ||
display("is function defined: ", defined_func("open_priv_sock_udp")); | ||
sock = open_priv_sock_udp(dport: 34254); | ||
display("was socket created: ", !isnull(sock)); | ||
display("fd: ", sock); | ||
ret = send(socket: sock, data: '123'); | ||
display("num bytes sent: ", ret); | ||
rec = recv(socket: sock, length: 10); | ||
display(rec); | ||
close(sock); | ||
display("end"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.