Pages

19 April 2013

ZPanel Code Execution

Hi all, There's an arbitrary (PHP) code execution in ZPanel, a free and open-source shared hosting control panel. Using the included zsudo binary, access can be escalated and commands can be run as root. The vulnerability : ZPanel uses a poor "templater" system that basically consists of a few str_replace calls and an eval... and as could be expected from something like this, it does a very poor job at preventing malicious code. The relevant code can be seen here : https://github.com/bobsta63/zpanelx/blob/master/dryden/ui/templateparser.class.php (note the poor attempt at stripping out tags). By effectively injecting the replacement that occurs in line 71, one can run arbitrary PHP code. When combined with ZPanels `zsudo` binary, one can execute arbitrary commands as root, with a maximum of 5 additional arguments (aside from the path to the to-be-executed-command). The scope: Custom templates/themes can be uploaded by resellers and administrators. This effectively means that anyone that can get access to a reseller account through any means, including by purchasing a reseller service from a ZPanel-using host, can gain root access, without detection. PoC : Insert the following code anywhere in master.ztml or any other template that is parsed by the template parser, replacing 'touch derp' with any command of choice : <& bogus']; exec("/etc/zpanel/panel/bin/zsudo touch /root/derp"); echo $value['bogus &> Strangely, login.ztml does not appear to use the templater, and seems to allow PHP execution by simply using tags (which I would consider a vulnerability in itself, but that aside). Vendor notification: I have warned the ZPanel development team about their insecure templater *months* ago, and explicitly pointed out that their "PHP code filtering" was not going to work well. I have submitted a patch for some other fixable aspects of the templater (which was merged into the main repository), but the development team insisted that the security in the templater was fine, and that it wasn't a problem, basically telling me that they were not going to change it. They have not fixed this vulnerability, nor do they appear to have any interest in doing so in the near future. How to solve it: Either remove the reseller template uploading functionality (this would impair core functionality), or use a real templating engine that does not use a few str_replace() calls strung together in front of an eval(). I'm quite new to this list, and not exactly a pentesting expert, so if I left out some important information in the above message, please do let me know. - Sven Slootweg
Baca Selengkapnya... ZPanel Code Execution

18 April 2013

Samsung Developer Competition 2013

Samsung menggelar rangkaian acara Samsung Developer Competition 2013. Sebuah acara untuk menjembatani pemain di industri mobile, ahli di bidang produk mobile dan juga para pengembang aplikasi. Tujuannya adalah agar para pengembang bisa melihat apa saja kebutuhan industri yang bisa dipenuhi dengan aplikasi mobile.

Acara kompetisi ini telah dimulai dengan rangkaian workshop dan seminar ke berbagai kampus. Untuk gelaran pertama telah dilaksanakan di Universitas Indonesia pada tanggal 2 – 4 April 2013 dan dilanjutkan ke Universitas Bina Nusantara 8 – 10 April 2013. Workshop selanjutnya akan diadakan pada tanggal 24 – 26 April 2013 di Universitas Budi Luhur. 

Ajang kompetisi aplikasi Samsung ini terbuka bagi semua kalangan pengembang aplikasi, baik yang pemula, menengah atau yang sudah profesional. Aplikasi-aplikasi yang dilombakan akan difilter melalui tiga kategori: lifestyle, health dan social. Tidak hanya itu, masing-masing kategori akan didukung oleh pemain besar di industri, seperti kategori lifestyle yang didukung Mitra Adi Perkasa (MAP), kategori health yang didukung Nutrifood dan kategori sosial yang akan didukung oleh PNPM (Program Nasional Pemberdayaan Masyarakat). 

Samsung menyiapkan 30 Paket hadiah, masing-masing uang senilai 2,5 juta rupiah dan 1 Galaxy Tab 10.1″, untuk 30 finalis (10 aplikasi terbaik di setiap kategori). Selain itu, Juara pertama juga akan mendapatkan uang tunai sebesar 25 juta rupiah dan 3 perangkat terbaru Samsung, diikuti juara kedua mendapatkan uang tunai 15 juta rupiah dan 2 perangkat terbaru samsung serta juara ketiga mendapatkan uang tunai 10 juta rupiah dan 1 perangkat terbaru Samsung.

Untuk pendaftaran kompetisi bisa menuju Tautan ini. Sedangkan informasi jadwal workshop yang akan di gelar di kota, Bandung, Surabaya, Yogyakarta dan Malang akan diumumkan kemudian. Tunggu informasi selanjutnya di Trenologi. 

Sumber :

http://techne.dailysocial.net/sdc/

http://www.trenologi.com/2013041613745/siap-siap-workshop-samsung-developer-competition-2013-digelar/
Baca Selengkapnya... Samsung Developer Competition 2013

30 March 2013

Analisa tentang Tools Adwind ( Adwind Web Fake ) yang berbentuk *.jar


Saya kurang begitu tau tentang kapan dan dimana pertama kali software ini di Release.

pertama kali saya mendengar software ini dr teman yang namanya tidak bisa saya sebutkan. Teman saya bertanya

MyFriends : man, lo udah tau belum tentang soft "Adwind Web Fake"?


Me : wew, itu tools apa kk???


MyFriends : Tools itu semacam tools untuk membuat web Fake dimana Attacker dapat memalsukan alamat website dan attacker juga bisa menambahkan beberapa 

command/perintah tertentu untuk melakukan injeksi ke pc Target yg akan melakukan klik terhadap link yg telah kita palsukan.



Me : wah toolsnya keren yah ^_^

MyFriends : Iya sih keren tp pas gw scan di virustotal.com 

https://www.virustotal.com/en/file/10f09d04b8f1ffa17cf8e04c171589700de0f79b51a36c7c653c980d656e151e/analysis/1364582104/

hasilnya malah mengandung virus semua hakhakhakhak...99x


Me : wkwowkwowkwowkwwkwkw,...yg mana sih toolsnya coba liat. gw penasaran.

MyFriends : nih linknya http://uppit.com/15iuehf89idu/adwind_web_fake.zip 

coba lu bongkar kali ajah lo nemu harta karun di dalam hakhakhakhak...99x

Me : Ibih,...boro² harta karun yg ada gw malah kena marah sm Liena -_-"

MyFriends : hakhakhakhak...99x itulah gunanya elu,...siapa lg coba yg bisa tolongin gw :D


Me : ah,...taek lo. bahasa² kayak gini nih yg paling gw benci hahahhaha :p


MyFriends : hakhakhakhakhak...99x 


Me : Ok...nanti gw kasih kabar.


Singkat cerita setelah toolsnya sudah gw download gw langsung mulai lihat² toolsnya. ternyata filenya dalam bentuk *.jar -_-
ok gw lmulai dr klik kanan -> properties => truss gw liat² apa ajah keterangan² yag ada di situ....hmmm sepertinya tidak ada yang menarik di sini.

Kayaknya gw harus pake tools kesayangan gw buat liat filenya :D 
Nama Toolsnya "FileAnalyzer" (Kalau ga tau nanti gw kasih filenya ^_^ )
setelah gw buka,...tadaaaaaaaa !!!



Oke kayaknya sudah cukup untuk liat² filenya ^_^
sekarang kita coba bongkar, seperti apa sih Algoritma dari tools Gadungan ini :p
tapi pake yah???


Kasi tau ga yah?????
kasi tau ga yah????? 
wkwowkwowkwowkwowkwkw

kita coba pake tools seadanya saja :)
gimana kalo kita coba pake 7Zip ^_^ 
Jangan bilang lo kaget waktu baca tulisan 7Zip !!! ( Ga sah kaget biasa aja lageeee :D )





