title,body,link,tags,view_count,is_answered,score,answer_count
Spring Security Testing: Retreiving a Token,"<p>I have successfully implemented code which allows me to retrieve a JWT token from my application via OAuth and UserDetailsService. </p>

<p>Atm I'm trying to implement tests to confirm this But I keep getting hit with 400 Bad requests</p>

<pre><code>@Test
public void is_status_up() throws InterruptedException, JSONException {
    // Given

    final String TOKEN_URL = ""http://localhost:8080/oauth/token"";
    MultiValueMap&lt;String, String&gt; params = new LinkedMultiValueMap&lt;String, String&gt;();
    params.add(""username"",""username"");
    params.add(""credential"",""credentials"");
    params.add(""grant_type"",""password"");

    HttpHeaders headers = new HttpHeaders();
    headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON_UTF8));
    headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
    HttpEntity&lt;String&gt; entity = new HttpEntity&lt;&gt;(""parameters"" , headers);

    HttpEntity&lt;MultiValueMap&lt;String, String&gt;&gt; request = new HttpEntity&lt;MultiValueMap&lt;String, String&gt;&gt;(params, headers);



    RestTemplate restTemplate = new RestTemplate();

    restTemplate.getInterceptors().add(new BasicAuthorizationInterceptor(""client-id"",""client-secret""));

    //When
    String result = restTemplate.postForObject(TOKEN_URL, request, String.class);

    //Then
    assertThat(result).isNotNull();
}
</code></pre>

<p>This should try to attempt to retrieve a token from Spring Security Authorisation Server's /oauth/token endpoint I get met with a 400 Bad Request.</p>

<p>In postman, which successfully retrieves tokens I have the request set up</p>

<p>Headers
Authorization: Basic 
Content-Type: application/x-www-form-urlencoded</p>

<p>body (x-www-form-urlencoded selected)
username:
password:
grant_type:""password""</p>
",https://stackoverflow.com/questions/50820063/spring-security-testing-retreiving-a-token,"['java', 'testing', 'spring-security', 'jwt', 'integration-testing']",247,TRUE,0,1
Any Static Application Security Testing (SAST) Tools for f#,"<p>Looking for open source tool for f#
Have seen a few that support c#:
  <a href=""https://pumascan.com/"" rel=""noreferrer"">https://pumascan.com/</a>
  <a href=""https://security-code-scan.github.io/"" rel=""noreferrer"">https://security-code-scan.github.io/</a></p>

<p>But cant find any for f#.
Just wonder do f# people do ci/cd and have a pipeline stage for static analysis and if so what do they use</p>
",https://stackoverflow.com/questions/49996886/any-static-application-security-testing-sast-tools-for-f,"['f#', 'static-code-analysis']",508,FALSE,8,0
Need guidance on performing Webservices security testing of WS-Security SOAP using using BURP,"<p>We just started off with BURP for the web application. We use SOAP UI for WS-Security SOAP Web services. We are planning to extend the security testing to SOAP Web services using BURP. Can you kindly provide any directions on how can we achieve this. Thanks</p>
",https://stackoverflow.com/questions/48526793/need-guidance-on-performing-webservices-security-testing-of-ws-security-soap-usi,"['web-services', 'security', 'burp']",177,FALSE,0,1
I am trying to Automate security testing of web applications using owasp ZAP in jenkins.I am getting the following issue,"<p>The issue is as follows:</p>

<pre><code>5825 [ZAP-SpiderInitThread-0] INFO org.zaproxy.zap.spider.Spider  - Spider initializing...
 5854 [ZAP-SpiderInitThread-0] INFO org.zaproxy.zap.spider.Spider  - Starting spider...
 5854 [ZAP-SpiderInitThread-0] WARN org.zaproxy.zap.spider.Spider  - No seeds available for the Spider. Cancelling scan...
 5854 [ZAP-SpiderInitThread-0] INFO org.zaproxy.zap.extension.spider.SpiderThread  - Spider scanning complete: false
    [ZAP Jenkins Plugin] SPIDER SCAN STATUS [ 100% ]
    [ZAP Jenkins Plugin] ALERTS COUNT [ 0 ]
</code></pre>

