Tuesday, September 29, 2009

awk

Why are people from China trying to login to my computer? I don't understand....

for i in `cat auth.log.1 | awk '{print $13}'|sort -n |uniq`; do whois $i |grep person; done
person: Chyi-Chuan Yang
person: Seednet Seednet
person: Haibo Ma
person: Ruixin Wang
person: Haibo Ma
person: Ruixin Wang
person: ChinaUnicom Hostmaster
person: Wei Wang

Trying to 0wn me

Failed password for invalid user mike from 85.62.95.198 port 40533
Failed password for invalid user mysql from 85.62.95.198 port 41292
Failed password for invalid user mythtv from 85.62.95.198 port 42027
Failed password for invalid user gnax from 85.62.95.198 port 47769
Failed password for invalid user mythtv from 85.62.95.198 port 49950
Failed password for invalid user upload from 85.62.95.198 port 51456
Failed password for invalid user status from 85.62.95.198 port 52202
Failed password for invalid user tomcat from 85.62.95.198 port 53781
Failed password for invalid user postgres from 85.62.95.198 port 54544
Failed password for invalid user anonymous from 85.62.95.198 port 55321
Failed password for invalid user worker from 85.62.95.198 port 56021
Failed password for invalid user craig from 85.62.95.198 port 56758
Failed password for invalid user webmaster from 85.62.95.198 port 57497
Failed password for invalid user user from 85.62.95.198 port 58246
Failed password for invalid user michael from 85.62.95.198 port 60504
Failed password for invalid user short from 85.62.95.198 port 33060
Failed password for invalid user admin from 85.62.95.198 port 33801
Failed password for invalid user music from 85.62.95.198 port 35241
Failed password for invalid user jessie from 85.62.95.198 port 35947
Failed password for invalid user notes from 85.62.95.198 port 36718
Failed password for invalid user turbo from 85.62.95.198 port 55037
Failed password for invalid user usuario from 85.62.95.198 port 55729
Failed password for invalid user spamfiltrer from 85.62.95.198 port 56512
Failed password for invalid user elite from 85.62.95.198 port 57211
Failed password for invalid user ftpuser from 85.62.95.198 port 57898
Failed password for invalid user radmin from 85.62.95.198 port 58659
Failed password for invalid user portal from 85.62.95.198 port 59417
Failed password for invalid user master from 85.62.95.198 port 60089
Failed password for invalid user sales from 85.62.95.198 port 60874
Failed password for invalid user util1 from 85.62.95.198 port 33436
Failed password for invalid user anthony from 85.62.95.198 port 34209
Failed password for invalid user oracle from 204.124.181.80 port 32963
Failed password for invalid user test from 204.124.181.80 port 33883
Failed password for invalid user eaguilar from 121.14.34.52 port 44125
Failed password for invalid user apple from 60.190.176.116 port 51325
Failed password for invalid user brian from 60.190.176.116 port 52237
Failed password for invalid user andrew from 60.190.176.116 port 53219
Failed password for invalid user newsroom from 60.190.176.116 port 54180
Failed password for invalid user magazine from 60.190.176.116 port 55126
Failed password for invalid user research from 60.190.176.116 port 56079
Failed password for invalid user cjohnson from 60.190.176.116 port 56972
Failed password for invalid user export from 60.190.176.116 port 57777
Failed password for invalid user photo from 60.190.176.116 port 32797
Failed password for invalid user gast from 60.190.176.116 port 35433
Failed password for invalid user murray from 60.190.176.116 port 38639
Failed password for invalid user falcon from 60.190.176.116 port 41879
Failed password for invalid user fly from 60.190.176.116 port 48042
Failed password for invalid user gerry from 60.190.176.116 port 51152
Failed password for invalid user guest from 60.190.176.116 port 33465
Failed password for invalid user test from 60.190.176.116 port 35047
Failed password for invalid user test1 from 60.190.176.116 port 36141
Failed password for invalid user teste from 60.190.176.116 port 37737
Failed password for invalid user admin from 60.190.176.116 port 39225
Failed password for invalid user postgres from 60.190.176.116 port 40829
Failed password for invalid user webmaster from 60.190.176.116 port 43524
Failed password for invalid user web from 60.190.176.116 port 45115
Failed password for invalid user http from 60.190.176.116 port 46528
Failed password for invalid user httpd from 60.190.176.116 port 48114
Failed password for invalid user www from 60.190.176.116 port 49698
Failed password for invalid user www1 from 60.190.176.116 port 51203
Failed password for invalid user ftp from 60.190.176.116 port 55250

Monday, September 21, 2009

using the old msvcrt runtime with visual studio 2005

If you are trying to run an .exe built with vs2005 on other than the box you built it with you might get an error saying that msvcrt80.dll is missing. This is because msvcrt.lib points you to the multithreaded import library for MSVCR7/8/90.DLL.

Microsoft says this about msvcrt.dll:
The msvcrt.dll is now a "known DLL," meaning that it is a system component owned and built by Windows. It is intended for future use only by system-level components. (and their own software like windbg)

Here's the breakout of which libraries cause which runtime dll to be imported:
e.g. MSVCRT.LIB == MSVCRT.DLL with Visual Studio 5/6, MSVCR7.DLL with Visual Studio 2002/2003 and MSVCR80/90.DLL with Visual Studio 2005/2008.

Well it goes in the face of logic to force someone to carry around all these DLLS. So the solution is to build one that relies on the lowest common denominator: MSVCRT.DLL

The trick to ensuring that your .exe uses this dll is by using the MSVCRT.LIB that comes with the DDK. Add this line to your Property Pages->Linker->General->Additional Library Directories
"C:\WINDDK\6001.18001\lib\crt\i386" -or- whereever your DDK is installed
You also need to link with msvcrt_win2000.obj

Now clean and recompile. You should now be able to run your exe on any box without the missing DLL error. (Assuming you don't use some feature that is _ONLY_ in the more modern DLL)