Dari beberapa gambar ini kita sudah bisa memperkirakan seperti apa cara kerja tools gadungan ini :)
apalagi ada file dengan tulisan "stub.dll"  wakakkakakkkk (kalian pasti tau itu file apa ^_^ )

untuk analisa selanjutnya saya serahkan kepada kalian yang membaca Tulisan ini ^_^

Oh iya untuk gambaran tentang Tools aslinya bisa berkunjung ke sini
http://www.adwind.com.mx/index.php/en/


Semoga tulisan ini bermanfaat dan berguna buat teman² yang suka "klik link" atau download file sembarangan di internet tanpa tau itu link atau file apa :)



Saran dan Kesimpulan :

  • Link atau file apapun yang ingin kita donwload di melalui media internet, sebaiknya di cek dulu melalu web scanner link/file seperti https://www.virustotal.com/
  • Sebaiknya ubah atau ganti ekstensi file² penting yang ada di PC/Laptop/Penyimpanan Eksternal Anda dengan ekstensi yang cukup mudah untuk anda ingat. sehingga ketika PC/Laptop anda terkena virus, file² tersebut tidak akan rusak. Contoh : file dengan extensi *.Docx => *.DDDDDD atau file *.rar => *.rrr ;  terserah kalian mau pake karakter apa yang terpenting selalu beri inisial awal dr ektensi tersebut ("*.D" untuk Docx / "*.r" untuk rar).
  • Segala bentuk kejahatan yang terjadi bukan karena ada niat pelakunya, tapi karena adanya kesempatan. WASPADALAH,....WASPADALAH wkwwkwowwkowwkwowkkk =)) =))



