Juniper Netscreen Log Files - firewall

I am trying to find a way to copy the log files from a Juniper SSG5 so that I can programmatically analyse them.
I know that it is possible to scp files from the Juniper but I have been unable to find where the logs are saved on the device.
Any help on locating these logs (all of them) would be great!

It seems that there is no simple way to access the log files on the Juniper Netscreen however it does provide options for configuring remote logging using syslog.
This can be configured to point to a syslog server on the network which can in turn be configured to log these remote messages to a local file (or pass them on to another syslog server)

show log command will give you filenames.
show log
user#host> show log
total 57518
-rw-r--r-- 1 root bin 211663 Oct 1 19:44 dcd
-rw-r--r-- 1 root bin 999947 Oct 1 19:41 dcd.0
-rw-r--r-- 1 root bin 999994 Oct 1 17:48 dcd.1
-rw-r--r-- 1 root bin 238815 Oct 1 19:44 rpd

Related

Linux Images wont show up on main root folder but will on a subfolder

I have playing with some docker containers with LAMP.
The issue I am facing is that if I put my webpage to the www folder the page is showing up but the images from the folder www/icons/test.png wont show up. (http://192.168.123.123:8082/icons/test.png)
I get
Not Found
The requested URL was not found on this server.
Apache/2.4.38 (Debian) Server at 192.168.123.123 Port 8082
I made a copy of the icons folder to a subfolder www/test/icons/test.png and its working fine!
If I change path on the webpage all good.(http://192.168.123.123:8082/test/icons/test.png)
I checked the permissions for both folders and subfiles and they are the same!
drwxr-xr-x 11 userwh2 userwh2 4096 Aug 2 08:53 www
drwxr-xr-x 2 userwh2 userwh2 4096 Aug 1 10:19 www/icons
-rw-r--r-x 1 userwh2 userwh2 12145 Jul 24 2020 www/icons/test.png
drwxr-xr-x 3 userwh2 userwh2 4096 Aug 2 08:52 www/test
drwxr-xr-x 2 userwh2 userwh2 4096 Aug 1 10:19 www/test/icons
-rw-r--r-x 1 userwh2 userwh2 12145 Jul 24 2020 www/test/icons/test.png
I cant figure it out....
Any ideas anyone?
Edit:
Found this in the log:
Cannot serve directory /usr/share/apache2/icons/: No matching DirectoryIndex (index.php,index.html) found, and server-generated directory index forbidden by Options directive
Actually I was able to find an answer
https://forum.getkirby.com/t/subpage-not-working-after-digital-ocean-deployment/16083/41
Seems like the /icons folder name its used by apache2 when doing a lookup and that is why its getting confused. Its like a common name probably in apache (ex, root, etc)

Not able to access _admin in WireMock

I am using the standalone jar of WireMock on CentOS.
Starting the server is fine but when I am trying to access the mapping files using the url:
http://localhost:8090/_admin
I am getting the error:
HTTP ERROR 404
Problem accessing /__files/_admin. Reason:
NOT_FOUND
I am starting WireMock as below:
java -jar wiremock-1.57-standalone.jar --port 8090
Below are the permissions of the files in the directory:
drwxrwxrwx 2 anurag.upadhaya domain users 4096 Mar 17 12:16 __files
drwxrwxrwx 2 anurag.upadhaya domain users 4096 Mar 17 12:16 mappings
-rwxrwxrwx 1 anurag.upadhaya domain users 6935826 Mar 18 09:57 wiremock-1.57-standalone.jar
It's __admin (with two underscores)

CentOS and fontconfig: Cannot load default config file

I'm getting following error when using imagick:
Fontconfig error: Cannot load default config file
My script is working but i would like to fix this (is filling up log file).
OS is:
# cat /etc/redhat-release
CentOS release 5.10 (Final)
I was looking trough internet little bit and this is causing problem:
access("/etc/fonts/fonts.conf", R_OK) = -1 ENOENT (No such file or directory)
Folder exists:
# ls /etc/fonts/ -all
total 64
drwxr-xr-x 4 root root 4096 Jul 9 2010 ./
drwxr-xr-x 86 root root 12288 Jan 13 00:48 ../
drwxr-xr-x 2 root root 4096 Jan 3 2012 conf.avail/
drwxr-xr-x 2 root root 4096 Apr 14 2013 conf.d/
-rw-r--r-- 1 root root 5239 Jan 12 2008 fonts.conf
-rw-r--r-- 1 root root 6907 Jan 12 2008 fonts.dtd
But i see only this folder via root account, other account under with script is run doesn't see this folder. Permissions looks fine for me, but not so experienced with linux.
Account under with script is run is created with WHM.
Please help :)
I manage to solve my problem. chroot was making trouble.
I need to:
log with root account
find jailed environment of account on with i run script (in my case /home/virtfs/[username])
to create folder where i will mount real stuff mkdir /home/virtfs/[username]/etc/fonts
to mount /etc/fonts to this folder: mount --bind /etc/fonts /home/virtfs/[username]/etc/fonts
Posting an answer for CentOS 7 in 2021:
yum install fontconfig
More info here:
https://centos.pkgs.org/7/centos-x86_64/fontconfig-2.13.0-4.3.el7.x86_64.rpm.html

svn permission issue - txn-current-lock: Permission denied

I setup svn on my local system /svn/repos/myproject by following this tutorial. I'm able to view the repo in browser.
But when it try to import new project I couldn't through svn client ( rapid svn ) it shows following error:
Execute: Import
Error while performing action:
Can't open file '/svn/repos/myproject/db/txn-current-lock': Permission denied
Svn directory permissions:
→ ls -l /svn
total 12
drwxrwxr-x 2 root root 4096 Feb 15 12:09 permissions
drwxrwxr-x 4 apache apache 4096 Feb 15 12:09 repos
drwxrwxr-x 2 root root 4096 Feb 15 12:09 users
Repo directory:
→ ls -l
total 8
drwxrwxr-x 3 root root 4096 Feb 15 12:09 conf
drwxrwxr-x 7 apache apache 4096 Feb 15 12:09 myproject
How to solve this issue?
I've given 777 permission to repos directory which solved this issue. But i got another issue like Couldn't perform atomic initialization.
I think this is due to incompatible sqlite version with subversion we're using, this can be solved by updating svnadmin command,
svnadmin create --pre-1.6-compatible --fs-type fsfs /svn/repos/myproject

Java Security Class Couldn't be found

When launching my program the next error pops out
java.lang.NoClassDefFoundError: Could not initialize class javax.crypto.SunJCE_b
which means this class is missing although I've found this class manually, works via jar/ide but doesn't works prefectly via service.
Maybe I need to make a few modifications? but which?
Thanks in advance
I don't know if this is relevant to your problem but I was experiencing the exact same behavior due to versions of the JCE Policy files I was using.
Using the proper Unlimited Strength Cryptography Extenstions solved this issue for me. I believe I might have accidentally installed the extensions for Java 7 as opposed to 6. (I was using Java 6 for compilation)
For a windows machine, they should be installed in the jre/lib/security folder of your installed JDK, for example: c:\program files\Java\jdk1.6.0_33\jre\lib\security
The class should be located in the jce.jar file. This has to be on the classpath. Double check your classpath parameters which should be either the -cp parameter if you start the application without the -jar option xor the Class-Path entry in the jars manifest if you use java -jar myapp.jar to start you program
You found a common WTF ;) - that's a widely unknown rule: if you start you app with the -jar option, then the -cp option and the CLASSPATH environment are ignored. Then the classpath must specified inside the Manifest only.
Quick workaround - assuming, you "main class" is named com.example.App, then start the application like this:
java -cp jce.jar com.example.App
We had the permissions of our files only set to be read only by root and gave us a similar error.
Change permissions and things worked!
$ pwd
/usr/lib/jvm/java/jre/lib/security
$ ls -l
total 128
-rw-r--r--. 1 root root 2177 Mar 1 2013 blacklist
-rw-r--r--. 1 root root 84029 Sep 30 18:01 cacerts
-rw-r--r--. 1 root root 2253 Mar 1 2013 java.policy
-rw-r--r--. 1 root root 11804 Mar 1 2013 java.security
-rw-r--r--. 1 root root 109 Mar 1 2013 javaws.policy
-rw-r--r--. 1 root root 2481 Sep 16 16:50 local_policy.jar
-rw-r--r--. 1 root root 0 Mar 1 2013 trusted.libraries
-rw-r--r--. 1 root root 1924 Jul 18 17:42 truststore-epicinterbld.pem
-rw-r--r--. 1 root root 2465 Sep 16 16:50 US_export_policy.jar
Check which jre is being used when you're launching and make sure the jre/lib/ext folder contains sunjce_provider.jar
Make sure you aren't using the extensions directory option. In the past when I used the extensions directory option instead of a classpath it was no longer able to load the Security libraries and policies. When I went back to using an explicit classpath the Security functionality resumed working.
I deleted various older JDKs in /Library/Java/VirtualMachine (got osx) and after restarting android studio the error was gone, but I hat to set the jdk again. Maybe it helps others.
This is issue with the JRE version, it should point to the same jre version as being used by the program, it looks for "jre/lib/security" should be under the same jdk of your program

Resources