Compare commits
10 Commits
dependabot
...
master
Author | SHA1 | Date |
---|---|---|
|
cdac2c6562 | 1 year ago |
|
1264b067ad | 1 year ago |
|
174a86b89b | 1 year ago |
|
264b576171 | 1 year ago |
|
a86d2c3c59 | 1 year ago |
|
12ecc2b0d3 | 1 year ago |
|
a061942739 | 1 year ago |
|
d74051d5a8 | 1 year ago |
|
d4e2f95cf3 | 1 year ago |
|
f4a595f370 | 1 year ago |
@ -0,0 +1,5 @@
|
||||
*.iml
|
||||
**/.idea/
|
||||
**/target/
|
||||
**/config.properties
|
||||
*.env
|
@ -0,0 +1 @@
|
||||
java temurin-17.0.9+9
|
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd ./helper &&
|
||||
mvn clean install &&
|
||||
|
||||
cd ../mirror &&
|
||||
./build.sh &&
|
||||
|
||||
cd ../reverse &&
|
||||
./build.sh &&
|
||||
|
||||
cd ../forward &&
|
||||
./build.sh &
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,13 +0,0 @@
|
||||
#!/bin/bash
|
||||
cd ./forward
|
||||
./install-locally.sh
|
||||
cd ..
|
||||
cd ./helper
|
||||
./install-locally.sh
|
||||
cd ..
|
||||
cd ./mirror
|
||||
./install-locally.sh
|
||||
cd ..
|
||||
cd ./reverse
|
||||
./install-locally.sh
|
||||
cd ..
|
@ -0,0 +1,31 @@
|
||||
version: '3'
|
||||
services:
|
||||
|
||||
|
||||
# forward:
|
||||
# container_name: forward
|
||||
# image: io42630/forward:0.1
|
||||
# ports:
|
||||
# - "42001:8080"
|
||||
# - "42002:5005"
|
||||
|
||||
|
||||
# See .env for vars.
|
||||
reverse:
|
||||
container_name: reverse
|
||||
image: io42630/reverse:0.1
|
||||
ports:
|
||||
- "42005:8090"
|
||||
- "42006:5005"
|
||||
environment:
|
||||
- forward.url=${FORWARD_URL}
|
||||
- app.url=${APP_URL}
|
||||
- check.supply.interval.ms=${CHECK_SUPPLY_INTERVAL_MS}
|
||||
|
||||
|
||||
mirror:
|
||||
container_name: mirror
|
||||
image: io42630/mirror:0.1
|
||||
ports:
|
||||
- "42003:8080"
|
||||
- "42004:5005"
|
@ -1,5 +0,0 @@
|
||||
#### About
|
||||
* Uses `com.olexyn.min.http.server.MinJettyServer` to host the servlets.
|
||||
* Where to adjust the parameters:
|
||||
* for `forward` -> `EmbeddedR`
|
||||
* for `reverse` -> `RunAll`
|
@ -1,208 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.olexyn.misp.embedded</groupId>
|
||||
<artifactId>embedded</artifactId>
|
||||
<version>0.1</version>
|
||||
|
||||
<name>embedded</name>
|
||||
<!-- FIXME change it to the project's website -->
|
||||
<url>http://www.example.com</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>1.11</maven.compiler.source>
|
||||
<maven.compiler.target>1.11</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.11</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.olexyn.min.http.server</groupId>
|
||||
<artifactId>min-http-server</artifactId>
|
||||
<version>0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>javax.servlet-api</artifactId>
|
||||
<version>4.0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.olexyn.misp.helper</groupId>
|
||||
<artifactId>misp-helper</artifactId>
|
||||
<version>0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.6</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-webapp</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlets</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlet</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-util</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-http</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-io</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-client</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-server</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-client</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-servlet</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-api</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.aggregate</groupId>
|
||||
<artifactId>jetty-all</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
<type>pom</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.olexyn.misp.mirror</groupId>
|
||||
<artifactId>misp-mirror</artifactId>
|
||||
<version>0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.olexyn.misp.rev</groupId>
|
||||
<artifactId>misp-rev</artifactId>
|
||||
<version>0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.olexyn.misp.reverse</groupId>
|
||||
<artifactId>reverse</artifactId>
|
||||
<version>0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.olexyn.misp.fwd</groupId>
|
||||
<artifactId>misp-fwd</artifactId>
|
||||
<version>0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.olexyn.misp.forward</groupId>
|
||||
<artifactId>forward</artifactId>
|
||||
<version>0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.olexyn.misp.mirror</groupId>
|
||||
<artifactId>mirror</artifactId>
|
||||
<version>0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20190722</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
|
||||
<plugins>
|
||||
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
|
||||
<plugin>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</plugin>
|
||||
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.22.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>2.5.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
</plugin>
|
||||
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
|
||||
<plugin>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.7.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</project>
|
@ -1,28 +0,0 @@
|
||||
package com.olexyn.misp.embedded;
|
||||
|
||||
import com.olexyn.min.http.server.MinJettyServer;
|
||||
import com.olexyn.misp.forward.Forward;
|
||||
import com.olexyn.misp.mirror.Mirror;
|
||||
|
||||
|
||||
public class EmbeddedR implements Runnable {
|
||||
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
MinJettyServer server = new MinJettyServer();
|
||||
|
||||
server.PORT = 8090;
|
||||
server.MAX_THREADS = 100;
|
||||
server.MIN_THREADS = 10;
|
||||
server.IDLE_TIMEOUT = 120;
|
||||
|
||||
|
||||
server.addServletWithMapping("/mirror", Mirror.class);
|
||||
server.addServletWithMapping("/app", Mirror.class);
|
||||
server.addServletWithMapping("/forward", Forward.class);
|
||||
|
||||
|
||||
server.start();
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
package com.olexyn.misp.embedded;
|
||||
|
||||
import com.olexyn.misp.reverse.Reverse;
|
||||
|
||||
public class RunAll {
|
||||
|
||||
public static void main(String... args) throws InterruptedException {
|
||||
|
||||
Thread embeddedT = new Thread(new EmbeddedR());
|
||||
embeddedT.start();
|
||||
|
||||
Thread.sleep(2000);
|
||||
|
||||
Reverse reverse = new Reverse();
|
||||
reverse.FORWARD_URL = "http://localhost:8090/forward";
|
||||
reverse.APP_URL = "http://localhost:8090/app";
|
||||
//reverse.APP_URL = "https://olexyn.com/wp/";
|
||||
|
||||
|
||||
Thread reverseT = new Thread(reverse);
|
||||
reverseT.start();
|
||||
}
|
||||
}
|
@ -0,0 +1,4 @@
|
||||
FROM eclipse-temurin:17-alpine
|
||||
COPY /target/forward-0.1.jar /usr/local/lib/forward.jar
|
||||
EXPOSE 8080 5005
|
||||
ENTRYPOINT ["java", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", "-jar","/usr/local/lib/forward.jar"]
|
@ -1,9 +0,0 @@
|
||||
#### About
|
||||
The `forward` servlet.
|
||||
|
||||
#### Deploy (TODO)
|
||||
* Run `install-locally.sh`
|
||||
* Find the `forward-0.1.war` in `./target`
|
||||
* Copy it to `tomcat/webapps`.
|
||||
* Assuming tomcat runs at `http://localhost:9090`
|
||||
* Then the servlet will be at `http://localhost:9090/forward-0.1/mirror`
|
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
mvn clean install &&
|
||||
docker build -t io42630/forward:0.1 .
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
version="0.1"
|
||||
file="target/forward-${version}.war"
|
||||
groupId="com.olexyn.misp.forward"
|
||||
artifactId="forward"
|
||||
|
||||
|
||||
|
||||
mvn package
|
||||
mvn install:install-file -Dfile=${file} -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=war -DgeneratePom=true
|
@ -1,124 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.olexyn.misp.forward</groupId>
|
||||
<parent>
|
||||
<groupId>com.olexyn</groupId>
|
||||
<artifactId>zeeroot</artifactId>
|
||||
<version>spring-boot-jdk17-0.1</version>
|
||||
</parent>
|
||||
<groupId>com.olexyn.misp</groupId>
|
||||
<artifactId>forward</artifactId>
|
||||
<version>0.1</version>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<name>forward Maven Webapp</name>
|
||||
<!-- FIXME change it to the project's website -->
|
||||
<url>http://www.example.com</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
<name>forward</name>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.11</version>
|
||||
<scope>test</scope>
|
||||
<groupId>com.olexyn</groupId>
|
||||
<artifactId>zeebom</artifactId>
|
||||
<version>1.1.1</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.olexyn.misp.helper</groupId>
|
||||
<groupId>com.olexyn.misp</groupId>
|
||||
<artifactId>helper</artifactId>
|
||||
<version>0.1</version>
|
||||
<version>0.2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.6</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
<artifactId>javax.servlet</artifactId>
|
||||
<version>3.0.0.v201112011016</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20190722</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-server</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.olexyn.min.http.server</groupId>
|
||||
<artifactId>min-http-server</artifactId>
|
||||
<version>0.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-util</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlets</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty</groupId>
|
||||
<artifactId>jetty-servlet</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.websocket</groupId>
|
||||
<artifactId>websocket-server</artifactId>
|
||||
<version>9.4.28.v20200408</version>
|
||||
<!-- for some godforsaken reason this is required. -->
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjweaver</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</plugin>
|
||||
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.22.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.2.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>2.5.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</project>
|
||||
|
@ -0,0 +1,13 @@
|
||||
package com.olexyn.misp.forward;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableAspectJAutoProxy(proxyTargetClass = true)
|
||||
public class App {
|
||||
public static void main(String... args) {
|
||||
SpringApplication.run(App.class, args);
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<!DOCTYPE web-app PUBLIC
|
||||
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
||||
"http://java.sun.com/dtd/web-app_2_3.dtd" >
|
||||
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
||||
version="2.4">
|
||||
|
||||
<display-name>misp-fwd</display-name>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>misp-fwd</servlet-name>
|
||||
<servlet-class>com.olexyn.misp.forward.Forward</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>misp-fwd</servlet-name>
|
||||
<url-pattern>/forward</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
</web-app>
|
Before Width: | Height: | Size: 617 B |
@ -1,20 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>misp-fwd</title>
|
||||
</head>
|
||||
<body bgcolor=white>
|
||||
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td align=center>
|
||||
<img src="images/io42630.png">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<h1>misp-fwd</h1>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,7 @@
|
||||
#POST http://localhost:42001
|
||||
GET http://node175251-env-1739619.sh1.hidora.com:11231/
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"hello": "world"
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
#POST http://localhost:42001
|
||||
POST http://node175251-env-1739619.sh1.hidora.com:11231/
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"hello": "world"
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
### MISP Helper
|
||||
|
||||
|
||||
#### Build
|
||||
* do `mvn clean install` for local
|
||||
* or `mvn deploy` for local nexus
|
@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
version="0.1"
|
||||
file="target/helper-${version}.jar"
|
||||
groupId="com.olexyn.misp.helper"
|
||||
artifactId="helper"
|
||||
|
||||
|
||||
|
||||
mvn package
|
||||
mvn install:install-file -Dfile=${file} -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -DgeneratePom=true
|
@ -1,84 +1,34 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.olexyn.misp.helper</groupId>
|
||||
<parent>
|
||||
<groupId>com.olexyn</groupId>
|
||||
<artifactId>zeeroot</artifactId>
|
||||
<version>17.0.1</version>
|
||||
</parent>
|
||||
<groupId>com.olexyn.misp</groupId>
|
||||
<artifactId>helper</artifactId>
|
||||
<version>0.1</version>
|
||||
|
||||
<version>0.2</version>
|
||||
<name>helper</name>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13.1</version>
|
||||
<groupId>com.olexyn</groupId>
|
||||
<artifactId>zeebom</artifactId>
|
||||
<version>1.1.1</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20190722</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.7.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</plugin>
|
||||
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.22.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>2.5.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
</project>
|
||||
|
@ -0,0 +1,9 @@
|
||||
package com.olexyn.misp.helper;
|
||||
|
||||
public interface Constants {
|
||||
|
||||
String AVAILABLE = "available";
|
||||
String POST = "POST";
|
||||
String GET = "GET";
|
||||
String EMPTY = "";
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.olexyn.misp.helper;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.KeyGenerator;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.util.Base64;
|
||||
|
||||
public class SymEnc {
|
||||
public static void main(String[] args) throws Exception {
|
||||
// Step 1: Generate a symmetric AES key (alternatively, you can specify your own)
|
||||
KeyGenerator keyGenerator = KeyGenerator.getInstance("AES");
|
||||
keyGenerator.init(128); // Key size
|
||||
SecretKey secretKey = keyGenerator.generateKey();
|
||||
|
||||
// Step 2: Create and initialize the Cipher for AES encryption
|
||||
Cipher cipher = Cipher.getInstance("AES");
|
||||
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
|
||||
|
||||
// Step 3: Encrypt the string
|
||||
String inputString = "Your String Here";
|
||||
byte[] encryptedBytes = cipher.doFinal(inputString.getBytes());
|
||||
|
||||
// Convert encrypted bytes to Base64 to get a string representation
|
||||
String encryptedString = Base64.getEncoder().encodeToString(encryptedBytes);
|
||||
|
||||
System.out.println("Encrypted String: " + encryptedString);
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
tomcat_webapps="${HOME}/app/tomcat/webapps"
|
||||
jetty_webapps="${HOME}/app/jetty9.4/webapps"
|
||||
webapps=$jetty_webapps
|
||||
cwd=$(pwd)
|
||||
|
||||
/home/user/app/tomcat/bin/shutdown.sh
|
||||
|
||||
echo "================"
|
||||
echo "END TOMCAT STOP "
|
||||
echo "================"
|
||||
|
||||
cp -v "${cwd}/misp-mirror/target/misp-mirror-0.1.war" "${webapps}"
|
||||
cp -v "${cwd}/misp-rev/target/misp-rev-0.1.war" "${webapps}"
|
||||
cp -v "${cwd}/test-proxy/target/test-proxy-0.1.war" "${webapps}"
|
||||
|
||||
echo "================"
|
||||
echo "END COPY"
|
||||
echo "================"
|
||||
|
||||
# /home/user/app/tomcat/bin/startup.sh
|
||||
|
||||
echo "================"
|
||||
echo "END TOMCAT START "
|
||||
echo "================"
|
Before Width: | Height: | Size: 26 KiB |
@ -0,0 +1,4 @@
|
||||
FROM eclipse-temurin:17-alpine
|
||||
COPY /target/mirror-0.1.jar /usr/local/lib/mirror-0.1.jar
|
||||
EXPOSE 8080 5005
|
||||
ENTRYPOINT ["java", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", "-jar","/usr/local/lib/mirror-0.1.jar"]
|
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
mvn clean install &&
|
||||
docker build -t io42630/mirror:0.1 .
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,10 +0,0 @@
|
||||
#!/bin/bash
|
||||
version="0.1"
|
||||
file="target/misp-mirror-${version}.war"
|
||||
groupId="com.olexyn.misp.mirror"
|
||||
artifactId="misp-mirror"
|
||||
|
||||
|
||||
|
||||
mvn package
|
||||
mvn install:install-file -Dfile=${file} -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=war -DgeneratePom=true
|
@ -1,90 +1,60 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.olexyn.misp.mirror</groupId>
|
||||
<parent>
|
||||
<groupId>com.olexyn</groupId>
|
||||
<artifactId>zeeroot</artifactId>
|
||||
<version>spring-boot-jdk17-0.1</version>
|
||||
</parent>
|
||||
<groupId>com.olexyn.misp</groupId>
|
||||
<artifactId>mirror</artifactId>
|
||||
<version>0.1</version>
|
||||
<packaging>war</packaging>
|
||||
|
||||
<name>mirror Maven Webapp</name>
|
||||
<!-- FIXME change it to the project's website -->
|
||||
<url>http://www.example.com</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
<name>mirror</name>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.11</version>
|
||||
<scope>test</scope>
|
||||
<groupId>com.olexyn</groupId>
|
||||
<artifactId>zeebom</artifactId>
|
||||
<version>1.1.1</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.olexyn.misp.helper</groupId>
|
||||
<groupId>com.olexyn.misp</groupId>
|
||||
<artifactId>helper</artifactId>
|
||||
<version>0.1</version>
|
||||
<version>0.2</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.6</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.jetty.orbit</groupId>
|
||||
<artifactId>javax.servlet</artifactId>
|
||||
<version>3.0.0.v201112011016</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20190722</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-autoconfigure</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!-- for some godforsaken reason this is required. -->
|
||||
<groupId>org.aspectj</groupId>
|
||||
<artifactId>aspectjweaver</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
</plugin>
|
||||
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.0.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.22.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.2.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>2.5.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</project>
|
||||
|
@ -0,0 +1,13 @@
|
||||
package com.olexyn.misp.mirror;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableAspectJAutoProxy(proxyTargetClass = true)
|
||||
public class App {
|
||||
public static void main(String... args) {
|
||||
SpringApplication.run(App.class, args);
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
<!DOCTYPE web-app PUBLIC
|
||||
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
|
||||
"http://java.sun.com/dtd/web-app_2_3.dtd" >
|
||||
|
||||
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
||||
version="2.4">
|
||||
|
||||
<display-name>misp-mirror</display-name>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>misp-mirror</servlet-name>
|
||||
<servlet-class>com.olexyn.misp.mirror.Mirror</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>misp-mirror</servlet-name>
|
||||
<url-pattern>/mirror</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
</web-app>
|
Before Width: | Height: | Size: 617 B |
@ -1,20 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>misp-mirror</title>
|
||||
</head>
|
||||
<body bgcolor=white>
|
||||
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td align=center>
|
||||
<img src="images/io42630.png">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<h1>misp-mirror</h1>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,4 @@
|
||||
FROM eclipse-temurin:17-alpine
|
||||
COPY /target/reverse-0.1-jar-with-dependencies.jar /usr/local/lib/reverse-0.1-jar-with-dependencies.jar
|
||||
EXPOSE 8090 5005
|
||||
ENTRYPOINT ["java", "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005", "-jar","/usr/local/lib/reverse-0.1-jar-with-dependencies.jar"]
|
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
mvn clean install &&
|
||||
docker build -t io42630/reverse:0.1 .
|
||||
|
||||
|
||||
|
||||
|
@ -1,11 +0,0 @@
|
||||
#!/bin/bash
|
||||
version="0.1"
|
||||
artifactId="reverse"
|
||||
file="target/${artifactId}-${version}.jar"
|
||||
groupId="com.olexyn.misp.reverse"
|
||||
|
||||
|
||||
|
||||
|
||||
mvn package
|
||||
mvn install:install-file -Dfile=${file} -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackaging=jar -DgeneratePom=true
|
@ -1,55 +1,49 @@
|
||||
package com.olexyn.misp.reverse.runnable;
|
||||
|
||||
import com.olexyn.misp.helper.Ride;
|
||||
import com.olexyn.misp.reverse.Reverse;
|
||||
import com.olexyn.misp.reverse.Tools;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class JourneyR implements Runnable {
|
||||
|
||||
private Reverse reverse;
|
||||
|
||||
public JourneyR(Reverse reverse) {
|
||||
this.reverse = reverse;
|
||||
}
|
||||
import static com.olexyn.misp.helper.Constants.EMPTY;
|
||||
import static com.olexyn.misp.helper.Constants.GET;
|
||||
import static com.olexyn.misp.helper.Constants.POST;
|
||||
import static com.olexyn.misp.reverse.Reverse.APP_URL;
|
||||
import static com.olexyn.misp.reverse.Reverse.FORWARD_URL;
|
||||
|
||||
public class JourneyR implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Ride _ride = sendPostRide();
|
||||
_ride = sendGetRequest(_ride);
|
||||
sendPostRideRequestData(_ride);
|
||||
} catch (Exception ignored) { }
|
||||
var ride = sendPostRide();
|
||||
sendGetRequest(ride);
|
||||
sendPostRideRequestData(ride);
|
||||
} catch (Exception ignored) { /* ignored */ }
|
||||
}
|
||||
|
||||
|
||||
Ride sendPostRide() throws IOException {
|
||||
private Ride sendPostRide() throws IOException {
|
||||
|
||||
final Ride ride = new Ride();
|
||||
Ride ride = new Ride();
|
||||
|
||||
final String result = Tools.send("POST", reverse.FORWARD_URL, ride.json());
|
||||
String result = Tools.send(POST, FORWARD_URL, ride.json());
|
||||
|
||||
String _req = new Ride(result).getRequest();
|
||||
String request = (_req == null) ? "" : _req;
|
||||
ride.setRequest(request);
|
||||
String reqStr = new Ride(result).getRequest();
|
||||
reqStr = (reqStr == null) ? EMPTY : reqStr;
|
||||
ride.setRequest(reqStr);
|
||||
|
||||
return ride;
|
||||
}
|
||||
|
||||
|
||||
Ride sendGetRequest(Ride ride) throws IOException {
|
||||
|
||||
final String result = Tools.send("GET", reverse.APP_URL, ride.getRequest());
|
||||
private Ride sendGetRequest(Ride ride) throws IOException {
|
||||
String result = Tools.send(GET, APP_URL, ride.getRequest());
|
||||
ride.setData(result);
|
||||
|
||||
return ride;
|
||||
}
|
||||
|
||||
|
||||
void sendPostRideRequestData(Ride ride) throws IOException {
|
||||
|
||||
Tools.send("POST", reverse.FORWARD_URL, ride.json());
|
||||
private void sendPostRideRequestData(Ride ride) throws IOException {
|
||||
Tools.send(POST, FORWARD_URL, ride.json());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue