Categories
Welcome Center
Education & Development
Cyber Security
Virtualization
General
Certification Preparation
Project Management
Posts
Groups
Training Resources
Infosec
IT & Security Bootcamps
Practice Exams
Security Awareness Training
About Us
Home
Discussions
Off Topic
Holy Bash!
the_Grinch
I know I've been posting a lot about work lately, but I have to say for the first time I feel like I am doing meaningful work that is enjoyable. Today I wrote my first complete bash script. I have a long range of projects that I need to complete and one of them is to automate the checking of a series of terms and conditions. We are required to be notified when they change, but as we all know a method to monitor it independently of just going on the word of the companies we regulate is ideal. Tonight I completed a script that goes to one of the websites, copies the page, pulls out the lines related to the terms and conditions that are read by consumers, and finally compares it to another file we have with what they have been approved for.
My end goal is to make a web interface that shows the last time it ran, pass/fail (with an email alert on failures), why it failed, the next time it will run, and a manual run button. Kicking butt and taking names!
Find more posts tagged with
Save $250 on 2025 certification boot camps from Infosec!
Book now with code EOY2025
Button
Comments
YFZblu
Congratulations! Completing the first useful automation project is an amazing feeling.
NovaHax
Bash is the best!!!
Master Of Puppets
Now that's pretty cool! Good job
EdTheLad
Funny, i wrote a bash script about 2 month ago that would place combination bets on soccer, i used it to bet on accumulators varying the goals scored across a handful of games. Still didn't win, so i must continue in networking
.
EdTheLad
I used a macro addon in firefox "iOpus iMacros" to automate this.
You need to modify URL,array variables and possibly a couple of other things with a find replace.
The iMacros addon allows you to record browsing of the website and hence give you the variables required, i.e. this can be used on any kind of betting.
If you want the full script send me a pm, too large to paste here.
Was perl, thought it was bash, but pretty similar.
#!/usr/bin/env perl
use warnings;
my $URL = "URL GOTO=
http://www.sportsbet.com.au/betting/soccer/italy/italian-serie-a#"
;
my $MAX = 3;
my $x = 1;
my $a = 1;
my $b = 1;
my $c = 1;
my $d = 1;
my $e = 1;
#Liverpool vs Fulham 2-0,2-1,3-1
#Southmapton vs Hull 1-0,2-0,2-1
#Norwich vs Westham 1-0,0-0,0-1
#Tottenham vs New Castle 1-0,0-0,0-1
#Man U vs Arsenal 0-1,1-1,1-2
my
@Team1
= ("NULL","157","160","166");
my
@Team2
= ("NULL","205","208","211");
my
@Team3
= ("NULL","256","257","258");
my
@Team4
= ("NULL","307","308","309");
my
@Team5
= ("NULL","462","464","468");
print "VERSION BUILD=8530828 RECORDER=FX" . "\n";
print "TAB T=1" . "\n";
print "$URL" ."\n";
while ( $x <= $MAX ) {
print "TAG POS=$Team1[$a] TYPE=SPAN ATTR=CLASS:team-name<SP>ib" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=$Team2[$b] TYPE=SPAN ATTR=CLASS:team-name<SP>ib" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=$Team3[$c] TYPE=SPAN ATTR=CLASS:team-name<SP>ib" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=$Team4[$d] TYPE=SPAN ATTR=CLASS:team-name<SP>ib" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=$Team5[$e] TYPE=SPAN ATTR=CLASS:team-name<SP>ib" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=1 TYPE=INPUT:TEXT FORM=ID:betSlipInfoForm ATTR=TYPE:text&&ONBLUR:betslip.stake_onblur(this.id);&&ONFOCUS:betslip.stake_onfocus(this.id);&&ONCHANGE:betslip.stake_changed(this.id,<SP>false)&&ONKEYUP:betslip.stake_changed(this.id,<SP>true)&&VALUE:0.00&&ID:stake_type_ACC5&&CLASS:bs-stake-input<SP>betslipCombinedUnitInput CONTENT=.02" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=4 TYPE=TD ATTR=COLSPAN:4" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=1 TYPE=SPAN ATTR=CLASS:placebet" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=268 TYPE=DIV ATTR=*" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=150 TYPE=DIV ATTR=*" . "\n";
$x++;
$e++;
}
$x = 1;
$a = 1;
$b = 1;
$c = 1;
$d = 2;
$e = 1;
while ( $x <= $MAX ) {
print "TAG POS=$Team1[$a] TYPE=SPAN ATTR=CLASS:team-name<SP>ib" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=$Team2[$b] TYPE=SPAN ATTR=CLASS:team-name<SP>ib" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=$Team3[$c] TYPE=SPAN ATTR=CLASS:team-name<SP>ib" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=$Team4[$d] TYPE=SPAN ATTR=CLASS:team-name<SP>ib" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=$Team5[$e] TYPE=SPAN ATTR=CLASS:team-name<SP>ib" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=1 TYPE=INPUT:TEXT FORM=ID:betSlipInfoForm ATTR=TYPE:text&&ONBLUR:betslip.stake_onblur(this.id);&&ONFOCUS:betslip.stake_onfocus(this.id);&&ONCHANGE:betslip.stake_changed(this.id,<SP>false)&&ONKEYUP:betslip.stake_changed(this.id,<SP>true)&&VALUE:0.00&&ID:stake_type_ACC5&&CLASS:bs-stake-input<SP>betslipCombinedUnitInput CONTENT=.02" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=4 TYPE=TD ATTR=COLSPAN:4" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=1 TYPE=SPAN ATTR=CLASS:placebet" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=268 TYPE=DIV ATTR=*" . "\n";
print "WAIT SECONDS=5" . "\n";
print "TAG POS=150 TYPE=DIV ATTR=*" . "\n";
$x++;
$e++;
}
maharaliel
Pretty cool.
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Best Of
INFOSEC Boot Camps
$250
OFF
Use code
EOY2025
to receive $250 off your 2025 certification boot camp!
BROWSE BOOT CAMPS