Re: UPDATE: net/py-impacket

2021-09-07 Thread Sebastian Reitenbach
ping, anyone?

Am Dienstag, August 24, 2021 23:25 CEST, schrieb "Sebastian Reitenbach" 
:

> Hi,
>
> below patch updates impacket from 0.9.21 to 0.9.23.
> tested with a zerologon exploit, that requires at least 0.9.22, as the 
> NETLOGON structs for NetrServerPasswordSet2 were only added there.
>
> OK?
>
> cheers,
> Sebastian
>
Index: Makefile
===
RCS file: /cvs/ports/net/py-impacket/Makefile,v
retrieving revision 1.26
diff -u -r1.26 Makefile
--- Makefile23 Feb 2021 19:39:33 -  1.26
+++ Makefile7 Sep 2021 05:58:39 -
@@ -4,12 +4,11 @@

 COMMENT =  Python classes providing access to network packets

-MODPY_EGG_VERSION =0.9.21
+MODPY_EGG_VERSION =0.9.23
 DISTNAME = impacket-${MODPY_EGG_VERSION}
 PKGNAME =  py-${DISTNAME}
 EPOCH =0
 CATEGORIES =   net security
-REVISION = 0

 HOMEPAGE = 
https://www.secureauth.com/labs/open-source-tools/impacket

Index: distinfo
===
RCS file: /cvs/ports/net/py-impacket/distinfo,v
retrieving revision 1.9
diff -u -r1.9 distinfo
--- distinfo31 May 2020 12:05:22 -  1.9
+++ distinfo7 Sep 2021 05:58:39 -
@@ -1,2 +1,2 @@
-SHA256 (impacket-0.9.21.tar.gz) = kS+BJWTofDGhYs/gYm86bLxbaGTe7b/vwx9tMhhZreM=
-SIZE (impacket-0.9.21.tar.gz) = 1270110
+SHA256 (impacket-0.9.23.tar.gz) = HBvopQzb48/8VmumT1UrGyi8x5t6QGuDOVa0nFbXcYQ=
+SIZE (impacket-0.9.23.tar.gz) = 4086505
Index: patches/patch-examples_goldenPac_py
===
RCS file: /cvs/ports/net/py-impacket/patches/patch-examples_goldenPac_py,v
retrieving revision 1.5
diff -u -r1.5 patch-examples_goldenPac_py
--- patches/patch-examples_goldenPac_py 31 May 2020 12:05:22 -  1.5
+++ patches/patch-examples_goldenPac_py 7 Sep 2021 05:58:39 -
@@ -15,7 +15,7 @@
  #
  #   if domain.net and/or domain-host do not resolve, add them
  #   to the hosts file or use the -dc-ip and -target-ip parameters
-@@ -1093,14 +1093,14 @@ if __name__ == '__main__':
+@@ -1094,14 +1094,14 @@ if __name__ == '__main__':
  if len(sys.argv)==1:
  parser.print_help()
  print("\nExamples: ")
Index: patches/patch-examples_raiseChild_py
===
RCS file: /cvs/ports/net/py-impacket/patches/patch-examples_raiseChild_py,v
retrieving revision 1.5
diff -u -r1.5 patch-examples_raiseChild_py
--- patches/patch-examples_raiseChild_py31 May 2020 12:05:22 -  
1.5
+++ patches/patch-examples_raiseChild_py7 Sep 2021 05:58:39 -
@@ -2,7 +2,7 @@
 Index: examples/raiseChild.py
 --- examples/raiseChild.py.orig
 +++ examples/raiseChild.py
-@@ -1248,18 +1248,18 @@ if __name__ == '__main__':
+@@ -1249,18 +1249,18 @@ if __name__ == '__main__':
  if len(sys.argv)==1:
  parser.print_help()
  print("\nExamples: ")
@@ -27,10 +27,3 @@
  sys.exit(1)

  options = parser.parse_args()
-@@ -1311,4 +1311,4 @@ if __name__ == '__main__':
- logging.critical(str(e))
- if hasattr(e, 'error_code'):
- if e.error_code == 0xc073:
--logging.info("Account not found in domain. (RID:%s)", 
options.targetRID)
-\ No newline at end of file
-+logging.info("Account not found in domain. (RID:%s)", 
options.targetRID)
Index: pkg/PLIST
===
RCS file: /cvs/ports/net/py-impacket/pkg/PLIST,v
retrieving revision 1.8
diff -u -r1.8 PLIST
--- pkg/PLIST   31 May 2020 12:05:22 -  1.8
+++ pkg/PLIST   7 Sep 2021 05:58:39 -
@@ -39,6 +39,8 @@
 
