| OpenVAS 4.x/5.x from SVN source |
[Aug. 23rd, 2011|05:06 pm] |
Didn't see any around. so here are my notes. Build instructions for Debian and ubuntu. Assuming pcap, libc, gcc are already installed.
build libraries first:
cd openvas-libraries apt-get install uuid-dev apt-get install libgpgme11-dev libgpg-error-dev apt-get install gnupg2 apt-get install libssh-dev libglib2.0-dev apt-get install cmake apt-get install gnutls-doc apt-get install gnutls-bin apt-get install libgnutls-dev apt-get install libssh2-1-dev libssh-4 apt-get install libssh2-1-dev libssh-4 apt-get install libwxfgtk2.8-dev rm CMakeCache.txt cmake . make make doc && make doc-full && make install ldconfig
build scanner:
cd openvas-scanner cmake . make make doc && make doc-full && make install openvas-mkcert
get plugins:
openvas-nvt-sync
build manager:
cd openvas-manager apt-get install libsqlite3-dev apt-get install xmltoman apt-get install sqlfairy apt-get install xsltproc export PKG_CONFIG_PATH=/usr/share/pkgconfig cmake . make && make doc && make doc-full && sudo make install openvas-mkcert-client -n om -i
build administrator:
cd openvas-administrator cmake . && make && make doc && sudo make install
build GSA:
cd gsa apt-get install libmicrohttpd-dev libxslt1-dev make && make doc && sudo make install
build CLI: (optional)
cmake . make && make doc && sudo make install
build GSD: (optional)
apt-get install qt4-dev-tools qt4-cmake cmake . make && make doc && sudo make install |
|
|
| socket proxy in erlang |
[Mar. 16th, 2011|10:06 am] |
Since I started spitting out some code here, here's another thing I've been playing recently. Erlang. For kicks, I decided to implement a socket proxy/connection bouncer. The erlang socket programming model is slightly different from the ones we used to in python/c/perl/... so here is the piece (docs and original example here: http://www.erlang.org/doc/man/gen_tcp.html
Interesting things to pay attention on:
you are only going to get data via messages (receive statement) if you use active socket. w/ passive socket you'll have to fetch it with recv.
{packet,0} - means you're getting raw data. it is also possible to request for pre-packaged data (see avail. options at http://www.erlang.org/doc/man/inet.html#setopts-2).
Anyways,
1-2:erl fygrave$ cat socket_proxy.erl
-module(socket_proxy).
-export([
start/4,
server/3,
process/1,
loop/2
]).
%
% once compiled, start it like socket_proxy:start(20, 1222, "somehost", 22).
%
start(Num,LPort, Host, DPort) ->
case gen_tcp:listen(LPort,[{active, true},{packet,0}]) of
{ok, ListenSock} ->
start_servers(Num,ListenSock, Host, DPort),
{ok, Port} = inet:port(ListenSock),
Port;
{error,Reason} ->
{error,Reason}
end.
start_servers(0,_, _, _) ->
ok;
start_servers(Num,LS, Host, DPort) ->
spawn(?MODULE,server,[LS, Host, DPort]),
start_servers(Num-1,LS, Host, DPort).
server(LS, Host, DPort) ->
io:format("Server started ~n"),
case gen_tcp:accept(LS) of
{ok,S} ->
io:format("Got connect ~n"),
case gen_tcp:connect(Host, DPort,
[binary,
{packet,0},
{active, true}
]
) of
{ok, Socket} ->
loop(S,Socket),
server(LS,Host, DPort);
E ->
io:format("Error:Connect failed!~n"),
E
end,
ok;
Other ->
io:format("Error: accept returned ~w - finita!~n",[Other]),
ok
end.
loop(S,Socket) ->
inet:setopts(S,[{active,once}]),
receive
{tcp,S,Data} ->
io:format("Received tcp ~p ~n",[Data]),
Ret = process(Data), % you can poke around with the data
gen_tcp:send(Socket,Ret),
loop(S, Socket); % erlang awesomeness. no loops ;)
{tcp,Socket,Data} ->
io:format("Received tcp(S) ~p ~n", [Data]),
Ret = process(Data),
gen_tcp:send(S, Ret),
loop(S,Socket);
{tcp_closed,S} ->
gen_tcp:close(Socket),
io:format("Socket ~w closed [~w]~n",[S,self()]),
ok;
{tcp_closed, Socket}->
gen_tcp:close(S),
io:format("Socket (S) ~w closed [~w]~n",[S,self()]),
ok
end.
process(Data) ->
io:format("Process data: ~p ~n", [ Data]),
Data.
blah. time for stress-test ;) |
|
|
| Chunked decoding in python |
[Mar. 15th, 2011|05:07 pm] |
I haven't been able to find any short and quick method of decoding "chunked-encoding" encoded data in python without whacking 3rd party libraries, so here is my bet: (chunked content encoding explained here: http://www.faqs.org/rfcs/rfc2616.html)
assuming that data contains raw http response. Code simplified for readability
def decode_chunked(data):
offset = 0
encdata = ''
newdata = ''
offset = string.index(data, "\r\n\r\n") + 4 # get the offset
# of the data payload. you can also parse content-length header as well.
encdata =data[offset:]
try:
while (encdata != ''):
off = int(encdata[:string.index(encdata,"\r\n")],16)
if off == 0:
break
encdata = encdata[string.index(encdata,"\r\n") + 2:]
newdata = "%s%s" % (newdata, encdata[:off])
encdata = encdata[off+2:]
except:
line = traceback.format_exc()
print "Exception! %s" %line # probably indexes are wrong
return newdata
for php version look here:
http://www.codingforums.com/showthread.php?t=147061 |
|
|
| (no subject) |
[Apr. 8th, 2010|12:07 am] |
|
Everyone knows that Kyrgyz Internet magically went down when the whole revolutinary mess, purchased by north american or russian democrats, kicked off. Makes me thinking: we should build a p2p-ble framework for twitter/file and video swaps. so as long as there are bytes that could make it from one network to another, the network would be communicable. This sort of explains why skype survived while everything else went down. Due to p2p nature of skype it is extremely difficult to block |
|
|
| Refused US visa. 2 times |
[Feb. 5th, 2010|11:33 pm] |
|
What's wrong with all those dudes sitting in embassy I wonder!! I have 1 week-short business trip planned. I have all the invitation letters and flights in place. full time employed, coming with all these papers to the embassy just to waste 10,000NT going into pockets of American political system and 20 minutes of fruiteless conversation with some iron-headed crook. ughhh... |
|
|
| (no subject) |
[Jan. 8th, 2010|05:39 pm] |
now this is funny :) ripped off from some chain letter. "A foreigner decides to start learning chinese. on the first class he gets list of words for 'wife' and 'husband'. here's the list ;-) (use translate.google.com if you want to find the actual meaning :))
Wife =
1妻子, 2老婆, 3太太, 4夫人, 5老伴, 6愛人, 7內人, 8媳婦, 9那口子, 10拙荊, 11賢內助, 12對象, 13孩他媽, 14孩他娘, 15內子, 16婆娘, 17糟糠, 18娃他娘, 19崽他娘, 20山妻, 21賤內, 22賤荊, 23女人, 24馬子, 25主婦, 26女主人, 27財政部長, 28紀檢委, 29渾人, 30娘子, 31屋裏的, 32另一半, 33女當家, 34渾家, 35髮妻, 36堂客, 37婆姨, 38領導, 39燒火婆, 40黃臉婆
Husband = 1,丈夫 2,愛人 3,那口子 4,當家的 5,掌櫃的 6,不正經的 7,潑皮 8,不爭氣的 9,沒出息的 10,該死的 11,死鬼 12,死人 13,傻子 14,臭不要臉的 15,孩子他爹 16,孩子他親爹 17,哎 18,老公 19,豬 20,親愛的 21,先生 22,官人 23,相公 24,大人 25,挨千刀的 26,老伴 27,男客
|
|
|
| (no subject) |
[Nov. 27th, 2009|12:53 pm] |
I haven't been writing much recently, and the reason pretty much is that I've been extensively traveling all around the old world and west indies uh.... tiring :) Anyway, the places worth mentioning: 1. Barcelona - Pretty crazy place. Messy, instane, tolerrant. Imagine drunk geeks taking their pants down while hopping over the metro fenses. This would definetely get you in trouble in Taipei, or even Moscow. Not in Barcelona apparently. Not to mention the fact that walking naked is legal there. And I've seen the proof. Search for "naked man of barcelona", a pretty pretty sight. Anyway, a few other random facts about the place - people are friendly, many speak english. many do not. people get more friendly as they get intoxicated. They love public holidays in Barcelona, every of my two visits to the city, I'd hit one. Swimming naked at 3AM could be a good hobby. People randomly share illigal substances on the streets. There are quite a bit of artsy-fancy places, which are fun to visit.. drinking in darkest corners could be very amusing thing to do. Lots of youngsters actually live in squats, even if coming from wealthy families. this seems to be sort of new thrend over there. Sleeping in airport is actually ok only until 4.30AM, thats when they turn all the lights on and security guard is coming over to give you a "morning call"...
2. North India, New Delhi and suburbs - that wasn't my first trip to India, but I think every time I go, I just love that place for some reason. You have to get through the odd feeling of seeing poverty and luxury at the same place. Chaos and order. Mix of all kind of crazy thing, ideas, philosophies and beliefs. Oh.. trucks! all road trucks apparently are hand-painted.. and highways, you could actually ride a bycicle on the highway!! and walk!!! Cows - they are everywhere, every street corner probably! I think that was the largest variety of cow-like animals I've seen in my life. And monkeys on piles of trash! Someone mentioned to me that they were part time workers at garbage separation section. And dogs - I thought thailand had too many street dogs, what I've seen in Delhi was at least tippled; Food - If i continue traveling to India, expect me to weight at least 100 kilos by the end of next year! :) Every time I am there, I just can't stop tasting local flavours! and the crazy variety - even if you take a bite of each thing, you are going to end up overeating every your meal. and spices.... every time I am coming back - any other food tastes like nothing, unless you just pour pure chilli into that, oh well. India! :)
Я не пишу многое последнее время, и причина в том, что я почти широко путешествовали по всему старому миру и Вест-Индии .... Uh утомительно:) Во всяком случае, местa, которые стоит упомянуть: 1. Барселона - вздорнoе место. Беспорядочный kaffardak. Fffobrazite пьяныx вундеркиндов cнимая свои штаны вниз, i а перескока метро низинные болота. Определенно, это будет вам в беду в Тайбэе, и даже Москwe. Не в Барселоне видимо. Не говоря уже о том, что ходьба golyshom является законным там. И я видел доказательства. Ищите "голый мужчина, Барселона, очень красивое зрелище. Во всяком случае, несколько других случайных фактов о месте - люди дружелюбные, многие говорят на английском. не все. людям получить более дружественным, поскольку они получают в состоянии опьянения. Они любят праздничные дни в Барселоне, каждый из двух моих визитов в город, я ударил одного. Плавательnie голyshem в 3 утра, было бы хорошей хобби. Доля случайных прохожих на улицах незаконный веществ. Есть немало претенциозный Fansy мест, которые интересно визитом .. пить в темных углах может быть очень забавная вещь. Многие молодые фактически живут в приседаний, даже если Исходя из богатых семей. это, кажется, быть своего рода новый moda там. Спящий в аэропорту действительно ОК только до 4:30, ffot, когда они обращаются все фары и охраннику приходит к вам "Утренний звонок" ... 2. Северная Индия, Дели и пригородам - это была не первая моя поездка в Индию, но я думаю, каждый раз я иду, я просто люблю это место по некоторым причинам. Вы должны пройти через странное чувство виде нищеты и роскоши в том же месте. Хаос и порядок. Сочетание всех видов сумасшедшая вещь, идей, философий и верований. Oh .. грузовики! видимо все дорожные грузовики раскрашены вручную .. и автомобильных дорог, вы фактически можете ездить на велосипеде по шоссе! и ходи! Коровы - они везде, наверное каждом углу! Я думаю, что было наибольшим разнообразием корову, как животные я видел в своей жизни. И обезьяны на кучах мусора! Кто-то сказал мне, что они были рабочими часть времени мусор раздел разделения. А собаки - Я думал, ff Таиланде было слишком много собак улице, что я видел в Дели была по крайней мере напиток; Еда - Если я буду продолжать путешествие в Индию, чтобы я весом не менее 100 килограммов до конца следующего года! :) Каждый раз, когда я там, я просто не могу остановиться дегустацией местных вкус! и Crazy разновидности - Даже если вы возьмете укуса каждая вещь, вы собираетесь в конечном итоге переедание каждого приема пищи ваше. и специй .... каждый раз, когда я возвращаюсь - любые другие вкусы продовольствие, как ничто, если вы только что налить в чистом чили, ой хорошо. Индия! :)
ffobshem vse ponyali chto chukcha ne pisatel', chukcha chitatel' ;-) |
|
|
| navigation |
| [ |
viewing |
| |
most recent entries |
] |
| [ |
go |
| |
earlier |
] |
| |
|
|