Sampai Ketemu di Tulisan saya berikutnya (Kalau ada niat buat nulis/ngetik ) ^_^

Salam


D4wFl1N
Baca Selengkapnya... Analisa tentang Tools Adwind ( Adwind Web Fake ) yang berbentuk *.jar

10 March 2013

SyRiAn Sh3ll V7

Source Lengkap bisa diambil di sini http://pastebin.com/vsnFhkyB
Baca Selengkapnya... SyRiAn Sh3ll V7

09 March 2013

Google Fusion Tables Cross Site Scripting

# Title: Google Fusion Tables XSS (HTML Injection) Vulnerability # Release Date: 07/03/2013 # Author: Junaid Hussain - [ illSecure Research Group ] # Contact: illSecResearchGroup@Gmail.com | Website: http://illSecure.com # Vulnerable Application: https://www.google.com/fusiontables/DataSource?dsrcid=implicit ------------------------------------------------------------------------------------- //##### Process: 1. go to https://www.google.com/fusiontables/DataSource?dsrcid=implicit 2. Click "Create empty table" and then click "Next" 3. Click the drop down menu on the Cards1 tab 4. Select "Change Card Layout" and then go to the Custom Tab 5. Remove the HTML code add the following code into the box:

Click here to continue

6. Click save & then Click the share button (top right) and make the link public 7. Click the drop down menu on the Cards1 tab and select the Publish Option 8. Send the Publish Link to victim. --------------------------------------------------------------------------------------- //##### Proof Of Concept: PoC: https://www.google.com/fusiontables/embedviz?viz=CARD&q=select+*+from+19VGTDJasS8NJlbbqnsiDFA_qH7Q95e2dTOKd5RU&tmplt=1&cpr=2 Video: http://www.youtube.com/watch?v=OMCJQ8Atkek&feature=youtu.be --------------------------------------------------------------------------------------- Contact: illSecResearchGroup@gmail.com - Junaid Hussain http://www.illsecure.com --------------------------------------------------------------------------------------- Original: http://www.illsecure.com/2013/03/exclusive-google-fusion-tables-xss-html.html ---------------------------------------------------------------------------------------
Baca Selengkapnya... Google Fusion Tables Cross Site Scripting

04 March 2013

Learning Whitehat Hacking and Penetration Testing 2012

Infinite Skills - Learning Whitehat Hacking and Penetration Testing 2012 | Size 1.35 GB 
SKU: 01724 | Duration: 10.5 hours - 103 lessons | Date Released: 2012-10-05
Works on: Windows PC or Mac | Format: DVD and Download | Instructor: Ric Messier


In this Ethical Hacking - Whitehat Hacking and Penetration testing training course, expert Ric Messier covers the essentials you will need to know to harden and protect your hardware and software to avoid downtime and loss of data. Protecting your networks and customer data are more important that ever, and understanding HOW you are vulnerable is the best way to learn how you can prevent attacks.

Some of the topics covered in this course are; researching and background information retrieval, networking fundamentals, a deeper look at TCP/IP and packets, as well as understanding cryptography. You will learn about scanning networks, penetration testing and the use of Metasploit, malware and viruses, DoS and DDoS attacks, web application hacking and securing wireless networks. Finally, you will learn about detection evasion and preventing programming attacks, and much more throughout this video based tutorial.

By the time you have completed this video tutorial for Whitehat Hacking and Penetration testing, you will have a deeper understanding of the areas you may be potentially be vulnerable to attack in, as well as the methods that hackers use to exploit your systems, allowing you to better understand how to secure your hardware and data from unethical hackers.


Download :

From Rapidgator

OR

From Uploaded
Part IV


Sumber : FHT

