Skip to content

Commit

Permalink
Adding tests for D-Link DSL-2780B & DSL-2730B & DSL-526B DNS Change m…
Browse files Browse the repository at this point in the history
…odule (threat9#533)
  • Loading branch information
lucyoa authored Oct 7, 2018
1 parent 219d86c commit 581acc6
Showing 1 changed file with 23 additions and 0 deletions.
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

0 comments on commit 581acc6

Please sign in to comment.