04-23-2012
[solved] Script to pull hashes out of large text file
I am attempting to write a script that will pull out NTLM hashes from a text file that contains about 500,000 lines of data. Not all accounts contain hashes and I only need the ones that do contain hashes.
Here is a sample of what the data looks like:
Quote:
Mango Chango A (a):$NT$547e2494658ca345d3847c36cf1fsef8:::
There are thousands of other lines in the file, but that particular line is what I need taken out of the file. There are about 100 lines that apply to that and I do not want to manually go through the entire file searching for that.
Is there an easy script or something I can run in Linux to pull lines that follow that pattern out of the file?
Thank you!
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Greetings.
I am struggling with a shell script to make my life simpler, with a number of practical ways in which it could be used. I want to take a standard text file, and pull the 'n'th word from each line such as the first word from a text file.
I'm struggling to see how each line can be... (5 Replies)
Discussion started by: tricky
5 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I am writing a shell script to pull a file from a remote server (Let say its a windows based remote server). One of my criteria is to pull a file only if it is not empty.
We have done a similar script to push a file from our end to a remote server and before pushing it we check for the... (2 Replies)
Discussion started by: sashankkrk
2 Replies
3. Shell Programming and Scripting
Hello Gurus,
We are facing some performance issue in UNIX. If someone had faced such kind of issue in past please provide your suggestions on this .
Problem Definition:
/Few of load processes of our Finance Application are facing issue in UNIX when they uses a shell script having below... (19 Replies)
Discussion started by: KRAMA
19 Replies
4. Shell Programming and Scripting
Hi Everyone,
I am using a centos 5.2 server as an sflow log collector on my network. Currently I am using inmons free sflowtool to collect the packets sent by my switches. I have a bash script running on an infinate loop to stop and start the log collection at set intervals - currently one... (2 Replies)
Discussion started by: lord_butler
2 Replies
5. Shell Programming and Scripting
I am hoping to get some help with a script to pull certain fields from a log file.
User update (xx6xxx P) rpt (yy6yyy B) 2010/01/20 21:36:01.298
Remote client forward start streamid 85af 2010/01/20 21:36:01.307
rpt2 (ZZ6ZZZ G) rpt1 (YY6YYY B) urcall (CQCQCQ ) mycall (W1AW)
user... (5 Replies)
Discussion started by: TedSD
5 Replies
6. Shell Programming and Scripting
I have CSV file that contains data in the format as shown below:
ABC, 67, 56, 67, 78, 89, 76, 55
PDR, 85, 83, 83, 72, 82, 89, 83
MPG, 86, 53, 54, 65, 23, 54, 75
..
..
..
..
I want to create a script that will pull out the rows from the above sheet and paste it into another CSV file.... (12 Replies)
Discussion started by: pankajusc
12 Replies
7. Shell Programming and Scripting
I have a collection of text files that comprise a mailing list archive. I grep them to find an email that interests me, then open the file in a text editor to find the surrounding paragraph of text. Is there an easy way to do this from the shell instead? (2 Replies)
Discussion started by: CRGreathouse
2 Replies
8. Shell Programming and Scripting
Hi folks,
I have a structure as mentioned below in a configuration file.
<Component>
Comp1:
{
item1:data,someUniqueAttribute;
item2:data,someUniqueAttribute,
}
Comp2:
{
item3:data,someUniqueAttribute;
... (1 Reply)
Discussion started by: ckv84
1 Replies
9. Shell Programming and Scripting
Hello all, newbie here. I've searched the forum and found many "how to split a text file" topics but none that are what I'm looking for.
I have a large text file (~15 MB) in size. It contains a variable number of "paragraphs" (for lack of a better word) that are each of variable length. A... (3 Replies)
Discussion started by: lupin..the..3rd
3 Replies
LEARN ABOUT DEBIAN
const::fast
Const::Fast(3pm) User Contributed Perl Documentation Const::Fast(3pm)
NAME
Const::Fast - Facility for creating read-only scalars, arrays, and hashes
VERSION
version 0.011
SYNOPSIS
use Const::Fast;
const my $foo => 'a scalar value';
const my @bar => qw/a list value/;
const my %buz => (a => 'hash', of => 'something');
SUBROUTINES
/METHODS
const $var, $value
const @var, @value...
const %var, %value...
This the only function of this module and it is exported by default. It takes a scalar, array or hash lvalue as first argument, and a list
of one or more values depending on the type of the first argument as the value for the variable. It will set the variable to that value and
subsequently make it readonly. Arrays and hashes will be made deeply readonly.
Exporting is done using Sub::Exporter for flexibility on import.
RATIONALE
This module was written because I stumbled on some serious issues of Readonly that aren't easily fixable without breaking backwards
compatibility in subtle ways. In particular Readonly's use of ties is a source of subtle bugs and bad performance. Instead, this module
uses the builtin readonly feature of perl, making access to the variables just as fast as any normal variable without the weird side-
effects of ties. Readonly can do the same for scalars when Readonly::XS is installed, but chooses not to do so in the most common case.
This may change in the future if someone takes up maintenance of Readonly, and the two modules may be convergence if that happens.
CAVEATS
Perl doesn't distinguish between restricted hashes and readonly hashes. This means that:
use Const::Fast;
const my %a => (foo => 1, bar => 2);
say 1 unless $a{baz}
Will give the error "Attempt to access disallowed key 'baz' in a restricted hash". You have to use "exists $a{baz}" instead. This is a
limitation of perl that can hopefully be solved in the future.
ACKNOWLEDGEMENTS
The interface for this module was inspired by Eric Roode's Readonly. The implementation is inspired by doing everything the opposite way
Readonly does it.
AUTHOR
Leon Timmermans <fawaka@gmail.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2010 by Leon Timmermans.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-04-22 Const::Fast(3pm)