From 317e1b4e106155c7b02aea7305ac620e202005ed Mon Sep 17 00:00:00 2001 From: Johannes Findeisen Date: Wed, 7 Feb 2024 09:27:22 +0100 Subject: [PATCH] Initial commit. --- auth/auth.php | 13 ++++++++++++ bash/bash.sh | 13 ++++++++++++ challenge/challenge.php | 27 +++++++++++++++++++++++ ifconfig/ifconfig.php | 18 ++++++++++++++++ mail/mail.php | 47 +++++++++++++++++++++++++++++++++++++++++ perl/perl.pl | 19 +++++++++++++++++ php/php.php | 21 ++++++++++++++++++ python/python.py | 16 ++++++++++++++ ruby/ruby.rb | 13 ++++++++++++ timestamp/timestamp.php | 19 +++++++++++++++++ uname/uname.php | 14 ++++++++++++ uptime/uptime.php | 11 ++++++++++ whois/whois.php | 29 +++++++++++++++++++++++++ 13 files changed, 260 insertions(+) create mode 100644 auth/auth.php create mode 100755 bash/bash.sh create mode 100644 challenge/challenge.php create mode 100644 ifconfig/ifconfig.php create mode 100644 mail/mail.php create mode 100755 perl/perl.pl create mode 100644 php/php.php create mode 100755 python/python.py create mode 100755 ruby/ruby.rb create mode 100644 timestamp/timestamp.php create mode 100644 uname/uname.php create mode 100644 uptime/uptime.php create mode 100644 whois/whois.php diff --git a/auth/auth.php b/auth/auth.php new file mode 100644 index 0000000..526af95 --- /dev/null +++ b/auth/auth.php @@ -0,0 +1,13 @@ +--- +permalink: /cgi/auth/ +--- + + diff --git a/ifconfig/ifconfig.php b/ifconfig/ifconfig.php new file mode 100644 index 0000000..fa588f4 --- /dev/null +++ b/ifconfig/ifconfig.php @@ -0,0 +1,18 @@ +--- +permalink: /cgi/ifconfig/ +--- + + diff --git a/mail/mail.php b/mail/mail.php new file mode 100644 index 0000000..e4498a8 --- /dev/null +++ b/mail/mail.php @@ -0,0 +1,47 @@ +--- +permalink: /cgi/mail/ +--- + +" . "\r\n" . + "Date: " . date(DATE_RFC822); + + $mailSubject = "[{{ site.url_short }}]: No subject!"; + if($_POST["subject"]) { + $mailSubject = "[{{ site.url_short }}]: " . $_POST["subject"]; + } + + $mailBody = $_POST["message"] . "\n\n" . "Website: " . $_POST["website"] . "\nUser Agent: " . $_SERVER['HTTP_USER_AGENT']; + if (!@mail($mailTo, $mailSubject, $mailBody, $mailHeaders)) { $error = "Failed to send mail!"; } + + unset($_SESSION["one"]); + unset($_SESSION["two"]); +} + +header('Content-Type: text/plain'); +if ($error=="") { + echo("{{ site.mail_thank_you }}"); +} else { + //echo($error . " (". $_POST["sum"] . "/" . $sum . ")"); + echo($error); +} +?> diff --git a/perl/perl.pl b/perl/perl.pl new file mode 100755 index 0000000..9f7545a --- /dev/null +++ b/perl/perl.pl @@ -0,0 +1,19 @@ +--- +permalink: /cgi/perl/index.pl +--- + +use warnings; +use strict; +use POSIX qw(strftime); + +my $date = strftime "%m/%d/%Y", localtime; + +print "Hello from Perl!\n\n"; +print $date; +print "\n\n"; + +print('my @i = (1..10); for(@i) { print("$_", "\n"); }'); +print("\n"); + +my @i = (1..10); for(@i) { print("$_", "\n"); } + diff --git a/php/php.php b/php/php.php new file mode 100644 index 0000000..4b35b01 --- /dev/null +++ b/php/php.php @@ -0,0 +1,21 @@ +--- +permalink: /cgi/php/index.php +--- + + + diff --git a/python/python.py b/python/python.py new file mode 100755 index 0000000..917ffe6 --- /dev/null +++ b/python/python.py @@ -0,0 +1,16 @@ +--- +permalink: /cgi/python/index.py +--- + +from datetime import datetime +from pprint import pprint + +print("Hello from Python!") +print("") +print('print(datetime.today().strftime("%Y-%m-%d"))') +print(datetime.today().strftime('%Y-%m-%d')) +print("") +print("for i in range(1, 11): print(i);") + +for i in range(1, 11): print(i); + diff --git a/ruby/ruby.rb b/ruby/ruby.rb new file mode 100755 index 0000000..30f1e6d --- /dev/null +++ b/ruby/ruby.rb @@ -0,0 +1,13 @@ +--- +permalink: /cgi/ruby/index.rb +--- + +puts('Hello from Ruby!') +puts +puts('puts(Time.now.strftime("%d/%m/%Y %H:%M"))') +puts(Time.now.strftime("%d/%m/%Y %H:%M")) +puts +puts("(1..10).each { |n| puts n }") + +(1..10).each { |n| puts n } + diff --git a/timestamp/timestamp.php b/timestamp/timestamp.php new file mode 100644 index 0000000..19d0e92 --- /dev/null +++ b/timestamp/timestamp.php @@ -0,0 +1,19 @@ +--- +permalink: /cgi/timestamp/ +--- + + diff --git a/uname/uname.php b/uname/uname.php new file mode 100644 index 0000000..497351b --- /dev/null +++ b/uname/uname.php @@ -0,0 +1,14 @@ +--- +permalink: /cgi/uname/ +--- + + diff --git a/uptime/uptime.php b/uptime/uptime.php new file mode 100644 index 0000000..bcb371d --- /dev/null +++ b/uptime/uptime.php @@ -0,0 +1,11 @@ +--- +permalink: /cgi/uptime/ +--- + + diff --git a/whois/whois.php b/whois/whois.php new file mode 100644 index 0000000..085ce65 --- /dev/null +++ b/whois/whois.php @@ -0,0 +1,29 @@ +--- +permalink: /cgi/whois/ +_note: https://www.w3docs.com/snippets/php/how-to-get-the-client-ip-address-in-php.html +--- + +