yurisk.info

Yuri Slobodyanyuk's blog on IT Security and Networking sharing experience and expertise

Category: Uncategorized (page 1 of 3)

Russian English Slang Dictionary of the Russian Hacking Community

Work in progress …

Change colors of ls output in the bash shell

Usually colorization is put in action via alias : alias ls=’ls –color=auto’
You can turn off the colors each time you run ls: ls –color=never l or change the alias itself to disable fancy colors permanently or even simple \ls . But to change the colors you’d need to cause dircolors utility to read your own color database when the login session starts. So let’s do just that
1) Export existing db:
[bash]dircolors -p > dircolors.db[/bash]
2) edit :
[bash]vi dircolors.db[/bash]
e.g. change directories color from blue to red:[bash]di=01;34 -> di=01;31[/bash]
3) save changes
4) make bash to reload color scheme:
[bash]eval `dircolors dircolors.db`[/bash]
5) put [bash]eval `dircolors $HOME/dircolors.db`[/bash] into .profile file at the end of it.
That is it.

PTR bulk resolver in Perl to see what is in the name

There are 50 ways to do PTR resolving in bulk,and this is just one of them. It doesn’t pretend to be the fastest/coolest/best, the only thing
I can claim – it works. So use it for pleasure and work.

[perl]

# Yuri
# 19.02.2013
# this script accepts range of IP addresses to do PTr resolving for
# the range has to be in this format: startIp-endIp.startIp-endIp.startIp-endIp.startIp-endIp.
# Only answers are printed, i.e. if there is no answer nothing is printed
use warnings;
use strict;
use Net::DNS ;

my $res = Net::DNS::Resolver->new();
my $input = shift ;
$input =~ /(.+)-(.+)\.(.+)-(.+)\.(.+)-(.+)\.(.+)-(.+)/ ;
print "Resolving ptrs for the following range: $input\n" ;
print "Started working at: " . scalar gmtime . "\n" ;
my ($oct1_start,$oct1_end,$oct2_start,$oct2_end,$oct3_start,$oct3_end,$oct4_start,$oct4_end) = ($1,$2,$3,$4,$5,$6,$7,$8) ;
foreach my $oct1 ($oct1_start..$oct1_end) {
foreach my $oct2 ($oct2_start..$oct2_end) {
foreach my $oct3 ($oct3_start..$oct3_end) {
foreach my $oct4 ($oct4_start..$oct4_end) {
my $answer = $res->query("${oct1}.${oct2}.${oct3}.${oct4}") ;
if (defined $answer) {
my @ptr = $answer->answer;
foreach my $record_ptr (@ptr) {
#print " NEw " . $record_ptr->print ;
my $str = substr($record_ptr->string,rindex($record_ptr->string,’R’)+1) ;
print "$oct1.$oct2.$oct3.$oct4 " . $str . "\n";
}

}
} } }}

print "Run completed at: " . scalar gmtime . "\n" ;

[/perl]
Example run: #perl script.pl 194-194.90-90.33-33.0-255

Bash script to generate random passwords

Here I stumbled on great intro into Bash scripting for NetOps by John Kristoff ” Introduction to Shell and Perl scripting for Network Operators” and could’t help but do it my way. Here it is, bash
script that generates random password of printable characters, up to 15 at least.
[bash]
#!/bin/bash
# usage: randompass.sh [n] [count] – n is number of characters in password
# to generate 9 by default, and count – number of passwords to generate, 1 by default
n=${1:-9}
counter=${2:-1}
for ii in `seq 1 $counter` ;do
dd count=1 bs=15 if=/dev/urandom 2>/dev/null |
od -a |
sed ‘2d’ |
sed ‘s/0000000 \(.*\)/\1/’ |
tr -d ‘ ‘ | cut -c 1-$n |
sed ‘s/\([a-z]\)/\U&/3’ |
sed ‘s/\([A-Z]\)/\l&/4’
done [/bash]
Download the script
Example.

randompass.sh 7 7

o&sOh~K
deL(HMd
dc23DBg
HK?S@iE
_$SL*Ad
si|}Del
%I-ba

md5 sha256 sha-1 tiger and whirlpool sum checker for Windows

Trying out Amazon AWS Glacier with fastglacier.com as the upload GUI app I looked at few SHA256 sum calculating tools, and found this one by Jesse Kornblum to be the best for Windows.
It has some quite useful options like recursive folders calculation, file size limitation, reading file names from file and hash comparing. Be aware it is command-line only.

A bit of privacy on Youtube is now available

If you are not careful enough not to upload any identifiable videos to Youtube.com , at least make it less damaging to the people in the video by blurring faces with the new tool
introduced by them : http://youtube-global.blogspot.co.il/2012/07/face-blurring-when-footage-requires.html

New spam on the block

May be not new , but new to me – spam mails that instead of direct links to their websites list links cached in google. So , you get in the email not http://degayfisk.com/ but http://google.nr/search?q=cache:c2tHRUQ2mx4J:google.co.nz
It is ,by the way, recognized by eSafe 8.5 as a Clean mail, what a shame.

Older posts

© 2016 yurisk.info

Theme by Anders NorenUp ↑