Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anyrun #3

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions ASN/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# What is this used for?
```
It's a node to help users get ASN information when they enter IP address.
# node-red-node-asn
[Node-RED](https://nodered.org/) nodes to help users get ASN information when they enter IP address.
Address needs to be an IPv4 or IPv6 format.
```

# Example
```
Expand All @@ -22,5 +20,8 @@ Output:

# Installation
```
npm i asn_information
```
npm i node-red-node-asn
```

# Website
https://www.dtonomy.com/
10 changes: 4 additions & 6 deletions ASN/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "asn_information",
"version": "1.2.7",
"name": "node-red-node-asn",
"version": "1.3.2",
"description": "Check ASN information for entered IP addresses",
"main": "asn_information.js",
"node-red": {
Expand All @@ -17,16 +17,14 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/dtonomy/plugins/blob/main/ASN"
"url": "git+https://github.com/DTonomy-Inc/Plugins/tree/master/ASN"
},
"keywords": [
"asn"
],
"author": "DTonomy",
"license": "apache-2.0",
"homepage": "https://github.com/dtonomy/plugins/blob/main/ASN/README.md",
"homepage": "https://www.dtonomy.com/",
"dependencies": {
"json-stable-stringify": "^1.0.1",
"safe-json-stringify": "^1.2.0"
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Distributed under the Apache-2.0 License. See `LICENSE` for more information.

DTonomy: [https://www.dtonomy.com](https://www.dtonomy.com)

Project Link: [https://github.com/dtonomy/plugins](https://github.com/dtonomy/plugins)
Project Link: [https://github.com/dtonomy/plugins](https://github.com/DTonomy-Inc/Plugins)



Expand Down
45 changes: 45 additions & 0 deletions anyrun/anyrunServer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<script type="text/x-red" data-template-name="anyrun server">
<div class="form-row">
<label for="node-config-input-username"><i class="icon-tag"></i>Username</label>
<input type="text" id="node-config-input-username">
</div>
<div class="form-row">
<label for="node-config-input-password"><i class="fa fa-globe"></i>Password</label>
<input type="password" id="node-config-input-password">
</div>
</script>

<script type="text/javascript">
RED.nodes.registerType('anyrun server', {
category: 'config',
defaults: {
username: {
value: "",
required: true
},
password: {
value: "",
required: true
}
},
label: function () {
return this.name || "anyrun server";
}
});
</script>
8 changes: 8 additions & 0 deletions anyrun/anyrunServer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = function (RED) {
function anyrunServer(n) {
RED.nodes.createNode(this, n);
this.username = n.username;
this.password = n.password;
}
RED.nodes.registerType("anyrun server", anyrunServer);
}
82 changes: 82 additions & 0 deletions anyrun/getHistory.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<!--
Copyright JS Foundation and other contributors, http://js.foundation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-template-name="get history">
<div class="form-row">
<label for="node-input-server"><i class="fa fa-server"></i> Server</label>
<input type="text" id="node-input-server" placeholder="Server">
</div>

<div class="form-row">
<label for="node-input-skip"><i class="fa fa-tag"></i> Skip</label>
<input type="text" id="node-input-skip" placeholder="25">
</div>
</script>

<script type="text/x-red" data-help-name="get history">

<p>Get history from ANY Run </p>
<p>Please make sure all entries are configured.</p>

<h3>Inputs</h3>
<dl class="message-properties">
<dt>payload<span class="property-type">object</span></dt>
<dd>ANYRUN Server entries: "Username" and "Password" can only be configures in the node</dd>
<dd>"Skip" is an optional entry, it should be configured in payload by default but also configurable in node.</dd>
<dd> If you want to configure the entry in payload, below is an example:</dd><br>
<pre>
25
</pre>
</dl>

<h3>Output</h3>
<dl class="message-properties">
<dd>It contains get history response.</dd>
<pre>
</pre>
</dl>

<h3>Other Information</h3>
<dl class="message-properties">
<dd>ANY.RUN API documentation: https://any.run/api-documentation/#api-Analysis-PostAnalysis</dd><br>
</dl>
</script>


<script type="text/javascript">
RED.nodes.registerType('get history', {
category: 'anyrun',
color: "#E6E0F8",
defaults: {
server: {
value: "",
type: "anyrun server",
required: true
},
skip: {
value: ""
}
},
inputs: 1,
outputs: 1,
icon: "arrow-in.png",
label: function () {
return this.name || "get history";
},
labelStyle: function () {
return this.name ? "node_label_italic" : "";
}
});
</script>
17 changes: 17 additions & 0 deletions anyrun/getHistory.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = function (RED) {
function getHistory(config) {
const utils = require('../utils/utils')
var node = this
this.server = RED.nodes.getNode(config.server)
node.topic = 'get history'
node.file = __dirname + '/getHistory.py'
node.config = {
username: this.server.username,
password: this.server.skey,
skip: config.skip,
}
utils.run(RED, node, config)
}
RED.nodes.registerType("get history", getHistory);

}
38 changes: 38 additions & 0 deletions anyrun/getHistory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import requests
import json

config = json.loads(input())
allData = json.loads(input())

if('payload' not in allData):
allData['payload'] = "No input."
print(json.dumps(allData))
exit()

data = allData['payload']

if data and type(data) is str:
skip = data
username = config['username']
password = config['password']
elif config and type(config) is dict:
username = config['username']
password = config['password']
if 'skip' in config:
skip = config['skip']
else:
print('Insufficient Data Input From Previous Node or Current Node')

if skip:
url = 'https://api.any.run/v1/analysis/'
else:
url = 'https://api.any.run/v1/analysis/?skip=' + skip

try:
response = requests.get(url, auth=(username, password)
allData['payload'] = response.content.decode("utf-8"))
except requests.exceptions.RequestException as error:
allData['payload'] = error

print(json.dumps(allData))

22 changes: 22 additions & 0 deletions anyrun/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "node-red-node-anyrun",
"version": "1.0.4",
"description": "",
"main": "index.js",
"node-red": {
"nodes": {
"anyrun server": "anyrunServer.js",
"get history": "getHistory.js"
}
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"keywords": [
"node-red",
"malware"
],
"homepage": "https://www.dtonomy.com/"
}
9 changes: 9 additions & 0 deletions anyrun/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# node-red-node-anyrun
[Node-RED](https://nodered.org/) nodes to retrieve malware analysis results from anyrun.

To try it for free, sign up here [DTonomy](https://www.dtonomy.com/pricing/).

# Installation
```
npm i node-red-node-anyrun
```
21 changes: 21 additions & 0 deletions connectwise/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Tobias Soltermann

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
11 changes: 11 additions & 0 deletions connectwise/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# node-red-contrib-connectwise
[Node-RED](https://nodered.org/) wrapper for https://github.com/rannn505/node-powershell/

Input your Powershell script that you want to run as `msg.payload`. The first output of the node is connected to `stdout`, the second one to `stderr` of the shell.

To try it for free, sign up here [DTonomy](https://www.dtonomy.com/pricing/).

# Installation
```
npm i node-red-contrib-connectwise
```
Loading