Skip to content
This repository has been archived by the owner on Apr 19, 2020. It is now read-only.

Commit

Permalink
fixed No such file or directory: 'settings/dhcpd.conf' #266
Browse files Browse the repository at this point in the history
  • Loading branch information
mh4x0f committed Aug 9, 2017
1 parent 4c5c9c5 commit 81e5e88
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Version 0.8.5
- fixed PhishingManager error when try shutdown httpd server
- fixed Windows UpdateFake modules
- fixed check return is NoneType from function get_interface_mac
- fixed No such file or directory: 'settings/dhcpd.conf' #266

Version 0.8.4
-------------
Expand Down
1 change: 1 addition & 0 deletions core/config/commits/Lcommits.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ master:
{ changelog : 'fixed PhishingManager error when try shutdown httpd server' },
{ changelog : 'fixed Windows UpdateFake modules' },
{ changelog : 'fixed check return is NoneType from function get_interface_mac' },
{ changelog : 'fixed No such file or directory: 'settings/dhcpd.conf' #266' },
]

WiFiPumpkin084:
Expand Down
23 changes: 9 additions & 14 deletions core/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1206,22 +1206,17 @@ def CoreSettings(self):
}
print('[*] Enable forwarding in iptables...')
Refactor.set_ip_forward(1)
# clean iptables settings
for line in self.SettingsAP['kill']: Popen(split(line), stdout=PIPE,shell=False,stderr=PIPE)
# set interface using ifconfig
for line in self.SettingsAP['interface']: Popen(split(line), stdout=PIPE,shell=False,stderr=PIPE)
dhcp_select = self.FSettings.Settings.get_setting('accesspoint','dhcp_server')
if dhcp_select != 'dnsmasq':
with open('settings/dhcpd.conf','w') as dhcp:
for i in self.SettingsAP['dhcp-server']:dhcp.write(i)
dhcp.close()
if path.isfile('/etc/dhcp/dhcpd.conf'):
system('rm /etc/dhcp/dhcpd.conf')
if not path.isdir('/etc/dhcp/'):mkdir('/etc/dhcp')
move('settings/dhcpd.conf', '/etc/dhcp/')
else:
with open('core/config/dnsmasq.conf','w') as dhcp:
for i in self.SettingsAP['dnsmasq']:
dhcp.write(i)
# check if dhcp option is enabled.
if self.FSettings.Settings.get_setting('accesspoint','dhcp_server',format=bool):
with open('core/config/dhcpd_wp.conf','w') as dhcp:
for line in self.SettingsAP['dhcp-server']:dhcp.write(line)
dhcp.close()
if not path.isdir('/etc/dhcp/'): mkdir('/etc/dhcp')
move('core/config/dhcpd_wp.conf', '/etc/dhcp/')

def SoftDependencies(self):
''' check if Hostapd, isc-dhcp-server is installed '''
Expand Down Expand Up @@ -1403,7 +1398,7 @@ def Start_PumpAP(self):
print('[*] Configuring dhcpd...')
if self.FSettings.Settings.get_setting('accesspoint','dhcpd_server',format=bool):
self.Thread_dhcp = ThRunDhcp(['dhcpd','-d','-f','-lf','/var/lib/dhcp/dhcpd.leases','-cf',
'/etc/dhcp/dhcpd.conf',self.SettingsEnable['AP_iface']],self.currentSessionID)
'/etc/dhcp/dhcpd_wp.conf',self.SettingsEnable['AP_iface']],self.currentSessionID)
self.Thread_dhcp.sendRequest.connect(self.GetDHCPRequests)
self.Thread_dhcp.setObjectName('DHCP')
self.Apthreads['RougeAP'].append(self.Thread_dhcp)
Expand Down

0 comments on commit 81e5e88

Please sign in to comment.