Серверная. Драма в трёх днях

Электрики: А давайте 1 января ебанём основное питание, фидеры переделать. А хули предупреждать кого-то, все ж отдыхают на каникулах
Бесперебойники: Бля, а с такой нагрузкой мы даже 20 минут не обещаем продержаться
Стойки, с 8 гипервизорами и  с двумя СХД: Эээ, бля, стопэ, какие 20 минут, у нас тут больше полусотни контейнеров, погасить в правильном порядке не успеем
Бесперебойники от СХД: А похуй, отключаемся.
СХД: бля. (отключаются)
Гипервизоры: Бля, а куда контейнеры-то сохранять? Ждём возврата СХД
Бесперебойники гипервизоров: Авотхуй. Отключаемся.
Гипервизоры: Бля! (дохнут)
Электрики, через два дня ебли с фидерами: Фидеры заменены, включаем
Бесперебойники: Ну наконец-то! Питаем стойки
СХД: Бля, у нас тут контрольные суммы не сходятся после отвала питания. Давай проведём полную проверку томов
Гипервизоры: А где наши файловые контейнеры? Нету? Ну так повисим
Бухгалтерия, 3 числа: Эээ, а где интернет с котиками и наша 1Ска?

Морали не будет.

Урок забытого искусства

…. Они сидели на полу, прижавшись друг к другу, освещаемые только светом луны и подрагивающим пламенем свечи. Тихие голоса было бы сложно разобрать постороннему, но их было только двое, объединённых одной тайной, бьющимися в унисон сердцами и одним дыханием на двоих. 
— Попробуй, это не страшно — сказал Он, поднося бокал с густой, тёмной жидкостью к Её губам.
— Но ведь это изменит меня?
— Изменит. Но и даст много нового. Силу, уверенность, спокойствие и знание. Лишь так можно познать себя, открыть новые ощущения, придать остроту старым.
— Но ведь так не бывает?
— Бывает. Почти все забыли о магии, доступной ранее каждому. Невероятной, сильной и опасной. 
Она взяла предложеный бокал и сделала глоток. 
— Как странно. Чуть солоноватый вкус…
Ещё глоток.
— И всё же, что это даёт?
— Всё, что я перечислил. И всё остальное, что ты даже пока боялась себе вообразить.
Ещё глоток. Всё ещё с опаской, но в глазах уже затаились новые искорки.
— Что же?
— Свободу. Кровь даёт свободу. Всё остальное мы берём сами. Например, как сейчас.
Он осторожно целует Её в губы, слизывая застывшие капельки.
— И тебе ни капельки не больно?
— Больно. Но что значит боль в сравнении с радостью делиться знаниями с теми, кто нам дорог?
— Я понимаю. А теперь позволь мне перевязать твою ладонь…

Ветер..

Весенний ветер вкрадывался в души,
давал советы, поселял сомненья.
Что, мол, весна всему научит
и обязательно подарит вдохновенье…
Но мы идём, слепой судьбе покорны,
вперёд, туда, куда глядят глаза,
храня привычки все упорно,
и отводя всё время взгляд назад —
туда, где было всё знакомо,
где всё годами было в лад…
Привычно, даже умиротворённо…
И знаем ведь, что нет пути назад.
Что все мосты давно сгорели
в тот самый миг, как сделан шаг
в тот мир, где солнечно сияют ели,
где сказка правит бесконечный бал
среди зимы, волшебно сочетаясь с летом,
где не случится никакой обвал
и чувства все острей при этом…

Interfaces aggregation in FreeBSD

Way to make my laptop happy with interface aggregation. Now i don’t need to remember, which connection i should use at home, at office, at many other places — I have only one interface with dhcp client enabled.

Physical layer will me selected automagically, when presents

Receipe was stolen from PC-BSD-8.1-Beta1

#Auto-Enabled NICs with interfaces aggregation

wlans_ath0="wlan0" # wlan(4) interfaces for ath0 device

ifconfig_jme0="up"

ifconfig_ath0="`ifconfig jme0 ether`"

ifconfig_ath0="ether ${ifconfig_ath0##*ether }"

cloned_interfaces="lagg0"

ifconfig_lagg0="laggproto failover laggport wlan0 laggport jme0 DHCP"

ifconfig_wlan0="WPA"

background_dhclient="NO" # Start dhcp client in the background.

#background_dhclient_fxp0="YES" # Start dhcp client on fxp0 in the background.

synchronous_dhclient="YES" # Start dhclient directly on configured

# interfaces during startup.

defaultroute_delay="10" # Time to wait for a default route on a DHCP interface.

CLangBSD

Playing with CLangBSD project give me lots of fun and experience.

In base system all fine, but with ports I have some troubles

