forked from threat9/routersploit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding tests for D-Link DSL-2780B & DSL-2730B & DSL-526B DNS Change m…
…odule (threat9#533)
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
tests/exploits/routers/dlink/test_dsl_2730b_2780b_526b_dns_change.py
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,23 @@ | ||
from routersploit.modules.exploits.routers.dlink.dsl_2730b_2780b_526b_dns_change import Exploit | ||
|
||
|
||
def test_check_success(target): | ||
""" Test scenario - successful exploitation """ | ||
|
||
route_mock = target.get_route_mock("/dnscfg.cgi", methods=["POST"]) | ||
route_mock.return_value = ( | ||
"TEST" | ||
) | ||
|
||
exploit = Exploit() | ||
|
||
assert exploit.target == "" | ||
assert exploit.port == 80 | ||
assert exploit.dns1 == "8.8.8.8" | ||
assert exploit.dns2 == "8.8.4.4" | ||
|
||
exploit.target = target.host | ||
exploit.port = target.port | ||
|
||
assert exploit.check() is None | ||
assert exploit.run() is None |