Baca Selengkapnya... Learning Whitehat Hacking and Penetration Testing 2012

Computer Hacking Forensic Investigator v8 (Slides)


Computer Hacking Forensic Investigator v8 (Slides) | 445 MB


File Computer Hacking Forensic Investigator v8 (Slides) :
Module 01 Computer Forensics in Todays World.pptx
Module 02 Computer Forensics Investigation Process.pptx
Module 03 Searching and Seizing Computers.pptx
Module 04 Digital Evidence.pptx
Module 05 First Responder Procedures.pptx
Module 06 Computer Forensics Lab.pptx
Module 07 Understanding Hard Disks and File Systems.pptx
Module 08 Windows Forensics.pptx
Module 09 Data Acquisition and Duplication.pptx
Module 10 Recovering Deleted Files and Deleted Partitions.pptx
Module 11 Forensics Investigation Using AccessData FTK.pptx
Module 12 Forensics Investigation Using EnCase.pptx
Module 13 Steganography and Image File Forensics.pptx
Module 14 Application Password Crackers.pptx
Module 15 Log Capturing and Event Correlation.pptx
Module 16 Network Forensics, Investigating Logs and Investigating Network Traffic.pptx
Module 17 Investigating Wireless Attacks.pptx
Module 18 Investigating Web Attacks.pptx
Module 19 Tracking Emails and Investigating Email Crimes.pptx
Module 20 Mobile Forensics.pptx
Module 21 Investigative Reports.pptx
Module 22 Becoming an Expert Witness.pptx

Donwload : 
Part I
Part II
Part III
Part IV
Part V

Sumber : Computer Hacking Forensic Investigator
Baca Selengkapnya... Computer Hacking Forensic Investigator v8 (Slides)

25 February 2013

Blackberry GSM codes

The following are codes that you can use on a BlackBerry.

