Exploiting Wildcards On Linux/Unix

Standard

From: http://beta.slashdot.org/story/203895


DefenseCode released an advisory in which researcher Leon Juranic details security issues related to using wildcards in Unix commands. The topic has been talked about in the past on the Full Disclosure mailing list, where some people saw this more as a feature than as a bug.

There are clearly a number of potential security issues surrounding this, so Mr. Juranic provided five actual exploitation examples that stress out the risks accompanying practice of using the * wildcard with Linux/Unix commands.

The issue can be manifested by using specific options in chown, tar, rsync etc. By using specially crafted filenames, an attacker can inject arbitrary arguments to shell commands run by other users – root as well.

One of the examples provided is the tar arbitrary command execution. The binary has two options that can be used for poisoning:

–checkpoint[=NUMBER]
display progress messages every NUMBERth record (default 10)

–checkpoint-action=ACTION
execute ACTION on each checkpoint

By using tar with these options, a specified action can be used after a checkpoint. This action could be a malicious shell script that could be used for executing arbitrary commands under the user who starts tar. “Tricking” root to use the specific options is quite easy, and that’s where the wildcard comes in handy.

Running tar cf archive.tar * on a folder with these files seems pretty straightforward and benign.

[root@defensecode public]# ls -al
drwxrwxrwx. 2 user user 4096 Oct 28 19:34 .
drwx——. 24 user user 4096 Oct 28 18:32 ..
-rw-rw-r–. 1 user user 20480 Oct 28 19:13 admin.php
-rw-rw-r–. 1 user user 34 Oct 28 17:47 ado.php
-rw-rw-r–. 1 user user 187 Oct 28 17:44 db.php
-rw-rw-r–. 1 user user 201 Oct 28 17:43 download.php

The problem arises if the user created a couple of fake files and a shell script that contains any arbitrary command.

[root@defensecode public]# ls -al
drwxrwxrwx. 2 user user 4096 Oct 28 19:34 .
drwx——. 24 user user 4096 Oct 28 18:32 ..
-rw-rw-r–. 1 user user 20480 Oct 28 19:13 admin.php
-rw-rw-r–. 1 user user 34 Oct 28 17:47 ado.php
-rw-r–r–. 1 leon leon 0 Oct 28 19:19 –checkpoint=1
-rw-r–r–. 1 leon leon 0 Oct 28 19:17 –checkpoint-action=exec=sh shell.sh
-rw-rw-r–. 1 user user 187 Oct 28 17:44 db.php
-rw-rw-r–. 1 user user 201 Oct 28 17:43 download.php
-rwxr-xr-x. 1 leon leon 12 Oct 28 19:17 shell.sh

By using the * wildcard in the tar command, these files will be understood as passed options to the tar binary and shell.sh will be executed as root.

The advisory in question details other similar exploitation methods. Also, around the same time when Mr. Juranic informed us about his work, another researcher posted to the Full Disclosure mailing list a similarly themed research focused on exploiting wildcards.

