Hi Tiff, That looks like it is working - a 301 response just means that you are being automatically redirected from '/scans' to '/scans/' (with the extra slash).
Since you then receive HTTP code 200, it looks like your code is correctly following the redirect and sending data to /scans/. If you can print the JSON response from connect somehow, you should see that you have started a scan. To avoid seeing the 301 response at all, just change your code to POST to /scans/. Best regards, Owen On 28 Jul 2015 4:30 am, "冠庭 羅" <btiffe...@yahoo.com.tw> wrote: > Hi Andrés Riancho, > > Sorry.. That is language gap... I thought that filename is like > "fast_scan.pw3af" so that I keep trying on folder name > But anyway, I tried "../../fast_scan.pw3af" before... > my code is like this (only change to the scan_profile) > @POST > @SuppressWarnings("unchecked") > @Path("/ScanTarget") > @Consumes(MediaType.*APPLICATION_JSON*) > @Produces(MediaType.*APPLICATION_JSON*) > *public* *int* ScanIt() *throws* IOException { > JSONObject jsonObject = *new* JSONObject(); > jsonObject.put("scan_profile", > "/home/tiff/w3af/profiles/fast_scan.pw3af"); > JSONArray jsonArray = *new* JSONArray(); > jsonArray.add("http://testaspnet.vulnweb.com/"); > jsonObject.put("target_url", jsonArray); > System.*out*.println("output:" + jsonObject.toJSONString()); > connect.set_response( > connect.get_service(). > > request(). > header("Content-Type", "application/json"). > post(Entity.*json*(jsonObject.toJSONString()))); > *return* connect.get_status(); > } > > and I got the status 301 message from w3af_api console > > (venv)[root@localhost w3af]# ./w3af_api > * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit) > 127.0.0.1 - - [27/Jul/2015 11:19:40] "POST /scans HTTP/1.1" 301 - > 127.0.0.1 - - [27/Jul/2015 11:19:40] "GET /scans/ HTTP/1.1" 200 - > > What's wrong in my web service or somewhere I lost it? > > Thanks > > Tiff > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > W3af-develop mailing list > W3af-develop@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/w3af-develop > >
------------------------------------------------------------------------------
_______________________________________________ W3af-develop mailing list W3af-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/w3af-develop