Commit Graph

27 Commits

Author SHA1 Message Date
alexisbalbachan dabf7fd2f2 Assorted fixes for NTLM AV_PAIRS container protocol and ImpactPacket LinuxSLL/IP (#2092, #2093, #2094) (#2137)
* Added fixes and tests for #2092, #2093, and #2094

* do not use interal __iter__ interface for av_pairs tests

---------

Co-authored-by: Kali <adrian.manrique@gmail.com>
2026-03-13 10:52:52 -03:00
Herbenderbler 256749185f BUG2095: Fixed fragment_by_list() crash when the child protocol is None (#2136)
* Fixed fragment_by_list() crash when child protocol is None

* removed the inline

* Added a regression test for IP.fragment_by_list() with Data payload

---------

Co-authored-by: herbenderbler <herbenderbler@users.noreply.github.com>
2026-03-12 11:30:26 -03:00
gabrielg5 27e7e7478d Updating copyright banner... 2024-08-28 17:52:57 -03:00
Gabriel Gonzalez 9b4a139405 Updated Copyright to 2023 2023-07-31 11:48:28 -03:00
Gabriel Gonzalez 8799a1a2c4 Update file banners to reflect Fortra ownership 2022-12-14 17:28:23 -03:00
0xdeaddood 7a18ef5c8b About to tag a release 2022-05-04 11:33:16 -03:00
Martin Gallo ee3d988b06 Merge branch 'master' into test-refactor-catchup 2021-12-03 06:05:46 -08:00
Martin Gallo f057477633 Removed some deprecation warnings (#1157)
* Fixed warnings related to threading, that will start to appear in Pyhton 3.10, see https://docs.python.org/3.10/whatsnew/3.10.html#deprecated
* Fixed warnings related to unrecognized escape sequences, see https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
2021-09-21 15:11:27 -03:00
Martin Gallo 0b4a759fb8 Tests: Refactors to some tests
* Moved binary hashes to base class
* Using assertEqual instead of assertTrue when possible
* Fixed a couple of bad assertions
2021-07-21 16:02:07 -07:00
Martin Gallo 51b66c71b3 Merge branch 'master' into test-refactor-catchup 2021-07-20 06:57:48 -07:00
Martin Gallo cd4fe47cfc Arrange tagline, copyright and license notes across all source files
This was a pending change to:
- Use the same tagline, copyright and license notice across files.
- Remove authors' contacts that are no longer valid (due to affiliation changes).
- Update repository location.
- Update license file with missing licenses (althought those were already in source files).

This doesn't include any change on the source code, nor any change on current copyright or licenses. Just formatting and phrasing to make our and distro's maintainers life easier.
2021-07-20 10:04:27 -03:00
Martin Gallo b3a608eb35 Tests: Removed test files PEP8 warnings 2021-07-07 18:26:09 -07:00
Martin Gallo 6bb5ea427b Tests: Continue refactor of test cases (#1112)
Continue refactor some of our test cases structure.

Main changes introduced are:
* Moved testing guide as a separate file and added some of the steps to configure the test environment.
* Leveraging unittest.main to catch command-line args and build the default suite.
* Only running GitHub actions workflow once for our own branches/PRs.
* Remote test config file can be specified via an env var now.
* Moved remote test config to a template and ignored config file.
2021-07-02 12:22:14 -03:00
0xdeaddood 142cacb649 Merge pull request #1074 from franferrax/master
WMI objects minor refactors, fixes, and offline parsing tests
2021-06-29 12:35:13 -03:00
Martin Gallo 658e0ab8e1 Tests: First batch of changes on refactoring test cases (#1102)
Tests: First batch of changes on refactoring test cases

This is the first part of a larger effort to refactor some of our test cases structure.

Main changes introduced are:
- Using pytest as the testing framework to organize and mark test cases.
- Replacing custom bash scripts with test cases discovery.
- Integrating pytest-cov plugin to easier coverage collection and reporting.
- Marking remote test cases to being able to pick those during run.
- Abstracted remote test cases configuration in a base class.
- Consolidating pytest, coverage and tox configuration in a single tox.ini file.
- Removed some Python 2.5 support and replaced custom compat checks with six.
- Replace unittest.TextTestRunner.run by unittest.main (cherry-picked from f5dab5ca76, thanks @franferrax !)
2021-06-25 11:19:52 -03:00
Francisco Ferrari Bihurriet f5dab5ca76 Replace unittest.TextTestRunner.run by unittest.main
In this way, tests return the execution status to the OS shell, making the tox run fail and report failures in GitHub (hopefully)
2021-06-08 02:43:53 -03:00
Martin Gallo 2e3cd7cd7d Tests: Removed some deprecation warnings (#1070)
Replaced some test alias that were deprecated long time ago and were showing some warnings in our tests:

- `assert_` with `assertTrue`
- `assertEquals` with `assertEqual`
2021-05-18 12:02:45 -03:00
Martin Gallo fea485d2e4 Attempt to fix Python 3.9 compatibility issue with Thread.is_alive (#1061)
As mentioned in #946 and #1054, one unit test of the `ImpactPacket` suite was using the `isAlive` method which was already deprecated in Python 3.8, and removed in Python 3.9. This changes its use to `is_alive`, introduced back in Python 2.6!
2021-04-21 10:08:25 -03:00
Emmanuel Arias 82f2447004 Dummy clean on file
This is a lazy change. Delete commented and unused lines.
2019-05-04 21:09:26 -03:00
asolino b2f5337b55 Calling coverage through python 2018-12-10 10:14:16 -03:00
asolino 3c3d7be748 Adding / removing new line at the end of files 2018-12-05 10:46:32 -03:00
asolino ec77ea3d06 Code cleanup homework
- Optimizing imports
- Removing unused variables
- Still a lot to do.
- Test cases passing OK
2018-12-04 14:47:16 -03:00
asolino ea5fbbb287 ImpactPacket remaining test cases ported to Python3 2018-10-16 16:54:40 -03:00
asolino e5aca34786 test_TCP.py example Python3 port 2018-10-16 16:34:09 -03:00
asolino 2bd682a420 Tox and coverage support
Now tox/coverage support should work. Just run tox from the main impacket directory and it should run all the test cases (you still need to complete all the parameters in tests/SMB_RPC/dcetests.cfg)
It will create a test/htmlcov directory, browse the index.html file to get all the coverage stats. Right now we're at 64+% in coveragefor the whole library. Not bad and there are a quick easy wins there.
Testing and tweaking needed!
2018-04-11 13:34:26 -05:00
asolino fbe9b1b046 Adding tox support for faster testing. Will make things easier when adding Python3 support
* Check tox.ini in case you need to change something
* Don't forget to edit/configure tests/SMB_RPC/dcetests.cfg for all the SMB_RPC test cases
* Still need to analyze code coverage
2018-04-09 20:38:32 -05:00
asolino 0f6f592ea3 Moving test cases to root directory 2018-04-08 23:06:58 -05:00