Questions about custom IP/UDP/RPC packets

ste0640 <[email protected]> Fri, 5 Apr 2019 20:36:13 +0000
Newsgroups gmane.comp.security.nmap.devel
Message-ID <[email protected]>
--===============1266901961882202783==
Content-Language: de-DE
Content-Type: multipart/alternative;
	boundary="_000_c7434a6c8eab4329a8da876c3df8e1ffthide_"

--_000_c7434a6c8eab4329a8da876c3df8e1ffthide_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi everyone,



I hope I am not at the wrong place here for questions.



I tried to write a script to discover profinet devices on an ip address and=
 get information about them. Mostly to test the knowledge I gathered about =
this topic in an internship and maybe make it useable for others too.

I am new to lua and the nmap libs but they seemed suitable for this task.



So I used a hex string for my packet and tried to send first with bind, con=
nect and send, after that with ip_open and ip_send. Both times the packet w=
hich I captured with Wireshark had no checksum although I calculated it and=
 put it in the right place.

Does somebody know what I have done wrong? Or did I understand the document=
ation in the wrong way?



Thanks in advance if somebody can help me there. Even if it's only a link f=
or further studies.



Regards,

Stefan



--_000_c7434a6c8eab4329a8da876c3df8e1ffthide_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
	{mso-style-name:msonormal;
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;}
span.E-MailFormatvorlage19
	{mso-style-type:personal-compose;
	color:black;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"DE" link=3D"#0563C1" vlink=3D"#954F72">
<div class=3D"WordSection1">
<p><span lang=3D"EN-US" style=3D"font-size:12.0pt;color:black">Hi everyone,=
<o:p></o:p></span></p>
<p><span lang=3D"EN-US" style=3D"font-size:12.0pt;color:black"><o:p>&nbsp;<=
/o:p></span></p>
<p><span lang=3D"EN-US" style=3D"font-size:12.0pt;color:black">I hope I am =
not at the wrong place here for questions.<o:p></o:p></span></p>
<p><span lang=3D"EN-US" style=3D"font-size:12.0pt;color:black"><o:p>&nbsp;<=
/o:p></span></p>
<p><span lang=3D"EN-US" style=3D"font-size:12.0pt;color:black">I tried to w=
rite a script to discover profinet devices on an ip address and get informa=
tion about them. Mostly to test the knowledge I gathered about this topic i=
n an internship and maybe make it useable
 for others too.<o:p></o:p></span></p>
<p><span lang=3D"EN-US" style=3D"font-size:12.0pt;color:black">I am new to =
lua and the nmap libs but they seemed suitable for this task.<o:p></o:p></s=
pan></p>
<p><span lang=3D"EN-US" style=3D"font-size:12.0pt;color:black"><o:p>&nbsp;<=
/o:p></span></p>
<p><span lang=3D"EN-US" style=3D"font-size:12.0pt;color:black">So I used a&=
nbsp;hex string for my packet and tried to send first with bind, connect an=
d send, after that with ip_open and ip_send. Both times the packet which I =
captured with Wireshark had no checksum although
 I calculated it and put it in the right place.<o:p></o:p></span></p>
<p><span lang=3D"EN-US" style=3D"font-size:12.0pt;color:black">Does somebod=
y know what I have done wrong? Or did I understand the documentation in the=
 wrong way?<o:p></o:p></span></p>
<p><span lang=3D"EN-US" style=3D"font-size:12.0pt;color:black"><o:p>&nbsp;<=
/o:p></span></p>
<p><span lang=3D"EN-US" style=3D"font-size:12.0pt;color:black">Thanks in ad=
vance if somebody can help me there. Even if it&#8217;s only a link for fur=
ther studies.<o:p></o:p></span></p>
<p><span lang=3D"EN-US" style=3D"font-size:12.0pt;color:black"><o:p>&nbsp;<=
/o:p></span></p>
<p><span lang=3D"EN-US" style=3D"font-size:12.0pt;color:black">Regards,<o:p=
></o:p></span></p>
<p><span lang=3D"EN-US" style=3D"font-size:12.0pt;color:black">Stefan<o:p><=
/o:p></span></p>
<p><span lang=3D"EN-US" style=3D"font-size:12.0pt;color:black"><o:p>&nbsp;<=
/o:p></span></p>
</div>
</body>
</html>

--_000_c7434a6c8eab4329a8da876c3df8e1ffthide_--

--===============1266901961882202783==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Sent through the dev mailing list
https://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/
--===============1266901961882202783==--