lib/python${MODPY_VERSION}/site-packages/impacket/${MODPY_PYCACHE}ese.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/impacket/${MODPY_PYCACHE}helper.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/impacket/${MODPY_PYCACHE}hresult_errors.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/impacket/${MODPY_PYCACHE}http.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/impacket/${MODPY_PYCACHE}mapi_constants.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/impacket/${MODPY_PYCACHE}mqtt.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/impacket/${MODPY_PYCACHE}nmb.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/impacket/${MODPY_PYCACHE}nt_errors.${MODPY_PYC_MAGIC_TAG}pyc
@@ -78,12 +80,16 @@
 
lib/python${MODPY_VERSION}/site-packages/impacket/dcerpc/v5/${MODPY_PYCACHE}epm.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/impacket/dcerpc/v5/${MODPY_PYCACHE}even.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/impacket/dcerpc/v5/${MODPY_PYCACHE}even6.${MODPY_PYC_MAGIC_TAG}pyc

UPDATE: net/py-impacket

2021-08-24 Thread Sebastian Reitenbach
Hi,

below patch updates impacket from 0.9.21 to 0.9.23.
tested with a zerologon exploit, that requires at least 0.9.22, as the 
NETLOGON structs for NetrServerPasswordSet2 were only added there.

OK?

cheers,
Sebastian

Index: Makefile
===
RCS file: /cvs/ports/net/py-impacket/Makefile,v
retrieving revision 1.26
diff -u -r1.26 Makefile
--- Makefile23 Feb 2021 19:39:33 -  1.26
+++ Makefile24 Aug 2021 21:22:23 -
@@ -4,12 +4,11 @@

 COMMENT =  Python classes providing access to network packets

-MODPY_EGG_VERSION =0.9.21
+MODPY_EGG_VERSION =0.9.23
 DISTNAME = impacket-${MODPY_EGG_VERSION}
 PKGNAME =  py-${DISTNAME}
 EPOCH =0
 CATEGORIES =   net security
-REVISION = 0

 HOMEPAGE = 
https://www.secureauth.com/labs/open-source-tools/impacket

Index: distinfo
===
RCS file: /cvs/ports/net/py-impacket/distinfo,v
retrieving revision 1.9
diff -u -r1.9 distinfo
--- distinfo31 May 2020 12:05:22 -  1.9
+++ distinfo24 Aug 2021 21:22:23 -
@@ -1,2 +1,2 @@
-SHA256 (impacket-0.9.21.tar.gz) = kS+BJWTofDGhYs/gYm86bLxbaGTe7b/vwx9tMhhZreM=
-SIZE (impacket-0.9.21.tar.gz) = 1270110
+SHA256 (impacket-0.9.23.tar.gz) = HBvopQzb48/8VmumT1UrGyi8x5t6QGuDOVa0nFbXcYQ=
+SIZE (impacket-0.9.23.tar.gz) = 4086505
Index: patches/patch-examples_goldenPac_py
===
RCS file: /cvs/ports/net/py-impacket/patches/patch-examples_goldenPac_py,v
retrieving revision 1.5
diff -u -r1.5 patch-examples_goldenPac_py
--- patches/patch-examples_goldenPac_py 31 May 2020 12:05:22 -  1.5
+++ patches/patch-examples_goldenPac_py 24 Aug 2021 21:22:23 -
@@ -15,7 +15,7 @@
  #
  #   if domain.net and/or domain-host do not resolve, add them
  #   to the hosts file or use the -dc-ip and -target-ip parameters
-@@ -1093,14 +1093,14 @@ if __name__ == '__main__':
+@@ -1094,14 +1094,14 @@ if __name__ == '__main__':
  if len(sys.argv)==1:
  parser.print_help()
  print("\nExamples: ")
Index: patches/patch-examples_raiseChild_py
===
RCS file: /cvs/ports/net/py-impacket/patches/patch-examples_raiseChild_py,v
retrieving revision 1.5
diff -u -r1.5 patch-examples_raiseChild_py
--- patches/patch-examples_raiseChild_py31 May 2020 12:05:22 -  
1.5
+++ patches/patch-examples_raiseChild_py24 Aug 2021 21:22:23 -
@@ -2,7 +2,7 @@
 Index: examples/raiseChild.py
 --- examples/raiseChild.py.orig
 +++ examples/raiseChild.py
