-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from kubeshark/terraform
Terraform and TLS demo
- Loading branch information
Showing
25 changed files
with
806 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/bin/bash | ||
|
||
docker build . -t mertyildiran/mizutest-outbound-tls-golang:latest && docker push mertyildiran/mizutest-outbound-tls-golang:latest | ||
# docker build . -t mertyildiran/mizutest-outbound-tls-golang:latest && docker push mertyildiran/mizutest-outbound-tls-golang:latest | ||
docker buildx build --platform linux/amd64 -t alongir/mizutest-outbound-tls-openssl:latest . --push |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,19 +32,23 @@ func main() { | |
req, err := http.NewRequest("GET", "https://gorest.co.in/public/v2/not-found", nil) | ||
if err != nil { | ||
fmt.Println(err) | ||
continue | ||
} | ||
req.Header.Set("cache-control", "no-cache") | ||
req.Header.Set("x-powered-by", "golang") | ||
res, err := client.Do(req) | ||
if err != nil { | ||
fmt.Println(err) | ||
continue | ||
} | ||
// fmt.Printf("res: %+v\n", res) | ||
defer res.Body.Close() | ||
fmt.Printf("res: %+v\n", res) | ||
|
||
payload := strings.NewReader(fmt.Sprintf("------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\njohn.doe.%[email protected]\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nJohn\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"gender\"\r\n\r\nmale\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"status\"\r\n\r\nactive\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--", j)) | ||
req, err = http.NewRequest("POST", "https://gorest.co.in/public/v2/users", payload) | ||
if err != nil { | ||
fmt.Println(err) | ||
continue | ||
} | ||
req.Header.Set("content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW") | ||
req.Header.Set("authorization", fmt.Sprintf("Bearer %s", ACCESS_TOKEN)) | ||
|
@@ -53,38 +57,45 @@ func main() { | |
res, err = client.Do(req) | ||
if err != nil { | ||
fmt.Println(err) | ||
continue | ||
} | ||
// fmt.Printf("res: %+v\n", res) | ||
defer res.Body.Close() | ||
fmt.Printf("res: %+v\n", res) | ||
|
||
req, err = http.NewRequest("GET", "https://gorest.co.in/public/v2/users", nil) | ||
if err != nil { | ||
fmt.Println(err) | ||
continue | ||
} | ||
req.Header.Set("cache-control", "no-cache") | ||
req.Header.Set("x-powered-by", "golang") | ||
res, err = client.Do(req) | ||
if err != nil { | ||
fmt.Println(err) | ||
continue | ||
} | ||
// fmt.Printf("res: %+v\n", res) | ||
defer res.Body.Close() | ||
fmt.Printf("res: %+v\n", res) | ||
|
||
req, err = http.NewRequest("GET", "https://gorest.co.in/public/v2/posts", nil) | ||
if err != nil { | ||
fmt.Println(err) | ||
continue | ||
} | ||
req.Header.Set("cache-control", "no-cache") | ||
req.Header.Set("x-powered-by", "golang") | ||
res, err = client.Do(req) | ||
if err != nil { | ||
fmt.Println(err) | ||
continue | ||
} | ||
// fmt.Printf("res: %+v\n", res) | ||
defer res.Body.Close() | ||
fmt.Printf("res: %+v\n", res) | ||
_, err = io.ReadAll(res.Body) | ||
if err != nil { | ||
fmt.Println(err) | ||
} | ||
// fmt.Printf("body: %v\n", string(body)) | ||
|
||
time.Sleep(3 * time.Second) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/bin/bash | ||
|
||
docker build . -t mertyildiran/mizutest-outbound-tls-openssl:latest && docker push mertyildiran/mizutest-outbound-tls-openssl:latest | ||
# docker build . -t mertyildiran/mizutest-outbound-tls-openssl:latest && docker push mertyildiran/mizutest-outbound-tls-openssl:latest | ||
docker buildx build --platform linux/amd64 -t alongir/mizutest-outbound-tls-openssl:latest . --push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,8 @@ | |
j += 1 | ||
# print("-----\n%d" % j) | ||
|
||
# First request - POST | ||
url = "https://gorest.co.in/public/v2/users" | ||
|
||
payload = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\njohn.doe.%[email protected]\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nJohn\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"gender\"\r\n\r\nmale\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"status\"\r\n\r\nactive\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--" % j | ||
headers = { | ||
'content-type': "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW", | ||
|
@@ -22,36 +22,38 @@ | |
|
||
try: | ||
response = requests.request("POST", url, data=payload, headers=headers) | ||
print(response.text) | ||
response.close() | ||
except Exception as e: | ||
logging.error(traceback.format_exc()) | ||
|
||
# print(response.text) | ||
|
||
# Second request - GET | ||
url = "https://gorest.co.in/public/v2/users" | ||
|
||
headers = { | ||
'cache-control': "no-cache", | ||
'x-powered-by': "openssl", | ||
} | ||
|
||
try: | ||
response = requests.request("GET", url, headers=headers) | ||
print(response.text) | ||
response.close() | ||
except Exception as e: | ||
logging.error(traceback.format_exc()) | ||
|
||
# print(response.text) | ||
|
||
# Third request - GET | ||
url = "https://gorest.co.in/public/v2/posts" | ||
|
||
headers = { | ||
'cache-control': "no-cache", | ||
'x-powered-by': "openssl", | ||
} | ||
|
||
try: | ||
response = requests.request("GET", url, headers=headers) | ||
print(response.text) | ||
response.close() | ||
except Exception as e: | ||
logging.error(traceback.format_exc()) | ||
|
||
# print(response.text) | ||
# Wait for 3 seconds before the next iteration | ||
time.sleep(3) |
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.