Tuesday, August 27, 2013

So, Suddenlink, really?

So I was working from home when my VPN dropped and I didn't notice - it happens.

Instead of going to an internal site I ended up on the web interface for an Arris Cable modem.

I was of course confused because I have a Motorola cable modem.
So being the curious type I put in a new IP address and another cable modem, this time SMC.

Well now I got curious I opened up Angry IP Scanner.
I did a scan on the /24 first then expanded it to a /16, although I only got IPs within a /21.
Either way there 1976 hosts that showed up.
A lot of them with port 80, 22, or 23 open to them.
I went to a lot of the web interfaces.

I then found this PDF http://www.answersthatwork.com/Download_Area/ATW_Library/Networking/Network__4-List_of_default_Router_Admin_Passwords_and_IP_addresses.pdf
Apparently a lot of these cable modems, if they do have usernames and passwords at all are accessible via what's listed there.

Well I figured if I can do this, surely someone else can.
So I though I need to report this to my ISP, Suddenlink.
Here's how that went down...

So Suddenlink has a chat with a tech thing I thought that would be great so I can document this and they can fix it.

Nope...

Below is my initial post to them.

Long story short I was working from home and assumed my VPN was connected, I attempted to access an internal site, but instead was redirected to an Arris cable modem, as it turns out my vpn had disconnected. However I then realized this wasn't my cable modem. Looking further I found (using Angry IP Scanner) that I can access the web/telnet/ssh interfaces for some 1976 cable modems. Am I supposed to be able to do this?

Surprisingly I wasn't in queue at all, I got straight through to a technician.

This is what I got in response:

Thank you for choosing Suddenlink Online Support. Be sure to ask us about the all new Any-Room DVR and Stream powered by TiVo, which will allow you to enjoy your favorite TV programming anywhere!
You have been connected to Mayra P..
Mayra P.:  Hi Benjamin! Thank you for choosing Suddenlink Online Support. My name is Mayra and I would be happy to assist you today.
Mayra P.:  Thank you! One moment please while I pull up your account.
Mayra P.:  For security purposes, can you please provide me with the last four digits of the Social Security number on the account?
Benjamin Warriner:  <redacted>
Mayra P.:  Thank you. Just one moment please.
Mayra P.:  Thank you for your patience.
Mayra P.:  You should not be able to see other modems. There is a program running that shouldn't be. What we can do is report this to our internal IT department and then reset your modem. If you are still able to see the other modems I would consult your IT department directly because there may be a virus on your computer. It could be the back door that a hacker is using to access your information.
Benjamin Warriner:  Yeah, I doubt that.
Mayra P.:  Well, sir I do apologize however you shouldn't be able to see other peoples modems. If you are there is something wrong.
Benjamin Warriner:  There isn't anything running on my mac. Well that's why I brought this to your attention. I assumed this wasn't correct
Mayra P.:  We can try to fix it from here but if you were in your VPN and it was disconnected but you were able to see other modems.
Mayra P.:  I can alert our IT department but your program should not do what it did and we can not assist you with what the program did.
Benjamin Warriner:  Perhaps you misunderstood me - I thought my VPN was still connected - you see we use a <redacted> IP range at work. Apparently you (suddenlink) use that same range. My VPN isn't connected anymore. I even tried this from another device, an ipad that's never been connected to my VPN and it can also access these devices. That is to say there is no program being used to do this, just the Internet connection you're providing me
Mayra P.:  We only handle residential accounts in this department and we can not assist you with your VPN services. Those services are through your company.
Mayra P.:  You would have to speak with your IT department. We are unable to assist you with VPN access for any company.
Benjamin Warriner:  I am not asking for assistance
Benjamin Warriner:  I am saying I believe there is a flaw in some equipment, perhaps a missing ACL or other issue that is mistakenly letting me see and access other customers cable modems. I am only brining this to your attention so you can forward it to someone who can actually do something about it.
Mayra P.:  Sure, I have alerted our IT department about this issue. Is there anything else that I can assist you with?
Benjamin Warriner:  That was it, thanks.
Mayra P.:  You are very welcome. It has been a pleasure assisting you today Benjamin. Once again, my name is Mayra and thank you for choosing Suddenlink Online Support.
Your session has ended. You may now close this window.

So, I am not sure if anything will come of it, but ...

Wednesday, March 27, 2013

Bacula Errors and Other Fun Stuff