-@@ -1248,18 +1248,18 @@ if __name__ == '__main__':
+@@ -1249,18 +1249,18 @@ if __name__ == '__main__':
  if len(sys.argv)==1:
  parser.print_help()
  print("\nExamples: ")
@@ -27,10 +27,3 @@
  sys.exit(1)

  options = parser.parse_args()
-@@ -1311,4 +1311,4 @@ if __name__ == '__main__':
- logging.critical(str(e))
- if hasattr(e, 'error_code'):
- if e.error_code == 0xc073:
--logging.info("Account not found in domain. (RID:%s)", 
options.targetRID)
-\ No newline at end of file
-+logging.info("Account not found in domain. (RID:%s)", 
options.targetRID)
Index: pkg/PLIST
===
RCS file: /cvs/ports/net/py-impacket/pkg/PLIST,v
retrieving revision 1.8
diff -u -r1.8 PLIST
--- pkg/PLIST   31 May 2020 12:05:22 -  1.8
+++ pkg/PLIST   24 Aug 2021 21:22:23 -
@@ -39,6 +39,8 @@
 
lib/python${MODPY_VERSION}/site-packages/impacket/${MODPY_PYCACHE}ese.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/impacket/${MODPY_PYCACHE}helper.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/impacket/${MODPY_PYCACHE}hresult_errors.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/impacket/${MODPY_PYCACHE}http.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/impacket/${MODPY_PYCACHE}mapi_constants.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/impacket/${MODPY_PYCACHE}mqtt.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/impacket/${MODPY_PYCACHE}nmb.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/impacket/${MODPY_PYCACHE}nt_errors.${MODPY_PYC_MAGIC_TAG}pyc
@@ -78,12 +80,16 @@
 
lib/python${MODPY_VERSION}/site-packages/impacket/dcerpc/v5/${MODPY_PYCACHE}epm.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/impacket/dcerpc/v5/${MODPY_PYCACHE}even.${MODPY_PYC_MAGIC_TAG}pyc
 
lib/python${MODPY_VERSION}/site-packages/impacket/dcerpc/v5/${MODPY_PYCACHE}even6.${MODPY_PYC_MAGIC_TAG}pyc
+lib/python${MODPY_VERSION}/site-packages/impacket/dcerpc/v5/${MODPY_PYCACHE}iphlp.${MODPY_PYC_MAGIC_TAG}pyc
 

UPDATE: net/py-impacket

2014-09-26 Thread David Coppa

Hi!

I need secretsdump.py, so I revamped this old port.

Comments / OKs ?

Ciao,
David

Index: Makefile
===
RCS file: /cvs/ports/net/py-impacket/Makefile,v
retrieving revision 1.8
diff -u -p -u -p -r1.8 Makefile
--- Makefile11 Mar 2013 11:35:55 -  1.8
+++ Makefile26 Sep 2014 07:45:00 -
@@ -2,33 +2,46 @@
 
 COMMENT =  Python classes providing access to network packets
 
-MODPY_EGG_VERSION =0.9.6.0
-DISTNAME = Impacket-${MODPY_EGG_VERSION}
-PKGNAME =  py-impacket-${MODPY_EGG_VERSION}
-REVISION = 3
+MODPY_EGG_VERSION =0.9.12
+DISTNAME = impacket-${MODPY_EGG_VERSION}
+PKGNAME =  py-${DISTNAME}
 
-CATEGORIES =   net
+CATEGORIES =   net security
 
-HOMEPAGE = http://oss.coresecurity.com/projects/impacket.html
+HOMEPAGE = 
http://corelabs.coresecurity.com/index.php?module=Wikiaction=viewtype=toolname=Impacket
 
-# Apache
+# Apache modified
 PERMIT_PACKAGE_CDROM = Yes
 
-MASTER_SITES = http://oss.coresecurity.com/repo/
+MASTER_SITES = ${MASTER_SITE_PYPI:=i/impacket/}
 
 MODULES =  lang/python
 
+MODPY_ADJ_FILES =  impacket/ese.py \
+   impacket/logger.py \
+   impacket/tds.py
+
 # one example also uses python-tkinter, but it's pretty heavy and
 # not required for normal use.
-RUN_DEPENDS =  security/py-crypto \
-   net/py-pcapy
+RUN_DEPENDS =  net/py-pcapy \
+   security/py-crypto=2.6 \
+   security/py-openssl
 
 NO_TEST =  Yes
 
