Run a active scan from OWASP ZAP through Ubuntu command line using Open API Definition - linux-kernel

I'm trying to run a active scan from OWASP ZAP using only my Ubuntu(22.04) terminal by importing a external open API definition. This can be easily done through the GUI, but I need to do the same process using only command line. I didn't found a proper documentation to follow either.
I have tried following structure of the command to do the active scan, but seems it fails.
/path/to/zap.sh -daemon -openapifile /path/to/swagger.json -openapitargeturl /path/to/targetUrl -quickout /path/to/output.html
Can anyone suggest a proper way to make this active scan through the Ubuntu terminal.

We have lots of documentation for automating ZAP - see https://www.zaproxy.org/docs/automate/
I recommend looking at the API packaged scan and the Automation Framework.

Related

Access to Express.js and Prisma console

So im building app based on Express and using Prisma ORM. What i need is to SSH to a server, open up express.js console and create new db entry using prisma. Something similar to python manage.py shell for Django or rails console for Rails. Is there a solution for this of any kind?
Like I pointed in the comment there is a way ( kind of ) to get access to a running express instance. If that's all you need follow:
How can I open a console to interact with Express app?
Express doesn't exactly have a feature like rails console which is a framework feature in that case.
That said, I question the long term implication of this approach. If you really just need to seed some data, write an "init" script, and call it after you ssh into a server or using some CI/CD approach. This is more re-usable, since you can even pass a json file to the script to load dynamic data.
Also, Prismajs has an official way to seed the data ( if that's what you need) that you can leverage:
https://www.prisma.io/docs/guides/database/seed-database
UPDATE:
If you are able to run to code on your machine and point the remote database, then you can use node --inspect to debug in a chrome console. Which should give you about the same effect as a rails REPL
https://medium.com/#tbernardes/debugging-nodejs-with-chrome-inspector-devtools-1cd2ef323b5e

starting geoserver programmatically using java

I'm looking to run some integration tests with multiple geoserver instances and thought the best way would be to do setup and teardown programmatically.
Are there any simple examples of how this can be done?
You could start geoserver inside tomcat using {tomcat_home}/bin/startup.sh from command line (almost all programming languages let you run OS commands).
Now, for setup and data connections, your best chance is use Geoserver Rest API:
https://docs.geoserver.org/stable/en/user/rest/
If you want to replicate a same configuration/data setup for multiple geoserver instances, you could create a ready "data" directory with all your configurations and paste that directory on every geoserver instance you want.
The teardown step you can use {tomcat_home}/bin.shutdown.sh command.

How to execute a Unix shell script via GWT?

Im building an GUI that will help my team mates to execute some jars without going using the terminal (with all the validating and stuff).
At some stage, the gui sould gather params from the gui and execute them, something like : --start -Xbootclasspath/p:lib/OB-4.3.4.jar:lib/OBNaming-4.3.4.jar -Dmy.property.ns=corbaloc:iiop:localhost:900/NameService -Dmachine=energie -Dexecutable=MOREventd -DtypeArbo=1 -jar MOREventd
I was wondering how could i do that since Runtime Exec doesn't work with Google Web Toolkit)
thx for any help.
The GWT module will need to send details about the invocation to a server by using GWT-RPC, RequestFactory, or some other communication package. The server will then execute the commands on behalf of the browser client.

Desktop SPARQL client for Jena (TDB)?

I'm working on an app that uses Jena for storage (with the TDB backend). I'm looking for something like the equivalent of Squirrel, that lets me see what's being stored, run queries etc. This seems like an obvious thing to need, but my (perhaps badly phrased) google queries aren't turning up anything promising.
Any suggestions, please? I'm on XP. Even a command line tool would be helpful.
Take a look at my Store Manager tool which is part of the dotNetRDF Toolkit which I develop as part of the wider dotNetRDF project I maintain.
It provides a fairly basic GUI through which you can connect to various Triple Stores including TDB provided that you expose your dataset via Joseki/Fuseki. You need to have .Net 3.5 installed to run the apps in the toolkit.
If you don't already expose your TDB dataset via HTTP try using Fuseki as it is ridiculously easy to use and can be run just on your local machine when necessary to make your TDB store available via HTTP for use with my tool e.g.
java -jar fuseki-0.1.0-server.jar --update --loc data /dataset
Please see the Fuseki wiki for more information on running Fuseki and the various options. In the above example Fuseki is run with SPARQL Update enabled (the --update flag), using the TDB dataset located in the directory data (the --loc data argument) and with a base URI of /dataset for the data.
Once running you can use my tool to connect to a Fuseki server by going to File > New Generic Store Manager, selecting the "Fuseki" tab from the dialog that appears, entering the URI http://localhost:3030/dataset/data and then clicking "Connect to Fuseki".
Twinkle is a handy SPARQL client : http://www.ldodds.com/projects/twinkle/
As it happens I'm working on something similar myself, but it still needs a lot of work (check back in a month :) http://hyperdata.org/wiki/Scute
first download jena fusaki from
https://jena.apache.org/download/index.cgi
un-zip the file and copy the "jena-fuseki-1.0.1" to c drive
open cmd
type for accesing the folder
"cd C:\jena-fuseki-1.0.1"
then type
"java -jar fuseki-server.jar --update --loc data /dataset"
at last open a browser and type
"localhost:3030/"
remember you must first declear the enviorment verible(located in system poperties then advance tab)
and edit variable name call "Path" in the "System verible" to
"C:\jena-fuseki-1.0.1"
I also develop a SPARQL client, Open Source in Java Swing: EulerGUI.
In fact it does a lot more, see the manual:
http://eulergui.svn.sourceforge.net/viewvc/eulergui/trunk/eulergui/html/documentation.html
For the SPARQL feature, better take the EulerGUI minimal build:
http://sourceforge.net/projects/eulergui/files/eulergui/1.11/

How to configure firefox over command line on a linux machine

I use two Internet connections so i want to use bash scripts to automate the task of switching between the two..
the problem is i cant able to configure firefox proxy settings via scripts, so is there a way to do that... does any configuration file exists for firefox so that i can modify over command line..
I have read this entry but this dint helped me much.. (its on windows)
firefox proxy settings via command line
you can use the "automatic proxy configuration" for this. this field takes a "pac" file which in fact is just a javascript function named FindProxyForURL that can use things like dnsResolve or isInNet to determine wether a proxy is needed or not. there is a wikipedia article which describes the files in detail and i have written a blog post a while a go that gives an example function.

Resources