So I recently upgraded PostgreSQL from 8.3 to 8.4 and more or less at the same time upgraded Bacula to 5.2.14 from some earlier version, I don't remember what can I say.

Anyway in the process I ran into this error when opening bconsole:

JobId 0: Fatal error: Pool Default not in database. sql_create.c:189 pool record Default already exists

I couldn't for the life of me figure this out.

So I eventually got into pgsql as bacula and did a select statement


bacula=> select * from pool
;
 poolid |  name   | numvols | maxvols | useonce | usecatalog | acceptanyvolume | volretention | voluseduration | maxvoljobs | maxvolfiles | maxvolbytes | autoprune | recycle | actiononpurge | pooltype | labeltype | labelformat | enabled | scratchpoolid | recyclepoolid | nextpoolid | migrationhighbytes | migrationlowbytes | migrationtime 
--------+---------+---------+---------+---------+------------+-----------------+--------------+----------------+------------+-------------+-------------+-----------+---------+---------------+----------+-----------+-------------+---------+---------------+---------------+------------+--------------------+-------------------+---------------
      1 | Default |      44 |     800 |       0 |          1 |               0 |      2592000 |              0 |         40 |           0 |           0 |         1 |       1 |             1 | Backup   |         0 | stor2-      |       1 |             0 |             0 |          0 |                  0 |                 0 |             0
      1 | Default |      44 |     800 |       0 |          1 |               0 |      2592000 |              0 |         40 |           0 |           0 |         1 |       1 |             1 | Backup   |         0 | stor2-      |       1 |             0 |             0 |          0 |                  0 |                 0 |             0
(2 rows)

As you can see my default pool is listed twice, oh man...

So I couldn't think of a clever way to fix that so I did a Google Search which led me to Stack Overflow 

http://stackoverflow.com/questions/1746213/how-to-delete-duplicate-entries-in-postgresql

and on to this function

CREATE OR REPLACE FUNCTION remove_duplicates(text, text) RETURNS void AS $$
DECLARE
  tablename ALIAS FOR $1;
  duplicate_column ALIAS FOR $2;
BEGIN
  EXECUTE 'CREATE TEMPORARY TABLE _DISTINCT_' || tablename || ' AS (SELECT DISTINCT ON (' || duplicate_column || ') * FROM ' || tablename || ' ORDER BY ' || duplicate_column || ' ASC);';
  EXECUTE 'DELETE FROM ' || tablename || ';';
  EXECUTE 'INSERT INTO ' || tablename || ' (SELECT * FROM _DISTINCT_' || tablename || ');';
  EXECUTE 'DROP TABLE _DISTINCT_' || tablename || ';';
  RETURN;
END;
$$ LANGUAGE plpgsql;
Of course I also had to run CREATE LANGUAGE plpgsql; first
Then I ran 
bacula=> SELECT remove_duplicates('pool','poolid');
 remove_duplicates 
-------------------
 
(1 row)

bacula=> select * from pool
;
 poolid |  name   | numvols | maxvols | useonce | usecatalog | acceptanyvolume | volretention | voluseduration | maxvoljobs | maxvolfiles | maxvolbytes | autoprune | recycle | actiononpurge | pooltype | labeltype | labelformat | enabled | scratchpoolid | recyclepoolid | nextpoolid | migrationhighbytes | migrationlowbytes | migrationtime 
--------+---------+---------+---------+---------+------------+-----------------+--------------+----------------+------------+-------------+-------------+-----------+---------+---------------+----------+-----------+-------------+---------+---------------+---------------+------------+--------------------+-------------------+---------------
      1 | Default |      44 |     800 |       0 |          1 |               0 |      2592000 |              0 |         40 |           0 |           0 |         1 |       1 |             1 | Backup   |         0 | stor2-      |       1 |             0 |             0 |          0 |                  0 |                 0 |             0
(1 row)

Now there are no more messages in bconsole and no more errors!

Remove Stale/Old Active Sync Devices from All Mailboxes

I had an issue where several users that no longer work here still had active sync devices in AD for whatever reason so I needed to get rid of them.

Quick Google Search found this Technet thread

The long and short of it are these two lines that gather all the active sync devices that haven't checked in within the past 30 days and then removes them.

For my purposes I changed it 90 days the first time through, however I now run this script once monthly.

-- Powershell Start --

$DevicesToRemove = Get-ActiveSyncDevice -result unlimited | Get-ActiveSyncDeviceStatistics | where {$_.LastSuccessSync -le (Get-Date).AddDays("-30")}