+pre-configure:
+   ${SUBST_CMD} ${WRKSRC}/examples/nmapAnswerMachine.py
+
 post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/py-impacket
-   mv ${PREFIX}/share/doc/Impacket/ ${PREFIX}/share/doc/py-impacket
-   mv ${PREFIX}/bin/*py ${PREFIX}/share/examples/py-impacket
-   mv ${PREFIX}/bin/* ${PREFIX}/share/doc/py-impacket
+   mv ${PREFIX}/bin/*.py ${PREFIX}/share/examples/py-impacket/
+   mv ${PREFIX}/share/doc/impacket ${PREFIX}/share/doc/py-impacket
+# Fix permissions
+   chmod 0444 ${PREFIX}/share/doc/py-impacket/*
+# Add missing shebangs
+.for s in loopchain nmapAnswerMachine os_ident uncrc32
+   perl -pi -e 'print #!${MODPY_BIN}\n if $$. == 1' \
+   ${PREFIX}/share/examples/py-impacket/${s}.py
+.endfor
 
 .include bsd.port.mk
Index: distinfo
===
RCS file: /cvs/ports/net/py-impacket/distinfo,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 distinfo
--- distinfo31 May 2011 08:35:20 -  1.2
+++ distinfo26 Sep 2014 07:45:00 -
@@ -1,5 +1,2 @@
-MD5 (Impacket-0.9.6.0.tar.gz) = Y5OATHuIvKic91FiFKYQMw==
-RMD160 (Impacket-0.9.6.0.tar.gz) = dvOBoNa+f9/o2BA5W75g9tLyIC8=
-SHA1 (Impacket-0.9.6.0.tar.gz) = vGl5IFho5m24zLxNjMQjCJSqM0Y=
-SHA256 (Impacket-0.9.6.0.tar.gz) = MdUazaQjiJ/kmKPIElYmliB4DCr2N4UJ3vaV5OacWN8=
-SIZE (Impacket-0.9.6.0.tar.gz) = 241509
+SHA256 (impacket-0.9.12.tar.gz) = Wc1x5prGbmspBdZj5HV3Lx+UuTsDn5Kbo9ZVpzD72TU=
+SIZE (impacket-0.9.12.tar.gz) = 965250
Index: patches/patch-examples_nmapAnswerMachine_py
===
RCS file: patches/patch-examples_nmapAnswerMachine_py
diff -N patches/patch-examples_nmapAnswerMachine_py
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-examples_nmapAnswerMachine_py 26 Sep 2014 07:45:00 -
@@ -0,0 +1,23 @@
+$OpenBSD$
+--- examples/nmapAnswerMachine.py.orig Thu Jul 17 17:39:36 2014
 examples/nmapAnswerMachine.py  Thu Sep 25 18:14:30 2014
+@@ -14,11 +14,11 @@ from impacket.ImpactPacket import TCPOption
+ 
+ MAC = 01:02:03:04:05:06
+ IP  = 192.168.67.254
+-IFACE = eth0
++IFACE = em0
+ OPEN_TCP_PORTS = [80, 443]
+ OPEN_UDP_PORTS = [111]
+ UDP_CMD_PORT = 12345
+-nmapOSDB = '/usr/share/nmap/nmap-os-db'
++nmapOSDB = '${LOCALBASE}/share/nmap/nmap-os-db'
+ 
+ # Fingerprint = 'Adtran NetVanta 3200 router' # CD=Z TOSI=Z --- NMAP 
detects it as Linux!!!
+ # Fingerprint = 'ADIC Scalar 1000 tape library remote management unit' # DFI=S
+@@ -1120,4 +1120,4 @@ if __name__ == '__main__':
+ # [-] ??? (RUL) Length of return UDP packet is correct
+ 
+ # sudo nmap -O 127.0.0.2 -p 22,111,89
+-# sudo python nmapAnswerMachine.py -i eth0 -p 192.168.66.254 -f 'Sun Solaris 
9 (SPARC)'
++# sudo python nmapAnswerMachine.py -i em0 -p 192.168.66.254 -f 'Sun Solaris 9 
(SPARC)'
Index: patches/patch-examples_tracer_py
===
RCS file: patches/patch-examples_tracer_py
diff -N patches/patch-examples_tracer_py
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-examples_tracer_py26 Sep 2014 07:45:00 -
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- examples/tracer.py.origThu Sep 25 18:13:23 2014
 examples/tracer.py