<p>Can anyone resolve this issue?</p>
",https://stackoverflow.com/questions/50580193/i-am-trying-to-automate-security-testing-of-web-applications-using-owasp-zap-in,"['jenkins', 'zap']",310,FALSE,3,0
Log Forging in C#,"<p>Our Product is gone through Security Testing .They have given some references from code for Log Forging.</p>

<p>One of those is :</p>

<pre><code>DataRow dr = new DataRow();

var data=Convert.ToString(dataRow[""ColumnName""]); // &lt;--
</code></pre>

<p>I have Google, but got that if any information is logged which is not secure.</p>

<p>But here nothing is logged .</p>

<p>Please suggest your views.</p>
",https://stackoverflow.com/questions/52177855/log-forging-in-c,"['c#', 'log-forging']",494,FALSE,0,0
JSON Request is not configure with zap Authentication.,"<p>I am using ZAP security testing tool.but at the point of Authentication by username and password of a JSON Request, I face problem to configure these. I checked all links and blogs too. but I can't get the proper step by step solution on it. 
Request code:-</p>

<pre><code>{""userName"":""cwc_patna"",""password"":""33a0d2e93e0ad396b7c9374bbbc83a58""}
</code></pre>

<p>Response code:-</p>

<pre><code>{""userId"":72,""userName"":""cwc_patna"",""password"":""33a0d2e93e0ad396b7c9374bbbc83a58"",""emilId"":""pratyush@sdrc.co.in"",""userTypeId"":1,""viewName"":""cwc"",""isLive"":null,""isActive"":null,""isApproved"":null,""sjpuAccess"":null,""userUserTypeFeaturePermissionMapping"":null,""area"":null}
</code></pre>
",https://stackoverflow.com/questions/50112412/json-request-is-not-configure-with-zap-authentication,"['owasp', 'zap']",1364,FALSE,0,1
zap not showing correct GET api in summery report,"<p>I am using ZAP in my security testing project.  its really help me a lot. but I face a problem that I and our project manager also want to know,  ""our login request is a POST request. than why zap showing a security vulnerability of login request by changeing the name <em>Post</em> to <strong>GET</strong> request at the summary report?</p>
",https://stackoverflow.com/questions/51168056/zap-not-showing-correct-get-api-in-summery-report,['zap'],36,TRUE,0,1
Sensitive data exposure in Burp,"<p>I have very little knowledge about security testing. I have been given a assignment to do penetration testing using burp free version. </p>

<p>When I started using burp suite then on a page of employee information I saw requests are passing as plain text. Can we consider it as sensitive data exposure ? </p>

<p>Can anyone give me details how hacker can use such information? <a href=""https://i.stack.imgur.com/scYWt.png"" rel=""nofollow noreferrer""> Click here for Image</a> </p>
",https://stackoverflow.com/questions/48783438/sensitive-data-exposure-in-burp,"['security', 'testing', 'penetration-testing', 'burp']",313,FALSE,0,0
JQuery Ui tabs pagination deprecated,"<p>I am using UI Tabs Paging extension - v1.2.2 in legacy system. 
<a href=""https://code.google.com/archive/p/jquery-ui-tabs-paging/"" rel=""nofollow noreferrer"">https://code.google.com/archive/p/jquery-ui-tabs-paging/</a></p>

<p>It supports jQuery 1.9.0 and jQuery UI 1.9.0 . I need to upgrade to support latest version of Jquery and Jquery UI as deprecated message appears on third party customer security testing. </p>

<p>Is it any other option or alternatives ? I search but could not able to identify the best solution. </p>
",https://stackoverflow.com/questions/49611516/jquery-ui-tabs-pagination-deprecated,"['jquery', 'jquery-ui', 'jquery-ui-tabs']",948,FALSE,0,1
Respond with 302,"<p>As part of security testing recommendation in our .NET based web application to show all post response to ""302 Object Moved"" instead of 200 OK.</p>

<p>This includes all responses in entire system. For example, if user clicked Save then we move to different screen. the Response should show ""302 Object Moved"" instead of 200 OK.</p>

<p>its ASP.NET application using c#</p>

<p>Any suggestions?</p>

<p>added below meta tags to clear the cache, still no luck</p>

