Sha256: e78fd078d6dcfadc9ad51475aa3cd03f2b314ef53bc122e104be34738b4738fb

Contents?: true

Size: 1.46 KB

Versions: 635

Compression:

Stored size: 1.46 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'pwn'
require 'optparse'

opts = {}
OptionParser.new do |options|
  options.banner = "USAGE:
    #{$PROGRAM_NAME} [opts]
  "

  options.on('-vNUM', '--voicemail_num=num', '<Required - Number to Voicemail Service>') do |num|
    opts[:voicemail_num] = num
  end
  options.on('-pPIN', '--voicemail_pin=PIN', '<Optional - Voicemail Pin (Prompts if Ommitted>') do |pin|
    opts[:voicemail_pin] = pin
  end
end.parse!

if opts.empty?
  puts `#{$PROGRAM_NAME} --help`
  exit 1
end

voicemail_num = opts[:voicemail_num].to_s.scrub.strip.chomp.delete('-').delete('.').to_i

if opts[:voicemail_pin].nil?
  voicemail_pin = PWN::Plugins::AuthenticationHelper.mask_password.to_s.scrub
else
  voicemail_pin = opts[:voicemail_pin].to_s.scrub
end

serial_obj = PWN::Plugins::Serial.connect

PWN::Plugins::Serial.request(
  serial_obj: serial_obj,
  payload: "ATDT#{voicemail_num};\r\n"
)

# TODO: Loop until data received indicates call picked up instead of sleep
sleep 13

voicemail_pin.each_char do |pin_char|
  PWN::Plugins::Serial.request(
    serial_obj: serial_obj,
    payload: "AT+VTS=#{pin_char}\r\n"
  )
end

PWN::Plugins::Serial.request(
  serial_obj: serial_obj,
  payload: "AT+VTS=#\r\n"
)

PWN::Plugins::Serial.request(
  serial_obj: serial_obj,
  payload: "AT+CHUP;\r\n"
)

session_data = PWN::Plugins::Serial.dump_session_data
puts '~' * 200
puts session_data
puts '~' * 200

PWN::Plugins::Serial.disconnect(serial_obj: serial_obj)

Version data entries

635 entries across 635 versions & 1 rubygems

Version Path
pwn-0.5.164 bin/pwn_serial_check_voicemail
pwn-0.5.163 bin/pwn_serial_check_voicemail
pwn-0.5.162 bin/pwn_serial_check_voicemail
pwn-0.5.161 bin/pwn_serial_check_voicemail
pwn-0.5.160 bin/pwn_serial_check_voicemail
pwn-0.5.159 bin/pwn_serial_check_voicemail
pwn-0.5.158 bin/pwn_serial_check_voicemail
pwn-0.5.157 bin/pwn_serial_check_voicemail
pwn-0.5.156 bin/pwn_serial_check_voicemail
pwn-0.5.155 bin/pwn_serial_check_voicemail
pwn-0.5.154 bin/pwn_serial_check_voicemail
pwn-0.5.153 bin/pwn_serial_check_voicemail
pwn-0.5.152 bin/pwn_serial_check_voicemail
pwn-0.5.151 bin/pwn_serial_check_voicemail
pwn-0.5.150 bin/pwn_serial_check_voicemail
pwn-0.5.106 bin/pwn_serial_check_voicemail
pwn-0.5.105 bin/pwn_serial_check_voicemail
pwn-0.5.104 bin/pwn_serial_check_voicemail
pwn-0.5.103 bin/pwn_serial_check_voicemail
pwn-0.5.102 bin/pwn_serial_check_voicemail