Rewrite the logic to be positive

unless is the devil. unless/else doubly so.
bug/bundler_fix
William Vu 2016-07-01 09:15:42 -05:00
parent a1bd640eff
commit 4b01213fb5
14 changed files with 14 additions and 14 deletions

View File

@ -30,7 +30,7 @@ module Payload::Linux::BindTcp
}
# Generate the more advanced stager if we have the space
unless self.available_space.nil? || required_space > self.available_space
if self.available_space && required_space < self.available_space
conf[:exitfunk] = datastore['EXITFUNC'],
conf[:reliable] = true
end

View File

@ -33,7 +33,7 @@ module Payload::Linux::ReverseTcp
}
# Generate the advanced stager if we have space
unless self.available_space.nil? || required_space > self.available_space
if self.available_space && required_space < self.available_space
conf[:exitfunk] = datastore['EXITFUNC']
conf[:reliable] = true
end

View File

@ -34,7 +34,7 @@ module Payload::Windows::BindTcp
}
# Generate the more advanced stager if we have the space
unless self.available_space.nil? || required_space > self.available_space
if self.available_space && required_space < self.available_space
conf[:exitfunk] = datastore['EXITFUNC'],
conf[:reliable] = true
end

View File

@ -32,7 +32,7 @@ module Payload::Windows::BindTcpRc4
}
# Generate the more advanced stager if we have the space
unless self.available_space.nil? || required_space > self.available_space
if self.available_space && required_space < self.available_space
conf[:exitfunk] = datastore['EXITFUNC'],
conf[:reliable] = true
end

View File

@ -50,7 +50,7 @@ module Payload::Windows::ReverseHttp
}
# Add extra options if we have enough space
unless self.available_space.nil? || required_space > self.available_space
if self.available_space && required_space < self.available_space
conf[:url] = luri + generate_uri
conf[:exitfunk] = datastore['EXITFUNC']
conf[:ua] = datastore['MeterpreterUserAgent']

View File

@ -34,7 +34,7 @@ module Payload::Windows::ReverseTcp
}
# Generate the advanced stager if we have space
unless self.available_space.nil? || required_space > self.available_space
if self.available_space && required_space < self.available_space
conf[:exitfunk] = datastore['EXITFUNC']
conf[:reliable] = true
end

View File

@ -38,7 +38,7 @@ module Payload::Windows::ReverseTcpDns
}
# Generate the advanced stager if we have space
unless self.available_space.nil? || required_space > self.available_space
if self.available_space && required_space < self.available_space
conf[:exitfunk] = datastore['EXITFUNC']
conf[:reliable] = true
end

View File

@ -34,7 +34,7 @@ module Payload::Windows::ReverseTcpRc4
}
# Generate the advanced stager if we have space
unless self.available_space.nil? || required_space > self.available_space
if self.available_space && required_space < self.available_space
conf[:exitfunk] = datastore['EXITFUNC']
conf[:reliable] = true
end

View File

@ -34,7 +34,7 @@ module Payload::Windows::ReverseTcpRc4Dns
}
# Generate the advanced stager if we have space
unless self.available_space.nil? || required_space > self.available_space
if self.available_space && required_space < self.available_space
conf[:exitfunk] = datastore['EXITFUNC']
conf[:reliable] = true
end

View File

@ -36,7 +36,7 @@ module Payload::Windows::ReverseWinHttp
}
# Add extra options if we have enough space
unless self.available_space.nil? || required_space > self.available_space
if self.available_space && required_space < self.available_space
conf[:uri] = generate_uri
conf[:exitfunk] = datastore['EXITFUNC']
conf[:verify_cert_hash] = opts[:verify_cert_hash]

View File

@ -32,7 +32,7 @@ module Payload::Windows::BindTcp_x64
}
# Generate the more advanced stager if we have the space
unless self.available_space.nil? || required_space > self.available_space
if self.available_space && required_space < self.available_space
conf[:exitfunk] = datastore['EXITFUNC'],
conf[:reliable] = true
end

View File

@ -54,7 +54,7 @@ module Payload::Windows::ReverseHttp_x64
}
# add extended options if we do have enough space
unless self.available_space.nil? || required_space > self.available_space
if self.available_space && required_space < self.available_space
conf[:url] = luri + generate_uri
conf[:exitfunk] = datastore['EXITFUNC']
conf[:ua] = datastore['MeterpreterUserAgent']

View File

@ -41,7 +41,7 @@ module Payload::Windows::ReverseTcp_x64
}
# Generate the advanced stager if we have space
unless self.available_space.nil? || required_space > self.available_space
if self.available_space && required_space < self.available_space
conf[:exitfunk] = datastore['EXITFUNC']
conf[:reliable] = true
end

View File

@ -37,7 +37,7 @@ module Payload::Windows::ReverseWinHttp_x64
}
# Add extra options if we have enough space
unless self.available_space.nil? || required_space > self.available_space
if self.available_space && required_space < self.available_space
conf[:uri] = generate_uri
conf[:exitfunk] = datastore['EXITFUNC']
conf[:verify_cert_hash] = opts[:verify_cert_hash]