<pre><code> &lt;meta http-equiv='cache-control' content='no-store, no-cache, must-revalidate, max-age=0' /&gt;
&lt;meta http-equiv='Pragma' content='no-store, no-cache' /&gt;
&lt;meta http-equiv='Expires' content='Sat, 26 Jul 1997 05:00:00 GMT' /&gt;
</code></pre>
",https://stackoverflow.com/questions/51309737/respond-with-302,"['c#', 'http', 'response', 'http-status-code-302']",90,FALSE,0,0
Disable weak cipher for Google Cloud App engine custom domain website,"<p>I have set up a custom domain website using a PHP Google Cloud App engine. After some third party security testing i've been advised to disable the use of cipher suite DES-CBC3-SHA (TLS_RSA_WITH_3DES_EDE_CBC_SHA). </p>

<p>I'm trying to find out if its possible to disable this for a Google PHP App engine? Most of what I can find online either doesn't answer this particular question or is somewhat out of date.</p>

<p>I found this post useful, <a href=""https://stackoverflow.com/questions/42681247/can-google-app-engine-java-support-tls1-0"">Can Google App Engine Java support TLS&gt;1.0</a> . This suggests it's not possible, however it doesn't actually answer the question, it just concludes that if its good enough for google it should be fine.</p>
",https://stackoverflow.com/questions/49380075/disable-weak-cipher-for-google-cloud-app-engine-custom-domain-website,['google-app-engine'],1521,TRUE,1,1
using SQLMAP to test SQL injection in ASP.NET web application,"<p>I am trying to get SQLMAP tool to test the possibilities of SQL injection on my asp.net web application which has forms authentication. But I am not getting any clear directions on this. I have tried my hands on numerous forums and found nothing concrete for ASP.NET web application. Most of the demos are provided for PHP sites, which does not work like ASP.NET.</p>

<p>When I try to run </p>

<pre><code>sqlmap.py -u ""https://test.XXXX_SIT/login.aspx"" --dbs
</code></pre>

<p>command, I end up getting the below response from the SQLMAP console</p>

<p><a href=""https://i.stack.imgur.com/kYSdd.png"" rel=""nofollow noreferrer""><img src=""https://i.stack.imgur.com/kYSdd.png"" alt=""Response from SQLMAP""></a></p>

<p>I am new to this aspect of security testing and I am even open for any better and simple <strong>free</strong> tool that does the job for me. </p>

<p>Please let me know the possible solution or other better possibilities to achieve this.</p>

<p>Regards,</p>

<p>Krishna Samaga B.</p>
",https://stackoverflow.com/questions/52409303/using-sqlmap-to-test-sql-injection-in-asp-net-web-application,"['asp.net', 'testing', 'code-injection', 'web-testing', 'sqlmap']",4030,FALSE,1,1
session_regenerate_id and security attributes,"<p>I have a strange issue where after I regenerate a session ID using </p>

<pre><code>session_regenerate_id(true);
</code></pre>

<p>The cookie seems to lose its ""Secure, HttpOnly"" flags. </p>

<p>I can reset the cookie by using </p>

<pre><code>$params = session_get_cookie_params();
setcookie(""PHPSESSID"", session_id(), 0, $params[""path""], $params[""domain""],
    true,  // this is the secure flag you need to set. Default is false.
    true  // this is the httpOnly flag you need to set

);
</code></pre>

<p>but veracode (who we use for security testing) is flagging it at unsure because the first cookie (the one that is regenerated) does not have the secure, HttpOnly tags in the header.</p>

<p>Here is the sample header</p>

<pre><code>Cache-Control: no-store, no-cache, must-revalidate
Connection: Keep-Alive
Content-Length: 0
Content-Type: text/html; charset=UTF-8
Date: Tue, 06 Nov 2018 12:56:41 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive: timeout=5, max=98
Location: home.php
Pragma: no-cache
Server: Apache
Set-Cookie: PHPSESSID=18a289a6c8d34b0df72dafc9d5e12c92; path=/
Set-Cookie: PHPSESSID=18a289a6c8d34b0df72dafc9d5e12c92; path=/; secure; HttpOnly
</code></pre>

<p>Veracode is flagging the issue because the first cookie - does not have the secure, httpOnly tags.  I guess its only reading the first, or it feels that them not showing up by default is insecure..How do I go about forcing those tags on a regenerated session? Or is there a better way to achieve what they ask? Here is my code.</p>

