Skip to content

Commit f2ee65a

Browse files
authored
Merge pull request #10 from mayankmetha/master
Added hostapd
2 parents ce956fa + d003c5f commit f2ee65a

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

wifite/tools/hostapd.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
from .dependency import Dependency
5+
from ..util.process import Process
6+
7+
class Hostapd(Dependency):
8+
dependency_required = False
9+
dependency_name = 'hostapd'
10+
dependency_url = 'apt-get install hostapd'
11+
12+
@classmethod
13+
def run(slef, iface, target):
14+
15+
fout = open('/tmp/hostapd.conf','w')
16+
fout.write('interface='+iface+'\n')
17+
fout.write('ssid='+target.essid+'\n')
18+
fout.write('channel='+target.channel+'\n')
19+
fout.write('driver=nl80211\n')
20+
fout.close()
21+
22+
command = [
23+
'hostapd',
24+
'/tmp/hostapd.conf'
25+
]
26+
process = Process(command)
27+
28+
return None
29+
30+
@classmethod
31+
def stop(self):
32+
if hasattr(self, 'pid') and self.pid and self.pid.poll() is None:
33+
self.pid.interrupt()
34+
return None

0 commit comments

Comments
 (0)