Is there a workaround? To quote the most upvoted post on a recent Reddit thread regarding wildcard exploitation: “./* Done”.

456 total views, no views today

Hacked Via RDP: Really Dumb Passwords

Standard

From: http://krebsonsecurity.com/2013/12/hacked-via-rdp-really-dumb-passwords/

Businesses spend billions of dollars annually on software and hardware to block external cyberattacks, but a shocking number of these same organizations shoot themselves in the foot by poking gaping holes in their digital defenses and then advertising those vulnerabilities to attackers. Today’s post examines an underground service that rents access to hacked PCs at organizations that make this all-too-common mistake.

Makost[dot]net is a service advertised on cybercrime forums which sells access to “RDPs”, mainly Microsoft Windows systems that have been configured (poorly) to accept “Remote Desktop Protocol” connections from the Internet. Windows ships with its own RDP interface built-in; to connect to another Windows desktop or server remotely, simply fire up the Remote Desktop Connection utility in Windows, type in the Internet address of the remote system, and enter the correct username and password for a valid user account on that remote system. Once the connection is made, you’ll see the remote computer’s desktop as if you were sitting right in front of it, and have access to all its programs and files.

Makhost[dot]net sells access to thousands of hacked RDP installations. Prices range from $3 to $10 based on a variety of qualities, such as the number of CPUs, the operating system version and the PC’s upload and download speeds.

Makost currently is selling access to more than 6,000 compromised RDP installations worldwide. As we can see from the screen shot above, hacked systems are priced according to a combination of qualities of the server:

city, state, country of host;
administrative or regular user rights;
operating system version;
number and speed of computer processors;
amount of system memory;
network download and upload speeds;
NAT or direct
KrebsOnSecurity was given a glimpse inside the account of a very active user of this service, an individual who has paid more than $2,000 over the past six months to purchase some 425 hacked RDPs. I took the Internet addresses in this customer’s purchase history and ran WHOIS database lookups on them all in a bid to learn more about the victim organizations. As expected, roughly three-quarters of those addresses told me nothing about the victims; the addresses were assigned to residential or commercial Internet service providers.

But the WHOIS records turned up the names of businesses for approximately 25 percent of the addresses I looked up. The largest group of organizations on this list were in the manufacturing (21 victims) and retail services (20) industries. As I sought to categorize the long tail of other victim organizations, I was reminded of the Twelve Days of Christmas carol.

twelve healthcare providers;
ten education providers;
eight government agencies;
seven technology firms;
six insurance companies;
five law firms;
four financial institutions;
three architects;
two real estate firms;
and a forestry company (in a pear tree?)

How did these companies end up for sale on makost[dot]net? That is explained deftly in a report produced earlier this year by Trustwave, a company which frequently gets called in when companies experience a data breach that exposes credit card information. Trustwave looked at all of the breaches it responded to in 2012 and found — just as in years past — “IP remote access remained the most widely used method of infiltration in 2012. Unfortunately for victim organizations, the front door is still open.”

The report continues:

“Organizations that use third-party support typically use remote access applications like Terminal Services (termserv) or Remote Desktop Protocol (RDP), pcAnywhere, Virtual Network Client (VNC), LogMeIn or Remote Administrator to access their customers’ systems. If these utilities are left enabled, attackers can access them as though they are legitimate system administrators.”

Source: Trustwave 2013 Global Security Report

“Would-be attackers simply scan blocks of Internet addresses looking for hosts that respond to queries on one of these ports. Once they have a focused target list of Internet addresses with open remote administration ports, they can move on to the next part of the attack: The number 2 most-exploited weakness: deafult/weak credentials.”

In case the point wasn’t clear enough yet, I’ve gathered all of the username and password pairs picked by all 430 RDP-enabled systems that were sold to this miscreant. As evidenced by the list below, the attackers simply needed to scan the Internet for hosts listening on port 3389 (Microsoft RDP), identify valid usernames, and then try the same username as the password. In each of the following cases, the username and password are the same.

Some of these credential pairs even give you an idea of the type of organization involved, the employee account that was compromised (“intern,” “techsupport,”); the purpose of the hacked system (“payroll”, “fax,” “scanner,” “timeclock”); even the geographic location of the compromised PC within the organization (e.g., “front desk,” “conference room,” “garage”). Incredibly, some of the systems appear to be named after actual security features or backup devices (“symantec,” “sonicwall,” “sophos”):

owner owner
showroom showroom
operations operations
train train
test test
colin colin
robert robert
install install
besadmin besadmin
tony tony
guest guest
symantec symantec
stacey stacey
stephanie stephanie
jessica jessica
install install
frontdesk frontdesk
sophos sophos
tim tim
lisa lisa
guest guest
guest guest
timeclock timeclock
dale dale
djohnson djohnson
john john
staff staff
student student
cw cw
guest guest
inventory inventory
aspnet aspnet
scanner scanner
tablet1 tablet1
timeclock timeclock
rsmith rsmith
tara tara
gary gary
user user
billing1 billing1
shipping1 shipping1
warehouse warehouse
scott scott
cnc cnc
training training
personnel personnel
template template
training training
faxserver faxserver
nicole nicole
sales sales
jbrown jbrown
driver driver
ksmith ksmith
sys sys
engineering engineering
gking gking
guest guest
kclark kclark
kwebb kwebb
guest1 guest1
robert robert
AdMiNiStRaToR AdMiNiStRaToR
ipad ipad
rae rae
canon canon
shipping shipping
fax fax
remote1 remote1
mission mission
reporter reporter
dispatch dispatch
guard guard
rm rm
marcia marcia
sales sales
makik makik
kbrown kbrown
kbrown kbrown
ray ray
jrobinson jrobinson
shop shop
remote remote
dharris dharris
user user
bkexec bkexec
cmm cmm
toolcrib toolcrib
test test
temp temp
sbrown sbrown
dispatch dispatch
carpet carpet
laura laura
techsupport techsupport
bkexec bkexec
ganderson ganderson
buexec buexec
twadmin twadmin
acs acs
acs acs
bkexec bkexec
testu testu
bookkeeper bookkeeper
rtcservice rtcservice
jcampbell jcampbell
mlee mlee
email email
owner owner
bethb bethb
sisadmin sisadmin
cmartinez cmartinez
beadmin beadmin
mattp mattp
conf conf
prod prod
ws ws
jackie jackie
tempadmin tempadmin
install install
support support
wendy wendy
ricoh ricoh
simmons simmons
agarcia agarcia
jens jens
prod prod
timeclock timeclock
specialist specialist
christine christine
training training
sqlexec sqlexec
production production
testuser testuser
garage garage
sms sms
ldap ldap
sharepoint sharepoint
epicor epicor
epicor epicor
sandy sandy
resource resource
carrie carrie
nancy nancy
remote remote
lisa lisa
sales sales
kristina kristina
facilities facilities
erika erika
seagate seagate
mmills mmills
checkout checkout
susan susan
peter peter
insurance insurance
Administrator Administrator
maureen maureen
mike mike
training training
av av
schedule schedule
brad brad
timeclock timeclock
awilson awilson
spadmin spadmin
cecilia cecilia
renee renee
fax fax
sonny sonny
joey joey
caroot caroot
xray xray
dallen dallen
triage triage
ewilliams ewilliams
djordan djordan
clerk clerk
danny danny
bkupexec bkupexec
bu bu
monroe monroe
mmiller mmiller
seagate seagate
mmurray mmurray
recruiting recruiting
jsmith jsmith
jwilson jwilson
buexec buexec
mikeg mikeg
jking jking
bobc bobc
caroot caroot
kronos kronos
jgreen jgreen
bkupexec bkupexec
lab lab
jaime jaime
davidf davidf
kronos kronos
xray xray
rbrown rbrown
bizhub bizhub
julie julie
bec bec
checkout checkout
tuser tuser
bjohnson bjohnson
jbox jbox
dataentry dataentry
itsupport itsupport
sharepoint sharepoint
pc pc
volunteer volunteer
mail mail
konica konica
mill mill
canon canon
volunteer volunteer
heidi heidi
carla carla
tracy tracy
frontdesk frontdesk
driver driver
operations operations
trainer trainer
accounts accounts
labuser labuser
production production
jsmith jsmith
sup890 sup890
installer installer
help help
intern intern
la la
timeclock timeclock
confrm confrm
assembly assembly
john john
spadmin spadmin
jdoe jdoe
bloomberg bloomberg
resume resume
attach attach
assembly assembly
faxes faxes
faxes faxes
aevans aevans
tjones tjones
dbagent dbagent
Scanner Scanner
frontoffice frontoffice
Billing Billing
Nurse Nurse
MS MS
buexec buexec
xray xray
joan joan
frontdesk frontdesk
bkupexec bkupexec
kjohnson kjohnson
marcia marcia
kbrown kbrown
str str
awilliams awilliams
lsmith lsmith
voicemail voicemail
lsmith lsmith
wilkerson wilkerson
wilkerson wilkerson
wilkerson wilkerson
faxadmin faxadmin
faxadmin faxadmin
faxadmin faxadmin
vismail vismail
aspuser aspuser
jh jh
pmartin pmartin
tammy tammy
melanie melanie
mfg mfg
dwright dwright
sharepoint sharepoint
mobile mobile
forms forms
conference conference
examroom examroom
insurance insurance
confroom confroom
archiver archiver
Production Production
restore restore
Email Email
export export
Payroll Payroll
schulung schulung
tablet tablet
temp temp
cci cci
michele michele
jimm jimm
techsupport techsupport
exadmin exadmin
randerson randerson
ecopy ecopy
triage triage
ecopy ecopy
pool pool
jcampbell jcampbell
labcorp labcorp
jtaylor jtaylor
dmartin dmartin
markd markd
rsvp rsvp
beadmin beadmin
ataylor ataylor
police police
backup backup
template template
presentation presentation
setup setup
jeffm jeffm
spiceworks spiceworks
labcorp labcorp
croom croom
vorlage vorlage
summit summit
exchange exchange
user2 user2
corpconf corpconf
exadmin exadmin
rrobinson rrobinson
tserver tserver
faxes faxes
faxes faxes
cmm cmm
west west
shipping shipping
SYSTRAY SYSTRAY
scanuser scanuser
besadmin besadmin
davidm davidm
labcorp labcorp
cnc cnc
faxes faxes
faxes faxes
assist assist
toshiba toshiba
labcorp labcorp
exadmin exadmin
tadmin tadmin
resumes resumes
resumes resumes
scan1 scan1
shipping shipping
adminsch adminsch
exchangeadmin exchangeadmin
debbie debbie
edi edi
kate kate
exam exam
exam2 exam2
workstation2 workstation2
trainer2 trainer2
scanner scanner
cs cs
books books
katie katie
Chief Chief
ricoh ricoh
konica konica
laurie laurie
classroom classroom
pt pt
mill mill
staff2 staff2
research research
frontdesk frontdesk
dispatch2 dispatch2
pete pete
smiller smiller
Office Office
conference conference
bookkeeper bookkeeper
sales1 sales1
router router
user1 user1
fax fax
exchadmin exchadmin
stacy stacy
oncall oncall
postgres postgres
toolroom toolroom
backups backups
ricoh ricoh
confroom confroom
production production
jake jake
kitchen kitchen
client2 client2
archive archive
ws ws
delia delia
qbdataserviceuser qbdataserviceuser
brac brac
spd spd
sonicwall sonicwall
rec rec
itadmin itadmin
pack pack
volunteer volunteer
mail mail
printer printer
south south
testing testing
testing testing
parts parts
conferenceroom conferenceroom
voicemail voicemail
reports reports
parts parts
voicemail voicemail
shipping shipping
scanner scanner
training training
watchdog watchdog
amanda amanda
user4 user4
student1 student1
lo lo
jackie jackie
scan scan
classroom classroom
client1 client1
client1 client1

If you’ve read this far, I hope it’s clear by now that the easiest way to get your systems hacked using RDP is to pick crappy credentials. Unfortunately, far too many organizations that end up for sale on services like this one are there because they outsourced their tech support to some third-party company that engages in this sort of sloppy security. Fortunately, a quick external port scan of your organization’s Internet address ranges should tell you if any RDP-equipped systems are enabled. Here are a few more tips on locking down RDP installations.

Readers who liked this story may also enjoy this piece — Service Sells Access to Fortune 500 Firms — which examined a similar service for selling hacked RDP systems.

 

 

 

 

575 total views, no views today

Bypassing Seagate ATA Security Lock

Standard

From: http://feedproxy.google.com/~r/hackaday/LgoM/~3/2sk-aqNfkZ0/


Bypassing Seagate ATA Security Lock

November 29, 2013 by  15 Comments

seagate

Here’s a common story when it comes to password retrieval: guy sets up a PC, and being very security-conscious, puts a password on his Seagate hard drive. Fast forward a few months, and the password is, of course, forgotten. Hard drive gets shuffled around between a few ‘computer experts’ in an attempt to solve the problem, and eventually winds up on [blacklotus89]‘s workbench. Here’s how he solved this problem.

What followed is a walk down Hackaday posts from years ago. [blacklotus] originally foundone of our posts regarding the ATA password lock on a hard drive. After downloading the required tool, he found it only worked on WD hard drives, and not the Seagate sitting lifeless on his desk. Another Hackaday post proved to be more promising. By accessing the hard drive controller’s serial port, [blacklotus] was able to see the first few lines of the memory and the buffer.

Two hours and two Python scripts later, [blacklotus] was able to dump the contents of his drive. He then took another Seagate drive, locked it, dumped it, and analyzed the data coming from this new locked drive. He found his old password and used the same method to look for the password on the old, previously impenetrable drive. It turns out the password for the old drive was set to ’0000′, an apparently highly secure password.

In going through a few forums, [blacklotus] found a lot of people asking for help with the same problem, and a lot of replies saying. ‘we don’t know if this hard drive is yours so we can’t help you.’ It appears those code junkies didn’t know how to unlock a hard drive ether, so [blacklotus] put all his tools up on GitHub. Great work, and something that didn’t end up as a Hackaday Fail of the Week as [blacklotus] originally expected.

461 total views, no views today