At this time some critical for me ports is unbuildable under CLangBSD:

  1. devel/binutils
  2. devel/icu[4]
  3. devel/pcre
  4. lang/ruby1[89]

Other port under investigation

However, without these ports further builds is mostly impossible

Page will be updated to reflect current status

Errors:

pcre:

mv -f .deps/pcrecpp_unittest.Tpo .deps/pcrecpp_unittest.Po

/bin/sh ./libtool --tag=CXX --mode=link /usr/local/libexec/ccache/world-c++ -O2 -pipe -fPIC -fno-strict-aliasing -o pcrecpp_unittest pcrecpp_unittest.o libpcrecpp.la

libtool: link: /usr/local/libexec/ccache/world-c++ -O2 -pipe -fPIC -fno-strict-aliasing -o .libs/pcrecpp_unittest pcrecpp_unittest.o ./.libs/libpcrecpp.so /tmp/usr/ports/devel/pcre/work/pcre-8.02/.libs/libpcre.so -Wl,-rpath -Wl,/usr/local/lib

/usr/bin/ld: .libs/pcrecpp_unittest: hidden symbol `__dso_handle' in /usr/lib/crtbegin.o is referenced by DSO

c++: error: linker command failed with exit code 1 (use -v to see invocation)

*** Error code 1

Stop in /tmp/usr/ports/devel/pcre/work/pcre-8.02.

*** Error code 1

binutils:

libtool: compile: /usr/local/libexec/ccache/world-cc -DHAVE_CONFIG_H -I. -I. -I. -I./../include -DBINDIR=\"/usr/local/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -O2 -pipe -I/usr/local/include -fno-strict-aliasing -MT opncls.lo -MD -MP -MF .deps/opncls.Tpo -c opncls.c -o opncls.o

In file included from opncls.c:1:

opncls.c:235:31: error: expression result unused [-Wunused-value]

(((nbfd)->cacheable = 1), 1);

^

1 diagnostic generated.

gmake[4]: *** [opncls.lo] Error 1

gmake[4]: Leaving directory `/tmp/usr/ports/devel/binutils/work/binutils-2.20.1/bfd'

gmake[3]: *** [all-recursive] Error 1

gmake[3]: Leaving directory `/tmp/usr/ports/devel/binutils/work/binutils-2.20.1/bfd'

gmake[2]: *** [all] Error 2

gmake[2]: Leaving directory `/tmp/usr/ports/devel/binutils/work/binutils-2.20.1/bfd'

gmake[1]: *** [all-bfd] Error 2