$DevicesToRemove | foreach-object {Remove-ActiveSyncDevice ([string]$_.Guid) -confirm:$false}

-- Powershell End --

Now let's say the user doesn't have a mailbox on Exchange anymore.

You first have to temporarily recreate the mailbox

-- Powershell Start --

Enable-Mailbox -Identity:'OU/User'

-- Powershell End --

Then rerun the above script.

If you don't create the mailbox you get a can't find recipient error.

Then after the active sync devices are gone simply run

-- Powershell Start --

Remove-Mailbox -Identity:'OU/User'

-- Powershell End --

If for some reason you still can't remove the Active Sync devices you can open ADSI Edit and look for

CN=ExchangeActiveSyncDevices container under the user object

Then simply remove that.

Tuesday, March 26, 2013

A quote

A lack of scientific certainty should never be allowed to undercut our ability (and responsibility) to act on imperfect information. People who think science is certain don't understand science. We only ever have contingent knowledge - the most robust scientific thinking at a given moment - and this thinking is always subject to change. That's what makes it science. But just because the thing is imperfect does not actionable. Newtonian science is not perfect but it's enough to get us to the moon and back.

Mark Jannot - Editor-in-Chief Popular Science February 2012

Thursday, March 21, 2013

FreeBSD Update Script



This is a script I stole from someone else and modified.
It originally used portupgrade, but portmaster is better in my opinion.
The script basically looks for all out of date ports and runs through upgrading them.
Additionally it asks you to configure them and does this for all dependencies as well.

This isn't one of those set it and forget scripts you can put in crontab - you actually need to pay attention when upgrading ports and this script needs your full attention.

There a few pre-requisite things that must be addressed:
1) Make sure ports is installed or if it is installed, up to date

To Install Ports:
portsnap fetch extract

To Update Ports:
portsnap fetch update

2) Install portaudit

cd /usr/port/ports-mgmt/portaudit
make install clean

3) Install portmaster
cd /usr/ports/ports-mgmt/portmaster
make install clean

4) Create a log file /var/log/freebsd-update.log
touch /var/log/freebsd-update.log

--Script Start--
#!/bin/sh

LOG_FILE="/var/log/freebsd-update.log"

echo "Starting updates: `date`" | tee -a ${LOG_FILE}
echo "***"
echo "*** Checking for FreeBSD patches..."
echo "***"
/usr/sbin/freebsd-update fetch | tee -a ${LOG_FILE}
/usr/sbin/freebsd-update install | tee -a ${LOG_FILE}

echo "***"
echo "*** Updating ports tree..."
echo "***"
/usr/sbin/portsnap fetch update | tee -a ${LOG_FILE}

echo "***"
echo "*** Looking for ports to update..."
echo "***"
/usr/local/sbin/portmaster -a --force-config -d -b -t -v -y -t | tee -a ${LOG_FILE}

echo "***"
echo "*** Checking installed ports for known security problems..."
echo "***"
/usr/local/sbin/portaudit -Fva | tee -a ${LOG_FILE}
echo "Finished updates: `date`" | tee -a ${LOG_FILE}
--Script End--

Word of note if you need to exclude something add a -x after the -t and put in the name or partial name of a port such as:

/usr/local/sbin/portmaster -a --force-config -d -b -t -v -y -t -x LSOF | tee -a ${LOG_FILE}

You'll need to do a separate -x for each port you want to exclude.

Tuesday, January 29, 2013

Fwd: Working For a Budget in Washington and Jobs in Texas

This guy is an idiot, which is why I subscribe to the newsletter.
---------- Forwarded message ----------
From: "Senator John Cornyn" <newsletter@cornyn.enews.senate.gov>
Date: Jan 29, 2013 2:41 PM
Subject: Working For a Budget in Washington and Jobs in Texas
To: "Benjamin Warriner" <benjamin.warriner@gmail.com>
Cc:

