From ac135576b2e839918c730f3c4bc788c149bac408 Mon Sep 17 00:00:00 2001 From: antman1p Date: Fri, 10 May 2019 09:30:19 -0400 Subject: [PATCH 01/17] Update main.tf This had to be changed in order to provide the Public GCP instance IP address --- modules/google/http-c2/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/google/http-c2/main.tf b/modules/google/http-c2/main.tf index 3fb9574..370635e 100644 --- a/modules/google/http-c2/main.tf +++ b/modules/google/http-c2/main.tf @@ -61,7 +61,7 @@ resource "google_compute_instance" "http-c2" { } provisioner "local-exec" { - command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/http_c2_${self.network_interface.0.access_config.0.assigned_nat_ip} && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/http_c2_${self.network_interface.0.access_config.0.assigned_nat_ip}.pub" + command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/http_c2_${self.network_interface.0.access_config.0.assigned_nat_ip} && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/http_c2_${self.network_interface.0.access_config.0.nat_ip}.pub" } provisioner "local-exec" { From 1a7269df902700202c35cdab70b295a47a7b8f4d Mon Sep 17 00:00:00 2001 From: antman1p Date: Fri, 10 May 2019 09:31:08 -0400 Subject: [PATCH 02/17] Update main.tf This had to be changed in order to provide the Public GCP instance IP address --- modules/google/http-rdir/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/google/http-rdir/main.tf b/modules/google/http-rdir/main.tf index 3fa1251..1f6aade 100644 --- a/modules/google/http-rdir/main.tf +++ b/modules/google/http-rdir/main.tf @@ -67,7 +67,7 @@ resource "google_compute_instance" "http-rdir" { } provisioner "local-exec" { - command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/http_rdir_${self.network_interface.0.access_config.0.assigned_nat_ip } && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/http_rdir_${self.network_interface.0.access_config.0.assigned_nat_ip}.pub" + command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/http_rdir_${self.network_interface.0.access_config.0.assigned_nat_ip } && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/http_rdir_${self.network_interface.0.access_config.0.nat_ip}.pub" } provisioner "local-exec" { From e2e197f56c83bc591424318d10903f92a68b9038 Mon Sep 17 00:00:00 2001 From: antman1p Date: Fri, 10 May 2019 09:32:09 -0400 Subject: [PATCH 03/17] Update main.tf This had to be changed in order to provide the Public GCP instance IP address --- modules/google/dns-rdir/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/google/dns-rdir/main.tf b/modules/google/dns-rdir/main.tf index ad5eebc..8d67aad 100644 --- a/modules/google/dns-rdir/main.tf +++ b/modules/google/dns-rdir/main.tf @@ -65,11 +65,11 @@ resource "google_compute_instance" "dns-rdir" { } provisioner "local-exec" { - command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.assigned_nat_ip } && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.assigned_nat_ip}.pub" + command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.nat_ip } && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.assigned_nat_ip}.pub" } provisioner "local-exec" { when = "destroy" - command = "rm ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.assigned_nat_ip}*" + command = "rm ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.nat_ip}*" } } From 5604cdeda1ba4ce4e9ddeec58a96debac506efbe Mon Sep 17 00:00:00 2001 From: antman1p Date: Fri, 10 May 2019 09:32:51 -0400 Subject: [PATCH 04/17] Update main.tf This had to be changed in order to provide the Public GCP instance IP address --- modules/google/dns-c2/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/google/dns-c2/main.tf b/modules/google/dns-c2/main.tf index 49c9960..45f7c2b 100644 --- a/modules/google/dns-c2/main.tf +++ b/modules/google/dns-c2/main.tf @@ -61,11 +61,11 @@ resource "google_compute_instance" "dns-c2" { } provisioner "local-exec" { - command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.assigned_nat_ip } && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.assigned_nat_ip}.pub" + command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.assigned_nat_ip } && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.nat_ip}.pub" } provisioner "local-exec" { when = "destroy" - command = "rm ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.assigned_nat_ip}*" + command = "rm ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.nat_ip}*" } } From 5d997eb0e04f181e9669c966cec5e8565d6214c0 Mon Sep 17 00:00:00 2001 From: antman1p Date: Fri, 10 May 2019 09:33:41 -0400 Subject: [PATCH 05/17] Update main.yf This had to be changed in order to provide the Public GCP instance IP address --- modules/google/http-c2/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/google/http-c2/main.tf b/modules/google/http-c2/main.tf index 370635e..46030a6 100644 --- a/modules/google/http-c2/main.tf +++ b/modules/google/http-c2/main.tf @@ -66,6 +66,6 @@ resource "google_compute_instance" "http-c2" { provisioner "local-exec" { when = "destroy" - command = "rm ./ssh_keys/http_c2_${self.network_interface.0.access_config.0.assigned_nat_ip}*" + command = "rm ./ssh_keys/http_c2_${self.network_interface.0.access_config.0.nat_ip}*" } } From dabef1eee58cd81ca9968501b411c9f904c220e1 Mon Sep 17 00:00:00 2001 From: antman1p Date: Fri, 10 May 2019 09:34:24 -0400 Subject: [PATCH 06/17] Update main.tf This had to be changed in order to provide the Public GCP instance IP address --- modules/google/http-rdir/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/google/http-rdir/main.tf b/modules/google/http-rdir/main.tf index 1f6aade..2a7c159 100644 --- a/modules/google/http-rdir/main.tf +++ b/modules/google/http-rdir/main.tf @@ -72,6 +72,6 @@ resource "google_compute_instance" "http-rdir" { provisioner "local-exec" { when = "destroy" - command = "rm ./ssh_keys/http_rdir_${self.network_interface.0.access_config.0.assigned_nat_ip}*" + command = "rm ./ssh_keys/http_rdir_${self.network_interface.0.access_config.0.nat_ip}*" } } From 89894f7777de8c0eda8e3908548722b6b0345e8e Mon Sep 17 00:00:00 2001 From: antman1p Date: Fri, 10 May 2019 09:35:03 -0400 Subject: [PATCH 07/17] Update main.tf This had to be changed in order to provide the Public GCP instance IP address --- modules/google/phishing-server/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/google/phishing-server/main.tf b/modules/google/phishing-server/main.tf index ecf308e..f0af59f 100644 --- a/modules/google/phishing-server/main.tf +++ b/modules/google/phishing-server/main.tf @@ -66,11 +66,11 @@ resource "google_compute_instance" "phishing-server" { } provisioner "local-exec" { - command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/phishing_server_${self.network_interface.0.access_config.0.assigned_nat_ip } && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/phishing_server_${self.network_interface.0.access_config.0.assigned_nat_ip}.pub" + command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/phishing_server_${self.network_interface.0.access_config.0.assigned_nat_ip } && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/phishing_server_${self.network_interface.0.access_config.0.nat_ip}.pub" } provisioner "local-exec" { when = "destroy" - command = "rm ./ssh_keys/phishing_server_${self.network_interface.0.access_config.0.assigned_nat_ip}*" + command = "rm ./ssh_keys/phishing_server_${self.network_interface.0.access_config.0.nat_ip}*" } } From 921b95a9198c1c5d1d9b05838c8c38c24247f98d Mon Sep 17 00:00:00 2001 From: antman1p Date: Fri, 10 May 2019 10:05:35 -0400 Subject: [PATCH 08/17] Update outputs.tf For GCP instance public IP. --- modules/google/dns-c2/outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/google/dns-c2/outputs.tf b/modules/google/dns-c2/outputs.tf index 9c8acb4..670cd34 100644 --- a/modules/google/dns-c2/outputs.tf +++ b/modules/google/dns-c2/outputs.tf @@ -1,3 +1,3 @@ output "ips" { - value = ["${google_compute_instance.http-rdir.*.network_interface.0.access_config.0.assigned_nat_ip}"] + value = ["${google_compute_instance.http-rdir.*.network_interface.0.access_config.0.nat_ip}"] } From c9a6cd48a1ffdd055a8cdaf360b79d322a5f81c7 Mon Sep 17 00:00:00 2001 From: antman1p Date: Fri, 10 May 2019 10:06:08 -0400 Subject: [PATCH 09/17] Update outputs.tf For GCP instance public IP. --- modules/google/dns-rdir/outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/google/dns-rdir/outputs.tf b/modules/google/dns-rdir/outputs.tf index 9c8acb4..670cd34 100644 --- a/modules/google/dns-rdir/outputs.tf +++ b/modules/google/dns-rdir/outputs.tf @@ -1,3 +1,3 @@ output "ips" { - value = ["${google_compute_instance.http-rdir.*.network_interface.0.access_config.0.assigned_nat_ip}"] + value = ["${google_compute_instance.http-rdir.*.network_interface.0.access_config.0.nat_ip}"] } From 9ec218a0d821681d95e2fc225f31dbf739ee70e7 Mon Sep 17 00:00:00 2001 From: antman1p Date: Fri, 10 May 2019 10:06:46 -0400 Subject: [PATCH 10/17] Uodate outputs.tf For GCP instance public IP. --- modules/google/http-c2/outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/google/http-c2/outputs.tf b/modules/google/http-c2/outputs.tf index 87ef556..2dc732b 100644 --- a/modules/google/http-c2/outputs.tf +++ b/modules/google/http-c2/outputs.tf @@ -1,3 +1,3 @@ output "ips" { - value = ["${google_compute_instance.http-c2.*.network_interface.0.access_config.0.assigned_nat_ip}"] + value = ["${google_compute_instance.http-c2.*.network_interface.0.access_config.0.nat_ip}"] } From cd70161ba42d57e944114671c9696ecfdfdc6b00 Mon Sep 17 00:00:00 2001 From: antman1p Date: Fri, 10 May 2019 10:07:26 -0400 Subject: [PATCH 11/17] Uodate ouputs.tf For GCP instance public IP. --- modules/google/http-rdir/outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/google/http-rdir/outputs.tf b/modules/google/http-rdir/outputs.tf index 9c8acb4..670cd34 100644 --- a/modules/google/http-rdir/outputs.tf +++ b/modules/google/http-rdir/outputs.tf @@ -1,3 +1,3 @@ output "ips" { - value = ["${google_compute_instance.http-rdir.*.network_interface.0.access_config.0.assigned_nat_ip}"] + value = ["${google_compute_instance.http-rdir.*.network_interface.0.access_config.0.nat_ip}"] } From cabaac4dd631f5786c17d8635cb05f1910977dc2 Mon Sep 17 00:00:00 2001 From: antman1p Date: Fri, 10 May 2019 10:08:02 -0400 Subject: [PATCH 12/17] Update outputs.tf For GCP instance public IP. --- modules/google/phishing-server/outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/google/phishing-server/outputs.tf b/modules/google/phishing-server/outputs.tf index 9c8acb4..670cd34 100644 --- a/modules/google/phishing-server/outputs.tf +++ b/modules/google/phishing-server/outputs.tf @@ -1,3 +1,3 @@ output "ips" { - value = ["${google_compute_instance.http-rdir.*.network_interface.0.access_config.0.assigned_nat_ip}"] + value = ["${google_compute_instance.http-rdir.*.network_interface.0.access_config.0.nat_ip}"] } From 779aa392ae727a2a3cf3e75d2c03ae11a8c7a12b Mon Sep 17 00:00:00 2001 From: antman1p Date: Fri, 10 May 2019 13:03:42 -0400 Subject: [PATCH 13/17] Fixed GCP public IP Issue Gets GCP instance public IP --- modules/google/dns-c2/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/google/dns-c2/main.tf b/modules/google/dns-c2/main.tf index 45f7c2b..2533e9b 100644 --- a/modules/google/dns-c2/main.tf +++ b/modules/google/dns-c2/main.tf @@ -61,7 +61,7 @@ resource "google_compute_instance" "dns-c2" { } provisioner "local-exec" { - command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.assigned_nat_ip } && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.nat_ip}.pub" + command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.nat_ip } && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.nat_ip}.pub" } provisioner "local-exec" { From 997c7ada4cf10116234005bc57b8a48657520e4b Mon Sep 17 00:00:00 2001 From: antman1p Date: Fri, 10 May 2019 13:06:48 -0400 Subject: [PATCH 14/17] Fixed GCP public IP Issue Gets GCP instance public IP --- modules/google/dns-rdir/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/google/dns-rdir/main.tf b/modules/google/dns-rdir/main.tf index 8d67aad..fe75ca0 100644 --- a/modules/google/dns-rdir/main.tf +++ b/modules/google/dns-rdir/main.tf @@ -65,7 +65,7 @@ resource "google_compute_instance" "dns-rdir" { } provisioner "local-exec" { - command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.nat_ip } && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.assigned_nat_ip}.pub" + command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.nat_ip } && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/dns_rdir_${self.network_interface.0.access_config.0.nat_ip}.pub" } provisioner "local-exec" { From e427fa33b9a676222c26476bc7528df3fbff5526 Mon Sep 17 00:00:00 2001 From: antman1p Date: Fri, 10 May 2019 13:07:31 -0400 Subject: [PATCH 15/17] Fixed GCP public IP Issue Gets GCP instance public IP --- modules/google/http-c2/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/google/http-c2/main.tf b/modules/google/http-c2/main.tf index 46030a6..dd024ee 100644 --- a/modules/google/http-c2/main.tf +++ b/modules/google/http-c2/main.tf @@ -61,7 +61,7 @@ resource "google_compute_instance" "http-c2" { } provisioner "local-exec" { - command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/http_c2_${self.network_interface.0.access_config.0.assigned_nat_ip} && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/http_c2_${self.network_interface.0.access_config.0.nat_ip}.pub" + command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/http_c2_${self.network_interface.0.access_config.0.nat_ip} && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/http_c2_${self.network_interface.0.access_config.0.nat_ip}.pub" } provisioner "local-exec" { From e9a674a0ca967293c5862b286d5c5d398c588c18 Mon Sep 17 00:00:00 2001 From: antman1p Date: Fri, 10 May 2019 13:08:12 -0400 Subject: [PATCH 16/17] Fixed GCP public IP Issue Gets GCP instance public IP --- modules/google/http-rdir/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/google/http-rdir/main.tf b/modules/google/http-rdir/main.tf index 2a7c159..79f6aa7 100644 --- a/modules/google/http-rdir/main.tf +++ b/modules/google/http-rdir/main.tf @@ -67,7 +67,7 @@ resource "google_compute_instance" "http-rdir" { } provisioner "local-exec" { - command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/http_rdir_${self.network_interface.0.access_config.0.assigned_nat_ip } && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/http_rdir_${self.network_interface.0.access_config.0.nat_ip}.pub" + command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/http_rdir_${self.network_interface.0.access_config.0.nat_ip } && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/http_rdir_${self.network_interface.0.access_config.0.nat_ip}.pub" } provisioner "local-exec" { From 68ed6e4ff2055c816c7162a43f378943e8322301 Mon Sep 17 00:00:00 2001 From: antman1p Date: Fri, 10 May 2019 13:08:50 -0400 Subject: [PATCH 17/17] Fixed GCP public IP issue Gets GCP instance public IP --- modules/google/phishing-server/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/google/phishing-server/main.tf b/modules/google/phishing-server/main.tf index f0af59f..5c7148c 100644 --- a/modules/google/phishing-server/main.tf +++ b/modules/google/phishing-server/main.tf @@ -66,7 +66,7 @@ resource "google_compute_instance" "phishing-server" { } provisioner "local-exec" { - command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/phishing_server_${self.network_interface.0.access_config.0.assigned_nat_ip } && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/phishing_server_${self.network_interface.0.access_config.0.nat_ip}.pub" + command = "echo \"${tls_private_key.ssh.*.private_key_pem[count.index]}\" > ./ssh_keys/phishing_server_${self.network_interface.0.access_config.0.nat_ip } && echo \"${tls_private_key.ssh.*.public_key_openssh[count.index]}\" > ./ssh_keys/phishing_server_${self.network_interface.0.access_config.0.nat_ip}.pub" } provisioner "local-exec" {