gmake[1]: Leaving directory `/tmp/usr/ports/devel/binutils/work/binutils-2.20.1'

gmake: *** [all] Error 2

*** Error code 1

Stop in /usr/ports/devel/binutils.

*** Error code 1

Ruby18:

usr/local/libexec/ccache/world-cc -I/usr/include -O2 -pipe -fno-strict-aliasing -std=gnu89 -fPIC -DRUBY_EXPORT -I. -I. -I/usr/include -c main.c

/usr/local/libexec/ccache/world-cc -I/usr/include -O2 -pipe -fno-strict-aliasing -std=gnu89 -fPIC -DRUBY_EXPORT -L. -rpath=/usr/lib:/usr/local/lib -pthread -rdynamic -pthread main.o libruby18-static.a -lrt -lcrypt -lm -L/usr/lib -rpath=/usr/lib:/usr/local/lib -pthread -o miniruby

./lib/fileutils.rb:1437: [BUG] unexpected local variable assignment

ruby 1.8.7 (2010-01-10 patchlevel 249) [amd64-freebsd9]

*** Signal 6

Stop in /tmp/usr/ports/lang/ruby18/work/ruby-1.8.7-p249.

*** Error code 1

icu:

/string/

---[OK] ---/string/TestString

---[OK] ---/string/TestLocalizedString

---[OK] ---/string/TestSprintfFormat

---[OK] ---/string/TestSnprintf

---[OK] ---/string/TestSScanset

---[OK] ---/string/TestStringCompatibility

---[OK] ---/string/TestBadScanfFormat

---[OK] ---/string/TestVargs

---[OK] ---/string/TestCount

/translit/

---[OK] ---/translit/ops

*** Signal 11

Stop in /usr/ports/devel/icu.

*** Error code 1

Translation of http://habrahabr.ru/blogs/infosecurity/70330/

Source codes of 3300 global Internet projects have been received

Couple of months back we (2Comrades and Anton Isajkin) had been found out the vulnerability inherent in basic big in the Internet projects (like a Rambler, the Mail, Yandex, the Opera and so forth). It was possible to get access to file structures of the famous sites (in total 3320 sites) and in some cases their full initial codes.

It would seem that it is difficult to find similar vulnerability in the XXI-st century. It seems that all is already found, and that that is not found, sits somewhere very much very deeply. It has appeared that a root of today’s harm is quite daily thing. For certain each of you sometime dealt with the monitoring system of versions SVN.

SVN is the advanced means for the organisation of joint working out of tens, and even hundreds developers. Owing to features of architecture, SVN stores in each directory of the project the metafiles accurately combined in a latent directory .svn. In one of files under the name entries there is a list of all files and the directories located in the same folder, as.svn. As there there is an information on a repository arrangement, the size of files, dates of their change and logins of the users working over the project. Not so badly, the truth? I will explain, it turns out, if the project is developed by means of SVN having glanced to the address draftcopy.ru/.svn/entries we we will see file structure of a root of the project with authors, last changes, the reference to the basic branch of a repository and so forth.

But it is possible to go and further. In the same folder.svn is директори text-base in which last versions of all files which are in a repository lie. A picture supplements as also that files have not standard expansion (for example.php) which allows to send at once them on the interpreter, and additional expansion.svn-base thanks to which the file is given to the person who has requested it «as there is», i.e. a naked initial code!

draftcopy.ru/.svn/text-base/index.php.svn-base

It is necessary to notice that the described picture is ideal and though it and was that in most cases, nevertheless the big percent of initial codes did not manage to be received for whatever reasons.

For the first time having realised that the found out vulnerability is inherent in the majority of projects last nine years, has been decided to scan completely рунет to look than there live Internet projects and to receive the interesting statistics. But before history about that as it was, it is necessary to tell to grey-haired administrators how to be protected from similar …

Protection against vulnerability

Vulnerability can be bypassed several ways. The way to a forehead — to forbid to address to metadirectories SVN on 80th port, i.e. web server means.

The decision for nginx

location ~/.svn/{

deny all;

}

Global locations in nginx is not present, therefore need to sign for everyone server areas. That the rule was valid, it is necessary to load it to others locations with regular expression. A universal way — by the first location.

The decision for Apache

<Directory ~ ".*\.svn">

Order allow, deny

Deny from all

Satisfy All

</Directory>

Here is a bit easier, we finish it in httpd.conf and on all projects under management apache reading from a directory.svn will be inaccessible.

The decision for SVN-way

Protection against vulnerability web server means — illness treatment. Any doctor will tell that preventive maintenance easier, easier and less затратней, than treatment. Therefore the best the decision will be absence of these metadirectories in a project root. To achieve it it is possible means svn export from the basic branch.

Research history

As it has already been told, it has been decided to scan all RUnet on presence of similar vulnerability. Have been lifted a proxy-server, it is written парсер and the fresh base of domains in a zone ru is received. The first version of a script worked two weeks, receiving a site behind a site in one stream. To scanning end, the base totaled more than 3000 vulnerable sites and occupied more than hundred гигабайт initial codes.

Problem of the first scanning was that were downloaded all sources without analysis, is not dependent on that, they gave 200 or 500 code, as ended a graphisc and js-scripts. And as often a web server have been adjusted to give thus 200 code even if a file on most has put was absent.

The second version of a script was already more bright, worked in some streams from two server cars and correctly distinguished codes of the answer contents of the received pages. We have bypassed all RUnet for 4 days. The base of .com was the further plans. It became obvious that at current resources detour would be executed at least for couple of years (the zone com now totals more than 700 million domains (against 2 million ru)).

To affairs excellent si-programmer Andrey Saterenko who has written a fast demon which would manage in to reduce our time expenses few times has been involved. But, unfortunately, by this moment the summer has come to an end, great load come at work. Grandiose plans it has been decided to curtail.

Before to publish openly information on vulnerability, it was necessary to warn all victims. First of all letters have been dispatched giants (yandex.ru, rambler.ru, mail.ru, opera.com, rbc.ru, 003.ru, bolero.ru, habrahabr.ru, total 19 addresses), then, at today’s night, letters have received the others 3000 + sites.

Release of this article has been detained by expectation while opera.com will close vulnerability on all servers.

It is a little statistics:

Scanned domains: 2253388

The vulnerable: 3320

Statisticans under notifications while are not present, it will be possible is published in couple of weeks. From large portals, six have answered. Yandex has appeared the most operative, having sent the reciprocal letter at night on Sunday. Ten projects have not reacted in any way to our letters, three projects have closed vulnerability without having thanked.

We not vindictive, we will write down their names …

Some the interesting facts:

Cybersqwatters have grown fond SVN, as well as optimizers;

Uniform CSS for calendars by Yandex gathers from ten CSS by $make from the console 0_0;

On Rambler projects use Yandex services 0_0, files of "domain acknowledgement» for Yandex services are found;

RBC uses both Yandex and Google services and very much love "difficult" passwords;

The opera respects MySQL, but a site at them on naked html with real directories and subdirectories;

The blonde respects CodeIgniter;

PostgreSQL respect a cursor wikimedia => PostgreSQL respect MySQL 😉

All projects of Futuriko (and Lepra) are written on perl.

Order of 10 sites with words in the type domain «hack» and «secure» are vulnerable;

Many are assured that naming a directory with phpmyadmin approximately «__ xpma123uff __» but having kept the password in a config, => it is a "good" protection;

Many store till now configs in inc files, without expansion.php which open as the text in a browser.

For you tried 2Comrades (mobilz) and Anton Isajkin (oowl, twi).

We are ready to cooperation 😉

P.S. In avoidance of conflicts all initial codes received for time of research were printed and are burnt 🙂

P.S.S. Two points:

All who could suffer, have received preventions of vulnerability with exact date of promulgation in advance.

No initial codes under no circumstances will be published or sold. It is not necessary to write to us about it.

P.P.P.S. Thanks for assistance to Habra-user oowl.

P.P.P.P.S. Any sources the most search mechanism of Yandex it has not been received, roots a web of a muzzle of some resources however have been received. Imposition, xmlapi, xsl templates….. Anything serious, unless all addresses of repositories, logins of developers and so on.

Igor Sysoyev, the leading system administrator of the company a Rambler, the developer of a web server known for the ease nginx has answered pair our questions:

Q: why at once so much known projects have neglected such elementary possibility of leak?

A: the Reasons, I think, much — someone considers that in .svn all lies the same, accessible and without .svn. Someone, probably, simply did not know or has forgotten about .svn.

Q: whether It is planned to bring in nginx possibility globally перенаправлять URL (to the instruction server that it was possible to block at once at adjustment potentially dangerous addresses)?

A: No. I consider that global options finally lead to a configuration which is more difficult for accompanying each time all.

Huawei e1550 + FreeBSD

[some lyrics about little choice skipped]

Setup of Huawei e1550.

kernel modules:

kldload ucom

kldload u3g

dmesg will shows something like this:

ugen0.2: at usbus0

umass0: on usbus0

umass0: SCSI over Bulk-Only; quirks = 0x0000

umass0:2:0:-1: Attached to scbus2

umass1: on usbus0

umass1: SCSI over Bulk-Only; quirks = 0x0000

(probe0:umass-sim0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0

(probe0:umass-sim0:0:0:0): CAM Status: SCSI Status Error

(probe0:umass-sim0:0:0:0): SCSI Status: Check Condition

(probe0:umass-sim0:0:0:0): NOT READY asc:3a,0

(probe0:umass-sim0:0:0:0): Medium not present

(probe0:umass-sim0:0:0:0): Unretryable error

cd1 at umass-sim0 bus 0 scbus2 target 0 lun 0

cd1: Removable CD-ROM SCSI-2 device

cd1: 1.000MB/s transfers

cd1: Attempt to query device size failed: NOT READY, Medium not present

……..

So we have devices cd1 (with linux/windows drivers) and da0 (it’s a micro-sd card reader)

u3g module still lacks of support this modem, so we need to get sources of usb_modeswitch from http://www.draisberghof.de/usb_modeswitch

Unpack, make clean & make.

Copy usb_modeswitch.conf to /etc/, and need to uncomment string related to.

Run of usb_modeswitch leads to activate modem device, ls /dev/ shows us two devices, ttyU0.0 и ttyU0.1 (for me, your device names may me differ by numbers).

To make use of modem easier, needs to add some config to /etc/devd.conf to provide authomatic handling

Code to add to devd.conf:

attach 100 {

device-name "ugen[0-9]+";

match "vendor" "0x12d1";

match "product" "0x1446";

action "/usr/local/bin/usb_modeswitch";

};

And don’t forget to do ‘cp usb_modeswitch /usr/local/bin’

Also this modem support mode switching by AT commands:

AT^U2DIAG=0 (modem only)

AT^U2DIAG=1 (modem + CD-ROM)

AT^U2DIAG=255 (modem + CD-ROM + Card Reader)

AT^U2DIAG=256 (modem + Card Reader, may use as usual flash drive after decline modem drivers setup)

So any can write own script to start usb_modeswitch and send needed command to /dev/tyyUx.y in one click

Test run of xorg75 on my laptop

Yep, it runs smoothly and fast, and only one problem — with my ATI Radeon Mobility x2300 (RV550/M64) radeonhd driver caused coredumps of xserver, radeon (ati) works fast with exa acceleration, but with some visual glitches on windows headers and with compositing enabled. Hope, with new drivers all should be fine. At least, I want to try git snapshots of both drivers