Most require you to hold down the ALT key whilst typing the letters after the + sign (they don't need to be capitals).

IMEI number
Shows your device's international mobile equipment identity (IMEI - your serial number) on-screen.
Type "*#06#" (home screen or call screen.

Home Screen
ALT(left)+Shift(right)+Del - Restart the Blackberry (only for full-keyboard Blackberries)
ALT + JKVV - Display cause of PDP reject
ALT + CAP + H - Displays the Help Me screen
ALT + EACE - Displays the Help Me screen
ALT + ESCR - Displays the Help Me screen
ALT + NMLL - Switches the signal strength from bars to a numeric value.
ALT + LGLG - Displays the Java event log.

Soft reset
Performs a "soft" reset of your device;
Press-and-hold "Alt", then press-and-hold (left) "shift", then press-and-hold "Del".

Hard reset
The first step in troubleshooting a network, software or hardware error is often to perform a hard reset. With Java® based devices, this is accomplished by removing the battery, while the BlackBerry device is powered on. Hold the battery out for about 30 seconds, and replace. The BlackBerry device will reboot.

Note: A hard reset on a C++ based device is accomplished by pressing the Reset button.
Note: To perform a hard reset on a RIM models 850, 857, 950, or 957 device, insert the end of a paperclip inside the small hole on the back of the handheld.



The following should work on some version, but on the blackberry I had they didn't work.

Enterprise Activation (Options->Advanced)
ALT+CNFG - Settings for Enterprise Activation

Address Book
ALT+VALD - Validate the data structure and look for inconsistencies
ALT+RBLD - Force a data structure rebuild

from the Options menu, type the following (No ALT+ required)
RSET - Will prompt to erase & reload for a reload of the Address book from the BES
(n.b. this will wipe all entries, but you can goto SIM Phone Book & copy entries back afterwards)

Browser
ALT+RBVS - View web page source code
T - Top of page (in browser)
B - Bottom of page (in browser)
Space - Page down (in browser)
U - Switch between hide/unhide in title bar (in browser)

Calendar
Open up a Calendar item
ALT+VIEW Inside any Calendar item Show extra info for a Calendar event
(including message ID - handy for BES log troubleshooting)

from the Options menu, type the following (No ALT+ required)
SYNC - Enable Calendar slow sync
RSET - Will prompt for a reload of the calendar from the BES
RCFG - Request BES configuration
SCFG - Send device configuration
DCFG - Get CICAL configuration
SUPD - Enable detailed Cal. report for backup
SUPS - Disable detailed Cal. report for backup
SUPN - Disable Cal. report database
LUID - Enable view by UID
SRSL - Show Reminder status log

Messaging
ALT+VIEW - For messages, displays the RefId and FolderId for that particular message. For PIM items, displays only the RefId.

Search Application
ALT+ADVM Search Application Enabled Advanced Global Search

WLAN (WLAN wizard screen)
ALT-SMON WLAN - Enable simulated Wizard mode
ALT-SMOF WLAN - Disable simulated Wizard mode

Theme (from theme menu)
ALT+THMN - Change to no theme (B&W)
ALT+THMD - Change to default theme

Date/Time (Date/Time menu - No ALT+ required)
LOLO - Date/Time Show Network time values

SIM Card (Options->Advanced->SIM card - No ALT+ required)
MEPD - Display MEP info
MEP1 - Disable SIM personalization
MEP2 - Disable Network personalization
MEP3 - Disable Network subset personalization
MEP4 - Disable Service provider personalization
MEP5 - Disable Corporate personalization

Status (Options->Status)
BUYR - Data & Voice Usage
TEST - start a device test (Keyboard, GPS, RF, Audio (Handset,headset,bluetooth, Misc)

Shortcuts
A or C = phonebook
S = search
F = phone profiles
W or B = browser
H = help
K = locks the keys
L = calendar
V = messages
M = messages folder
R = alarm
T = tasks
U = calculator
I = applications
O = options
P = phone.
D = Memo pad

MYVER - Displays your devices model number and software version.
LD - Displays the local date
LT - Displays the local time
MYSIG - Displays the information you entered in the BlackBerry Options > Owner screen
MYPIN - Displays your devices PIN

Press and hold 'ALT' and left 'CAPS' key then press the 'Return' key. Brings up Language selection list, which you can scroll through and change.
Baca Selengkapnya... Blackberry GSM codes

RethinkDB (ReQL) The Next Generation NoSQL systems

Seperti dikutip dihalam webnya http://www.rethinkdb.com/ 

"RethinkDB is built to store JSON documents, and scale to multiple machines with very little effort. It has a pleasant query language that supports really useful queries like table joins and group by, and is easy to setup and learn."

ReQL merupakan Next Generasi NoSQL System Database dimana system ini berbeda dengan MongoDB dan system NoSQL Lainnya. berikut penjelasan RethinkDB mengenai perbedaan mereka dengan system database lainnya Cek Dis Aut

Web ini juga menyediakan pengenalan syntax untuk ReQL yang bisa dilihat di sini => Click Me!

Untuk lebih jelasnnya mengenai RethinkDB bisa dilihat disini 
RethinkDB
Baca Selengkapnya... RethinkDB (ReQL) The Next Generation NoSQL systems

24 January 2013

way2sms.py (way2sms.com)

'''
Created on 22-Jan-2013

@author: abhi
'''
import httplib,urllib
from urlparse import urlparse
headers = {'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0','Referer': 'http://site3.way2sms.com/'}
username = '7676580202'
password = 'pianist'

def open_way2sms_com():
    conn = httplib.HTTPConnection("www.way2sms.com")
    conn.request("GET","/")
    res = conn.getresponse()
    location = res.getheader('location')
    return location
def follow_redirection(url):
    k = urlparse(url)
    conn = httplib.HTTPConnection(k.netloc)
    conn.request("GET",'/')
    res = conn.getresponse()
    headers['Referer'] = url
def open_prehome(url):
    k = urlparse(url)
    conn = httplib.HTTPConnection(k.netloc)
    conn.request("GET",'/content/prehome.jsp',None,headers)
    res = conn.getresponse()
    cookie = res.getheader('Set-Cookie','cookie')
    headers.update({'Cookie':cookie.split(';')[0]})
    headers['Referer'] = 'http://'+k.netloc+'/content/prehome.jsp'

def open_homepage(url):
    '''
    GET /content/index.html HTTP/1.1
    Host: site3.way2sms.com
    User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-US,en;q=0.5
    Accept-Encoding: gzip, deflate
    Referer: http://site3.way2sms.com/content/prehome.jsp
    Cookie: JSESSIONID=A01~D7890988F6C7DC4BC7D88904D188A460.w801
    Connection: keep-alive
    '''
    k = urlparse(url)
    conn = httplib.HTTPConnection(k.netloc)
    conn.request("GET",'/content/index.html',None,headers)
    res = conn.getresponse()
    headers['Referer'] = 'http://'+k.netloc+'/content/index.html'
def do_login(u,p,url):
    '''
    POST /Login1.action HTTP/1.1
    Host: site3.way2sms.com
    User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-US,en;q=0.5
    Accept-Encoding: gzip, deflate
    Referer: http://site3.way2sms.com/content/index.html
    Cookie: JSESSIONID=A01~D7890988F6C7DC4BC7D88904D188A460.w801
    Connection: keep-alive
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 62
    
    username=7676580202&password=pianist&userLogin=no&button=Login
    '''
    paramsdict = {'username':u,'password':p,'userLogin':'no','button':'Login'}
    params = urllib.urlencode(paramsdict)
    k = urlparse(url)
    conn = httplib.HTTPConnection('127.0.0.1:8080')
    conn.request("POST",url+'Login1.action',params,headers)
    res = conn.getresponse()
    print res.msg
    print res.read()
def direct_login():
    '''
    POST /Login1.action HTTP/1.1
    Host: site3.way2sms.com
    User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-US,en;q=0.5
    Accept-Encoding: gzip, deflate
    Referer: http://site3.way2sms.com/content/index.html
    Connection: keep-alive
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 62
    '''
    u = '7676580202'
    p = 'pianist'
    mheaders = {'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0','Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8','Accept-Language': 'en-US,en;q=0.5','Accept-Encoding': 'gzip, deflate','Referer': 'http://site3.way2sms.com/content/index.html','Connection': 'keep-alive','Content-Type': 'application/x-www-form-urlencoded','Content-Length': 62}
    paramsdict = {'username':u,'password':p,'userLogin':'no','button':'Login'}
    params = urllib.urlencode(paramsdict)
    conn = httplib.HTTPConnection('127.0.0.1:8080')
    conn.request("POST",'http://site3.way2sms.com/Login1.action',params,mheaders)
    res = conn.getresponse()
    print res.msg
    print res.read()
if __name__ == '__main__':
    #location = open_way2sms_com()
    #follow_redirection(location)
    #open_prehome(location)
    #open_homepage(location)
    #do_login(username,password,location)
    direct_login()
Baca Selengkapnya... way2sms.py (way2sms.com)

23 January 2013

remote control commands to the Samsung tv over LAN

#!  /usr/bin/python

#   Title: samsungremote.py

#   Author: Asif Iqbal

#   Date: 05APR2012

#   Info: To send remote control commands to the Samsung tv over LAN

#   TODO:

import socket

import base64

import time, datetime

#IP Address of TV

tvip = "100.0.0.123" #get_settings('tvip')

#IP Address of TV

myip = "100.0.0.112" #get_settings('myip')

#Used for the access control/validation, but not after that AFAIK

mymac = "00-0c-29-3e-b1-4f" #get_settings('mymac')

#What the iPhone app reports

appstring = "iphone..iapp.samsung"

#Might need changing to match your TV type

tvappstring = "iphone.UE55C8000.iapp.samsung"

#What gets reported when it asks for permission

remotename = "Python Samsung Remote"

# Function to send keys

def sendKey(skey, dataSock, appstring):

 messagepart3 = chr(0x00) + chr(0x00) + chr(0x00) + chr(len(

base64.b64encode(skey))) + chr(0x00) + base64.b64encode(skey);

 part3 = chr(0x00) + chr(len(appstring)) + chr(0x00) \

+ appstring + chr(len(messagepart3)) + chr(0x00) + messagepart3

 dataSock.send(part3);

# Open Socket

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

sock.connect((tvip, 55000))

# Key Reference

# Normal remote keys

 #KEY_0

 #KEY_1

 #KEY_2

 #KEY_3

 #KEY_4

 #KEY_5

 #KEY_6

 #KEY_7

 #KEY_8

 #KEY_9

 #KEY_UP

 #KEY_DOWN

 #KEY_LEFT

 #KEY_RIGHT

 #KEY_MENU

 #KEY_PRECH

 #KEY_GUIDE

 #KEY_INFO

 #KEY_RETURN

 #KEY_CH_LIST

 #KEY_EXIT

 #KEY_ENTER

 #KEY_SOURCE

 #KEY_AD #KEY_PLAY

 #KEY_PAUSE

 #KEY_MUTE

 #KEY_PICTURE_SIZE

 #KEY_VOLUP

 #KEY_VOLDOWN

 #KEY_TOOLS

 #KEY_POWEROFF

 #KEY_CHUP

 #KEY_CHDOWN

 #KEY_CONTENTS

 #KEY_W_LINK #Media P

 #KEY_RSS #Internet

 #KEY_MTS #Dual

 #KEY_CAPTION #Subt

 #KEY_REWIND

 #KEY_FF

 #KEY_REC

 #KEY_STOP

# Bonus buttons not on the normal remote:

 #KEY_TV

#Don't work/wrong codes:

 #KEY_CONTENT

 #KEY_INTERNET

 #KEY_PC

 #KEY_HDMI1

 #KEY_OFF

 #KEY_POWER

 #KEY_STANDBY

 #KEY_DUAL

 #KEY_SUBT

 #KEY_CHANUP

 #KEY_CHAN_UP

 #KEY_PROGUP

 #KEY_PROG_UP

# First configure the connection

ipencoded = base64.b64encode(myip)

macencoded = base64.b64encode(mymac)

messagepart1 = chr(0x64) + chr(0x00) + chr(len(ipencoded)) \

+ chr(0x00) + ipencoded + chr(len(macencoded)) + chr(0x00) \

+ macencoded + chr(len(base64.b64encode(remotename))) + chr(0x00) \

+ base64.b64encode(remotename)

part1 = chr(0x00) + chr(len(appstring)) + chr(0x00) + appstring \

+ chr(len(messagepart1)) + chr(0x00) + messagepart1

sock.send(part1)

messagepart2 = chr(0xc8) + chr(0x00)

part2 = chr(0x00) + chr(len(appstring)) + chr(0x00) + appstring \

+ chr(len(messagepart2)) + chr(0x00) + messagepart2

sock.send(part2)

# Now send the keys as you like, e.g.,

#sendKey("KEY_VOLUP",sock,tvappstring)

#time.sleep(1)

#sendKey("KEY_TOOLS",sock,tvappstring)

#time.sleep(1)

#sendKey("KEY_RIGHT",sock,tvappstring)

#time.sleep(1)

#sendKey("KEY_DOWN",sock,tvappstring)

#time.sleep(1)

#sendKey("KEY_RIGHT",sock,tvappstring)

# Close the socket when done

#sock.closet()

### Attempt to make a samsung control ###

def key_0():

    try:

        sendKey("KEY_0",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key 0, DEBUG')

def key_1():

    try:

        sendKey("KEY_1",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key 1, DEBUG')

def key_2():

    try:

        sendKey("KEY_2",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key 2, DEBUG')

def key_3():

    try:

        sendKey("KEY_3",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key 3, DEBUG')

def key_4():

    try:

        sendKey("KEY_4",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key 4, DEBUG')

def key_5():

    try:

        sendKey("KEY_5",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key 5, DEBUG')

def key_6():

    try:

        sendKey("KEY_6",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key 6, DEBUG')

       

def key_7():

    try:

        sendKey("KEY_7",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key 7, DEBUG')

def key_8():

    try:

        sendKey("KEY_8",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key 8, DEBUG')

def key_9():

    try:

        sendKey("KEY_9",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key 9, DEBUG')

def key_up():

    try:

        sendKey("KEY_UP",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key up, DEBUG')

def key_down():

    try:

        sendKey("KEY_DOWN",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key 9, DEBUG')

def key_left():

    try:

        sendKey("KEY_LEFT",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key left, DEBUG')

def key_right():

    try:

        sendKey("KEY_RIGHT",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key right, DEBUG')

def key_menu():

    try:

        sendKey("KEY_MENU",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key menu, DEBUG')

def key_prech():

    try:

        sendKey("KEY_PRECH",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key menu, DEBUG')

def key_guide():

    try:

        sendKey("KEY_GUIDE",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key menu, DEBUG')

def key_info():

    try:

        sendKey("KEY_INFO",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key menu, DEBUG')

def key_return():

    try:

        sendKey("KEY_RETURN",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key menu, DEBUG')

def key_ch_list():

    try:

        sendKey("KEY_CH_LIST",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key menu, DEBUG')

def key_exit():

    try:

        sendKey("KEY_EXIT",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key exit, DEBUG')

def key_enter():

    try:

        sendKey("KEY_ENTER",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key enter, DEBUG')

def key_source():

    try:

        sendKey("KEY_SOURCE",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key source, DEBUG')

def key_ad():

    try:

        sendKey("KEY_AD",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key AD, DEBUG')

def key_play():

    try:

        sendKey("KEY_PLAY",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key PLAY, DEBUG')

def key_pause():

    try:

        sendKey("KEY_PAUSE",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key PAUSE, DEBUG')

def key_mute():

    try:

        sendKey("KEY_MUTE",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key PLAY, DEBUG')

def key_picture_size():

    try:

        sendKey("KEY_PICTURE_SIZE",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key PICTURE SIZE, DEBUG')

def key_volup():

    try:

        sendKey("KEY_VOLUP",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key VOLUME UP, DEBUG')

def key_voldown():

    try:

        sendKey("KEY_VOLDOWN",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key PICTURE SIZE, DEBUG')

def key_tools():

    try:

        sendKey("KEY_TOOLS",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key TOOLS, DEBUG')

def key_poweroff():

    try:

        sendKey("KEY_POWEROFF",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key POWER OFF, DEBUG')

def key_poweroff():

    try:

        sendKey("KEY_POWEROFF",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key POWER OFF, DEBUG')

       

def key_chup():

    try:

        sendKey("KEY_CHUP",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key CH UP, DEBUG')

def key_chdown():

    try:

        sendKey("KEY_CHDOWN",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key CH DOWN, DEBUG')

def key_contents():

    try:

        sendKey("KEY_CONTENTS",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key CONTENTS, DEBUG')

def key_chdown():

    try:

        sendKey("KEY_CHDOWN",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key CH DOWN, DEBUG')

def key_w_link():

    try:

        sendKey("KEY_W_LINK",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key W LINK, DEBUG')

def key_media_p():

    try:

        sendKey("Media P",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key MEDIA P, DEBUG')

def key_rss():

    try:

        sendKey("KEY_RSS",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key RSS, DEBUG')

def key_internet():

    try:

        sendKey("KEY_CHDOWN",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key INTERNET, DEBUG')

def key_mts():

    try:

        sendKey("KEY_MTS",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key CH MTS, DEBUG')

def key_dual():

    try:

        sendKey("Dual",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key DUAL, DEBUG')

def key_caption():

    try:

        sendKey("KEY_CAPTION",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key CAPTION, DEBUG')

def key_subt():

    try:

        sendKey("Subt",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key SUBT, DEBUG')

def key_rewind():

    try:

        sendKey("KEY_REWIND",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key REWIND, DEBUG')

def key_ff():

    try:

        sendKey("KEY_FF",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key CH DOWN, DEBUG')

def key_rec():

    try:

        sendKey("KEY_REC",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key REC, DEBUG')

def key_stop():

    try:

        sendKey("KEY_STOP",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key STOP, DEBUG')

def key_stop():

    try:

        sendKey("KEY_TV",sock,tvappstring)

        sock.close()

    except:

        #logger.log('Samsung remote failed pressing key STOP, DEBUG')

# To test this remote you need to call each function eg if you want to the stop key you write: key_stop()

# After this comments
Baca Selengkapnya... remote control commands to the Samsung tv over LAN

14 January 2013

An IRC bot written in Brainfuck

Usage

I've included a simple brainfuck interpreter that uses a TCP connection for input and output.
You can probably run this through a regular old brainfuck interpreter and do some crazy shit to wire it up to a TCP connection, but I didn't feel like it. You can probably make something work with socat.
You can use the custom bf interpreter like this:

netfuck hostname:port path/to/code.bf
 
For example, to connect the bot to freenode, use this:

netfuck irc.freenode.net:6667 irc-bot.bf

Then, to get it into your favorite channel, use this from IRC:

/msg bfbot J #channelname

Included Programs

A couple of simple C# programs are included.
  • bf.exe: A simple brainfuck interpreter.
  • netfuck.exe: A brainfuck interpreter that uses TCP for input/output.
  • asciitodec.exe: Converts an ASCII string to decimal to make my life easier

Status

Current capabilities of the bot:
  • Connect to IRC, respond to PING and such
  • When PRIVMSGed with "J #channelname", it joins #channelname
  • In-channel, use "$message" to have "message" echoed back to you
 Sumber : https://github.com/SirCmpwn/bf-irc-bot/
Baca Selengkapnya... An IRC bot written in Brainfuck