Skip to content

Commit

Permalink
Fixing issue #40 and other small text edits
Browse files Browse the repository at this point in the history
- Fixing issue #40, missing UTF-8 in coding file causing crash on Kali
Linux
- Random edits on *.md files.
- Upped VERSION file to reflect current version.
  • Loading branch information
mrbrutti committed Apr 13, 2015
1 parent 7025be7 commit 2194781
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 20 deletions.
34 changes: 33 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,36 @@
- AdminWeb & README.md

#### 3-15-15
- Adding First Run auto bundler
- Adding first-run auto bundler installer and bundler requirements.
- Rubocop minor fixes
- CHANGELOG & TODO updates.
- Error on first run only due to lack of proper execution order of first-run methods.
- Fixing first-run auto-bundler to correctly contemplate Gemfile
- Bug Fixes & first-setup enhancements.

#### 3-16-15
- Adding API /api/* to AdminWeb

#### 3-18-15
- Testing Slack Notifications

#### 3-19-15
- default is to be verbose
- Added simple log() & log_debug() methods :-)
- Fixed templates and sinatra_helpers to reflect changes.
- Updating jquery to 2.1.3
- Updating bootstrap to 3.3.4

#### 3-23-15
- Adding some text surrounding MongoDB. This fixed #38 since we realized MongoMapper does require an updated version of MongoDB.

#### 3-24-15
- XMPP Commands
- Adding jabber server option.
- fixing a few bugs found on JSON templates :=)
- removed subject option from xmpp since it makes no sense any longer to have it.
- First Alpha version of Xmpp Command time to play with it.
- It subscribes users and sends them a template message.
- Follows same delivery methodology as any other sender.
- Fixing a few things that were wrong with the AES implementation to be fully backward compatible with old crypto model
- Changed version - 0.5.1 farfullero
5 changes: 4 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
- [x] - Part two Full API integration.
- [x] + beef_api.rb
- [x] + BeefAdmin command
- [ ]- XMPP Command
- [x] + send message
- [ ] + send Attachments
- [ ]- Add user agent strings. possibly reimplement our own very bad class.
- [ ]- msfvenon user-agent based dynamic shell payloads to Cloner
- [ ]- Evaluate/Add tracking methods available to people.
Expand All @@ -18,7 +21,7 @@
- [ ]- Migrate SSH commands to Net::SSH

##### Testing
- [ ]- Implement RuboCop and pass most tests - [IN PROGRESS]
- [x]- Implement RuboCop and pass most tests - [IN PROGRESS]
- [ ]- Implement Testing Framework for commands & Options.

##### Wiki Documentation:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2
0.5.1
36 changes: 19 additions & 17 deletions lib/cartero/commands/social/xmpp.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#encoding: utf-8
module Cartero
module Commands
class Xmpp < ::Cartero::Command
Expand Down Expand Up @@ -33,7 +34,7 @@ def initialize
"Sets message subject") do |m|
@options.message = m
end

opts.on("-U", "--username JID", String,
"Optional way of setting up jabber username") do |u|
@options.jid = u
Expand All @@ -56,24 +57,24 @@ def initialize

def setup
require 'xmpp4r'

if @options.data.nil?
raise StandardError, "A data set [--data] must be provided"
elsif !File.exist?(File.expand_path(@options.data))
raise StandardError, "A valid data set file must be provided. File does not exists"
else
@options.data = JSON.parse(File.read(File.expand_path(@options.data)),{:symbolize_names => true})
end
# Check for Server config

# Check for Server config
if @options.server.nil? && @options.address && options.port
@options.server = {
:name => "default",
:type => :jabber,
:options => {
:address => @options.address,
:name => "default",
:type => :jabber,
:options => {
:address => @options.address,
:port => @options.port
}
}
}
elsif !Cartero::Commands::Servers.exists?(@options.server)
raise StandardError, "Server with name #{@options.server} does not exist."
Expand All @@ -82,8 +83,8 @@ def setup
@options.server = JSON.parse(File.read(s),{:symbolize_names => true})
end
# Check if JID / Password provided
# else require JID

# else require JID
if @options.jid.nil? && @options.server[:options][:jid].nil?
raise StandardError, "Missing JabberID --username and/or a --server with proper configuration needed."
end
Expand All @@ -93,7 +94,7 @@ def setup
raise StandardError, "Missing password --password and/or a --server with proper configuration needed."
end

# Check if body is provided. We need a message.
# Check if body is provided. We need a message.
if !@options.body.nil?
if ::Cartero::Commands::Templates.exists?(@options.body)
@options.body = File.read("#{Cartero::TemplatesDir}/#{@options.body}.erb")
Expand Down Expand Up @@ -121,8 +122,8 @@ def run
# Send messages
@options.data.each do |receiver|
unless receiver[:email].nil?
# This is added, so things will work. I guess if you send stuff to quick your messages won't be sent.
add_user(receiver[:email])
# This is added, so things will work. I guess if you send stuff to quick your messages won't be sent.
add_user(receiver[:email])
sleep(1)
send_message(receiver)
#TODO: send_attachment(receiver) if receiver[:attachments] || @options.attachments
Expand All @@ -134,10 +135,10 @@ def after
@client.close
end

private
private

def add_user(e)
s_request = Jabber::Presence.new.set_type(:subscribe)
s_request = Jabber::Presence.new.set_type(:subscribe)
s_request.to = Jabber::JID.new(e)
@client.send(s_request)
end
Expand All @@ -151,11 +152,12 @@ def send_message(r)
m = Jabber::Message.new(r[:email],b).set_type(:chat)
# Send actual message
@client.send(m)

$stdout.puts "Sending message to #{r[:email]}"
end

def send_attachment(r)
# Send attachment.
end
end
end
Expand Down

0 comments on commit 2194781

Please sign in to comment.