> If you are having trouble viewing this message or would like to share it on a social network, you can view the message online.
>
> Unsubscribe - Update My Profile
>
> The Lonestar Weekly
> January 29, 2013
> SERVING TEXANS IN THE SENATE SINCE 2002
> Share on Facebook
>
> Share on Twitter
>
> No Budget, No Pay Act
>
> Click Here to Watch Video
>
>
> This week, I again cosponsored the "No Budget, No Pay" legislation, which would hold Congress accountable by requiring Members to pass a budget each fiscal year in order to receive pay.  Common sense doesn't seem all that common in Washington these days, but I think this is a sensible measure that members of Congress on both sides of the aisle can get behind, with strong support from Americans across the country. 
>
> Texas families and small businesses have to budget, and so should their government. I hope my colleagues will quickly lend their support to this legislation, which will help get us back on a fiscal track where we no longer spend money we don't have.
>
>  
>
>  
>
>  
>
> Keystone Pipeline
>
> Click Here to Watch Video
>
> This week, I also sent a letter encouraging the President to approve the Keystone XL pipeline. It has undergone more than four years of the most exhaustive environmental scrutiny of any pipeline in U.S. history, and just this week the Governor of Nebraska cleared the way for the pipeline to be routed through his state—one of the final hurdles preventing it from moving forward. Keystone XL will provide us with greater energy security, allowing us to tap into North American sources of energy and reducing our dependence on unstable nations in the Middle East.
>
> Just as important, this pipeline would create thousands of jobs, many of which would be in Texas, where the pipeline would terminate.The positive economic impact for Texas would be staggering, creating $1.6 billion of direct investment, an estimated $2 billion increase in our total economic output, and nearly $50 million dollars of increased revenue for our state.
>
> If the President is truly concerned about jobs, the economy, and energy security, he should stop stonewalling this pipeline and let it move forward as quickly as possible. 
>
>  
>
>  Fiscal Responsibility
>
> Click Here to Watch Video
>
> There are several important deadlines looming, including the debt ceiling and the across-the-board sequester of agency funds, including the Department of Defense. While no agency should be immune to spending cuts, we need to be careful to ensure that our military's mission and our national security requirements dictate the Defense budget and not the other way around.
>
> We have known about these deadlines for some time, but we have yet to see any leadership or proposals from the President that will bring both sides together to tackle these challenges. These are critical opportunities to answer the call of the American people and get serious about our nation's unsustainable debt. What we don't need is another manufactured crisis by the Obama Administration,forcing a 2:00 A.M. Senate vote. Nobody wants another cliffhanger that weakens public trust in our government or in our willingness to meet our responsibilities, and most of all no one wants another credit downgrade. It is time for the President to step forward and show real leadership that will get our nation back on a fiscally sustainable path.
>
> News Releases
>
> January 25:Cornyn Statement on 2013 March For Life
> January 23:Cornyn, Bipartisan Group of Senators Urge President To Approve Keystone XL
> January 23:U.S. Senators Cornyn and Cruz Joint Statement on Texans Killed in Algeria
> January 17:Cornyn Calls on Obama to Submit Debt Ceiling Request
> January 17:Cornyn Questions Holder Over Death of Reddit Co-Founder Aaron Swartz
> January 15:Cornyn: Closed Door Meetings, Retraction Letters Can't Erase Hagel's Record
> January 10:Cornyn Statement on Nomination of Jack Lew for Treasury Secretary
> January 10:Cornyn Op-Ed: Why I Can't Support Hagel
> January 7:Cornyn: Hagel 'Worst Possible Message' for U.S. Allies in Middle East
> January 4:Cornyn: Partial Government Shutdown May Be Needed to Restore Fiscal Sanity 
>
> Social Media
>
> Sen. Cornyn regularly updates his profiles with the latest news and developments from around Texas and Capitol Hill.
>
>      
>
> Texas Times Column
>
> December 14:Tales of Christmas Past In Texas
> November 20: A Message of Thanksgiving
> September 14: Cowtown On The Open Seas: Commissioning the USS Fort Worth
> August 29: A Texas Town with an Abundance of Books
> August 10: Back To School On The Texas Frontier
> July 27: Don't Mess With Texans' Hard-Earned Success
> July 2: Remembering The Sacrifices Behind Independence Day
> June 15: The Hero From Eden, Texas
> May 24:A Bittersweet Trip on the Honor Flight Network
> May 14:Saluting Unsung Heroes: Military Spouses
>
> TEXAS OFFICES
> WASHINGTON DC OFFICE
> Click your region to
> find the latest news and office location
> 517 Hart Senate Office Bldg.
> Washington, DC 20510
> Main: 202-224-2934
> Fax: 202-228-2856
> Unsubscribe - Update My Profile - Privacy Policy
>
>
>

I don't have a clue

I'm so very tired. It's almost all the time now.