<pre><code>session_start();

$_SESSION = array();
session_unset();
session_destroy();
session_start(); //Not sure if this is needed

session_regenerate_id(true);
$params = session_get_cookie_params();
setcookie(""PHPSESSID"", session_id(), 0, $params[""path""], $params[""domain""],
    true,  // this is the secure flag you need to set. Default is false.
    true  // this is the httpOnly flag you need to set

);
</code></pre>
",https://stackoverflow.com/questions/53172484/session-regenerate-id-and-security-attributes,"['php', 'session', 'session-cookies']",537,TRUE,3,2
Burp Suite Professional Error Failed to connect to 127.0.0.1:80,"<p>I am completely new to burp suit and dvwa as well, I have one task into my plate to execute, that is security testing, I have invested today entire day to collect data and watch videos and to apply the same to my assigned task, which is not successful yet so I finally take a step to ask you guys for help.  I hope someone will help out on my below queries and issues which I am facing now, Thanks in advance. </p>

<p>I have installed DVWA on my windows 7 machine, updated properly in a config file, not from the command prompt, and run Apache and SQL properly in XAMPP control panel but when I try to execute it's redirecting to <a href=""http://127.0.0.1:8080/dvwa/setup.php"" rel=""nofollow noreferrer"">http://127.0.0.1:8080/dvwa/setup.php</a> And when I try to click on Create/Reset database I got this error 
""Could not connect to the MySQL service.
Please check the config file.""
""Your database user is root, if you are using MariaDB, this will not work, please read the README.md file."" 
Please note: I didn't use ""MariaDB""</p>

<p>One more thing I am facing an issue here, If I run BurpSuit then it is not opening <a href=""http://127.0.0.1:8080/dvwa/"" rel=""nofollow noreferrer"">http://127.0.0.1:8080/dvwa/</a> getting an error: ""Burp Suite Professional Error Failed to connect to 127.0.0.1:80"" last 8080 it is taking 80 only. </p>

<p>Please help me out how to resolve this.﻿</p>
",https://stackoverflow.com/questions/53940352/burp-suite-professional-error-failed-to-connect-to-127-0-0-180,"['security', 'burp']",5296,FALSE,0,0
Is there an easier way to test PHP source-code on multi-platforms using Docker images?,"<p>I'm performing security testing on PHP source-code. The functionality of the script highly depends on the underlying infrastructure since it has optimizations for Linux, OSx and Windows as well as PHP 5.x, PHP 7.x, MySQL 4.x and 5.x. Also there is a possibility to use a different database back-end like SQLite.</p>

<p>I wrote some good tests in order to test specific functionality. And I want to reuse that test and automatically run my tests in the different environments. I would like to use Docker for that. But I'm quite new to Docker. Although I'm pretty handy in Bash scripting. I did some research into existing containers and possibilities. But it seems there is no easy way to get the desired containers.</p>

<p>Let's for now forget about OSx and Windows, and focus on Linux only. To make things easier. In my ideal scenario I start up a few docker containers each on it's own port, running the same software on a different infrastructure, like:</p>

<ul>
<li>Linux, Apache 2.x, PHP 5.x, MySQL 4.x</li>
<li>Linux, Apache 2.x, PHP 5.x, MySQL 5.x</li>
<li>Linux, Apache 2.x, PHP 7.x, MySQL 4.x <em>(if even possible)</em></li>
<li>Linux, Apache 2.x, PHP 7.x, MySQL 5.x</li>
<li>Linux, Apache 2.x, PHP 5.x, SQLite</li>
<li>Linux, Apache 2.x, PHP 7.x, SQLite</li>
</ul>

<p>Preferably with a lightweight Linux distro such as Arch or Alpine. </p>

<p><em>I just finished some successful testing with Ubuntu as a distro but before I go into scripting all these Docker images myself I wondered if there is no easier solution to get this up and running.</em></p>

<p><strong>Is there an easier way to test PHP source-code on multi-platforms using Docker images?</strong></p>
",https://stackoverflow.com/questions/48923607/is-there-an-easier-way-to-test-php-source-code-on-multi-platforms-using-docker-i,"['docker', 'testing', 'dockerfile', 'docker-machine', 'docker-image']",160,TRUE,0,1
